]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man7/man-pages.7
man-pages.7: Add REPORTING BUGS section
[thirdparty/man-pages.git] / man7 / man-pages.7
1 .\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler
2 .\" (faith@cs.unc.edu and dwheeler@ida.org)
3 .\" and (C) Copyright 2007 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" 2007-05-30 created by mtk, using text from old man.7 plus
28 .\" rewrites and additional text.
29 .\"
30 .TH MAN-PAGES 7 2020-04-11 "Linux" "Linux Programmer's Manual"
31 .SH NAME
32 man-pages \- conventions for writing Linux man pages
33 .SH SYNOPSIS
34 .B man
35 .RI [ section ]
36 .I title
37 .SH DESCRIPTION
38 This page describes the conventions that should be employed
39 when writing man pages for the Linux \fIman-pages\fP project,
40 which documents the user-space API provided by the Linux kernel
41 and the GNU C library.
42 The project thus provides most of the pages in Section 2,
43 many of the pages that appear in Sections 3, 4, and 7,
44 and a few of the pages that appear in Sections 1, 5, and 8
45 of the man pages on a Linux system.
46 The conventions described on this page may also be useful
47 for authors writing man pages for other projects.
48 .SS Sections of the manual pages
49 .PP
50 The manual Sections are traditionally defined as follows:
51 .TP
52 .B 1 User commands (Programs)
53 Commands that can be executed by the user from within
54 a shell.
55 .TP
56 .B 2 System calls
57 Functions which wrap operations performed by the kernel.
58 .TP
59 .B 3 Library calls
60 All library functions excluding the system call wrappers
61 (Most of the
62 .I libc
63 functions).
64 .TP
65 .B 4 Special files (devices)
66 Files found in
67 .I /dev
68 which allow to access to devices through the kernel.
69 .TP
70 .B 5 File formats and configuration files
71 Describes various human-readable file formats and configuration files.
72 .TP
73 .B 6 Games
74 Games and funny little programs available on the system.
75 .TP
76 .B 7 Overview, conventions, and miscellaneous
77 Overviews or descriptions of various topics, conventions and protocols,
78 character set standards, the standard filesystem layout, and miscellaneous
79 other things.
80 .TP
81 .B 8 System management commands
82 Commands like
83 .BR mount (8),
84 many of which only root can execute.
85 .\" .TP
86 .\" .B 9 Kernel routines
87 .\" This is an obsolete manual section.
88 .\" Once it was thought a good idea to document the Linux kernel here,
89 .\" but in fact very little has been documented, and the documentation
90 .\" that exists is outdated already.
91 .\" There are better sources of
92 .\" information for kernel developers.
93 .SS Macro package
94 New manual pages should be marked up using the
95 .B groff an.tmac
96 package described in
97 .BR man (7).
98 This choice is mainly for consistency: the vast majority of
99 existing Linux manual pages are marked up using these macros.
100 .SS Conventions for source file layout
101 Please limit source code line length to no more than about 75 characters
102 wherever possible.
103 This helps avoid line-wrapping in some mail clients when patches are
104 submitted inline.
105 .SS Title line
106 The first command in a man page should be a
107 .B TH
108 command:
109 .PP
110 .RS
111 .B \&.TH
112 .I "title section date source manual"
113 .RE
114 .PP
115 where:
116 .RS
117 .TP 10
118 .I title
119 The title of the man page, written in all caps (e.g.,
120 .IR MAN-PAGES ).
121 .TP
122 .I section
123 The section number in which the man page should be placed (e.g.,
124 .IR 7 ).
125 .TP
126 .I date
127 The date of the last nontrivial change that was made to the man page.
128 (Within the
129 .I man-pages
130 project, the necessary updates to these timestamps are handled
131 automatically by scripts, so there is no need to manually update
132 them as part of a patch.)
133 Dates should be written in the form YYYY-MM-DD.
134 .TP
135 .I source
136 The source of the command, function, or system call.
137 .IP
138 For those few \fIman-pages\fP pages in Sections 1 and 8,
139 probably you just want to write
140 .IR GNU .
141 .IP
142 For system calls, just write
143 .IR "Linux" .
144 (An earlier practice was to write the version number
145 of the kernel from which the manual page was being written/checked.
146 However, this was never done consistently, and so was
147 probably worse than including no version number.
148 Henceforth, avoid including a version number.)
149 .IP
150 For library calls that are part of glibc or one of the
151 other common GNU libraries, just use
152 .IR "GNU C Library" ", " GNU ,
153 or an empty string.
154 .IP
155 For Section 4 pages, use
156 .IR "Linux" .
157 .IP
158 In cases of doubt, just write
159 .IR Linux ", or " GNU .
160 .TP
161 .I manual
162 The title of the manual (e.g., for Section 2 and 3 pages in
163 the \fIman-pages\fP package, use
164 .IR "Linux Programmer's Manual" ).
165 .RE
166 .SS Sections within a manual page
167 The list below shows conventional or suggested sections.
168 Most manual pages should include at least the
169 .B highlighted
170 sections.
171 Arrange a new manual page so that sections
172 are placed in the order shown in the list.
173 .PP
174 .in +4n
175 .nf
176 \fBNAME\fP
177 \fBSYNOPSIS\fP
178 CONFIGURATION [Normally only in Section 4]
179 \fBDESCRIPTION\fP
180 OPTIONS [Normally only in Sections 1, 8]
181 EXIT STATUS [Normally only in Sections 1, 8]
182 RETURN VALUE [Normally only in Sections 2, 3]
183 .\" May 07: Few current man pages have an ERROR HANDLING section,,,
184 .\" ERROR HANDLING,
185 ERRORS [Typically only in Sections 2, 3]
186 .\" May 07: Almost no current man pages have a USAGE section,,,
187 .\" USAGE,
188 .\" DIAGNOSTICS,
189 .\" May 07: Almost no current man pages have a SECURITY section,,,
190 .\" SECURITY,
191 ENVIRONMENT
192 FILES
193 VERSIONS [Normally only in Sections 2, 3]
194 ATTRIBUTES [Normally only in Sections 2, 3]
195 CONFORMING TO
196 NOTES
197 BUGS
198 EXAMPLE
199 .\" AUTHORS sections are discouraged
200 AUTHORS [Discouraged]
201 REPORTING BUGS [Not used in man-pages]
202 COPYRIGHT [Not used in man-pages]
203 \fBSEE ALSO\fP
204 .fi
205 .in
206 .PP
207 .IR "Where a traditional heading would apply" ", " "please use it" ;
208 this kind of consistency can make the information easier to understand.
209 If you must, you can create your own
210 headings if they make things easier to understand (this can
211 be especially useful for pages in Sections 4 and 5).
212 However, before doing this, consider whether you could use the
213 traditional headings, with some subsections (\fI.SS\fP) within
214 those sections.
215 .PP
216 The following list elaborates on the contents of each of
217 the above sections.
218 .TP
219 .B NAME
220 The name of this manual page.
221 .IP
222 See
223 .BR man (7)
224 for important details of the line(s) that should follow the
225 \fB.SH NAME\fP command.
226 All words in this line (including the word immediately
227 following the "\e\-") should be in lowercase,
228 except where English or technical terminological convention
229 dictates otherwise.
230 .TP
231 .B SYNOPSIS
232 A brief summary of the command or function's interface.
233 .IP
234 For commands, this shows the syntax of the command and its arguments
235 (including options);
236 boldface is used for as-is text and italics are used to
237 indicate replaceable arguments.
238 Brackets ([]) surround optional arguments, vertical bars (|)
239 separate choices, and ellipses (\&...) can be repeated.
240 For functions, it shows any required data declarations or
241 .B #include
242 directives, followed by the function declaration.
243 .IP
244 Where a feature test macro must be defined in order to obtain
245 the declaration of a function (or a variable) from a header file,
246 then the SYNOPSIS should indicate this, as described in
247 .BR feature_test_macros (7).
248 .\" FIXME . Say something here about compiler options
249 .TP
250 .B CONFIGURATION
251 Configuration details for a device.
252 .IP
253 This section normally appears only in Section 4 pages.
254 .TP
255 .B DESCRIPTION
256 An explanation of what the program, function, or format does.
257 .IP
258 Discuss how it interacts with files and standard input, and what it
259 produces on standard output or standard error.
260 Omit internals and implementation details unless they're critical for
261 understanding the interface.
262 Describe the usual case;
263 for information on command-line options of a program use the
264 .B OPTIONS
265 section.
266 .\" If there is some kind of input grammar or complex set of subcommands,
267 .\" consider describing them in a separate
268 .\" .B USAGE
269 .\" section (and just place an overview in the
270 .\" .B DESCRIPTION
271 .\" section).
272 .IP
273 When describing new behavior or new flags for
274 a system call or library function,
275 be careful to note the kernel or C library version
276 that introduced the change.
277 The preferred method of noting this information for flags is as part of a
278 .B .TP
279 list, in the following form (here, for a new system call flag):
280 .RS 22
281 .TP
282 .BR XYZ_FLAG " (since Linux 3.7)"
283 Description of flag...
284 .RE
285 .IP
286 Including version information is especially useful to users
287 who are constrained to using older kernel or C library versions
288 (which is typical in embedded systems, for example).
289 .TP
290 .B OPTIONS
291 A description of the command-line options accepted by a
292 program and how they change its behavior.
293 .IP
294 This section should appear only for Section 1 and 8 manual pages.
295 .\" .TP
296 .\" .B USAGE
297 .\" describes the grammar of any sublanguage this implements.
298 .TP
299 .B EXIT STATUS
300 A list of the possible exit status values of a program and
301 the conditions that cause these values to be returned.
302 .IP
303 This section should appear only for Section 1 and 8 manual pages.
304 .TP
305 .B RETURN VALUE
306 For Section 2 and 3 pages, this section gives a
307 list of the values the library routine will return to the caller
308 and the conditions that cause these values to be returned.
309 .TP
310 .B ERRORS
311 For Section 2 and 3 manual pages, this is a list of the
312 values that may be placed in
313 .I errno
314 in the event of an error, along with information about the cause
315 of the errors.
316 .IP
317 Where several different conditions produce the same error,
318 the preferred approach is to create separate list entries
319 (with duplicate error names) for each of the conditions.
320 This makes the separate conditions clear, may make the list easier to read,
321 and allows metainformation
322 (e.g., kernel version number where the condition first became applicable)
323 to be more easily marked for each condition.
324 .IP
325 .IR "The error list should be in alphabetical order" .
326 .TP
327 .B ENVIRONMENT
328 A list of all environment variables that affect the program or function
329 and how they affect it.
330 .TP
331 .B FILES
332 A list of the files the program or function uses, such as
333 configuration files, startup files,
334 and files the program directly operates on.
335 .IP
336 Give the full pathname of these files, and use the installation
337 process to modify the directory part to match user preferences.
338 For many programs, the default installation location is in
339 .IR /usr/local ,
340 so your base manual page should use
341 .I /usr/local
342 as the base.
343 .\" May 07: Almost no current man pages have a DIAGNOSTICS section;
344 .\" "RETURN VALUE" or "EXIT STATUS" is preferred.
345 .\" .TP
346 .\" .B DIAGNOSTICS
347 .\" gives an overview of the most common error messages and how to
348 .\" cope with them.
349 .\" You don't need to explain system error messages
350 .\" or fatal signals that can appear during execution of any program
351 .\" unless they're special in some way to the program.
352 .\"
353 .\" May 07: Almost no current man pages have a SECURITY section.
354 .\".TP
355 .\".B SECURITY
356 .\"discusses security issues and implications.
357 .\"Warn about configurations or environments that should be avoided,
358 .\"commands that may have security implications, and so on, especially
359 .\"if they aren't obvious.
360 .\"Discussing security in a separate section isn't necessary;
361 .\"if it's easier to understand, place security information in the
362 .\"other sections (such as the
363 .\" .B DESCRIPTION
364 .\" or
365 .\" .B USAGE
366 .\" section).
367 .\" However, please include security information somewhere!
368 .TP
369 .B ATTRIBUTES
370 A summary of various attributes of the function(s) documented on this page.
371 See
372 .BR attributes (7)
373 for further details.
374 .TP
375 .B VERSIONS
376 A brief summary of the Linux kernel or glibc versions where a
377 system call or library function appeared,
378 or changed significantly in its operation.
379 .IP
380 As a general rule, every new interface should
381 include a VERSIONS section in its manual page.
382 Unfortunately,
383 many existing manual pages don't include this information
384 (since there was no policy to do so when they were written).
385 Patches to remedy this are welcome,
386 but, from the perspective of programmers writing new code,
387 this information probably matters only in the case of kernel
388 interfaces that have been added in Linux 2.4 or later
389 (i.e., changes since kernel 2.2),
390 and library functions that have been added to glibc since version 2.1
391 (i.e., changes since glibc 2.0).
392 .IP
393 The
394 .BR syscalls (2)
395 manual page also provides information about kernel versions
396 in which various system calls first appeared.
397 .TP
398 .B CONFORMING TO
399 A description of any standards or conventions that relate to the function
400 or command described by the manual page.
401 .IP
402 The preferred terms to use for the various standards are listed as
403 headings in
404 .BR standards (7).
405 .IP
406 For a page in Section 2 or 3,
407 this section should note the POSIX.1
408 version(s) that the call conforms to,
409 and also whether the call is specified in C99.
410 (Don't worry too much about other standards like SUS, SUSv2, and XPG,
411 or the SVr4 and 4.xBSD implementation standards,
412 unless the call was specified in those standards,
413 but isn't in the current version of POSIX.1.)
414 .IP
415 If the call is not governed by any standards but commonly
416 exists on other systems, note them.
417 If the call is Linux-specific, note this.
418 .IP
419 If this section consists of just a list of standards
420 (which it commonly does),
421 terminate the list with a period (\(aq.\(aq).
422 .TP
423 .B NOTES
424 Miscellaneous notes.
425 .IP
426 For Section 2 and 3 man pages you may find it useful to include
427 subsections (\fBSS\fP) named \fILinux Notes\fP and \fIGlibc Notes\fP.
428 .IP
429 In Section 2, use the heading
430 .I "C library/kernel differences"
431 to mark off notes that describe the differences (if any) between
432 the C library wrapper function for a system call and
433 the raw system call interface provided by the kernel.
434 .TP
435 .B BUGS
436 A list of limitations, known defects or inconveniences,
437 and other questionable activities.
438 .TP
439 .B EXAMPLE
440 One or more examples demonstrating how this function, file or
441 command is used.
442 .IP
443 For details on writing example programs,
444 see \fIExample programs\fP below.
445 .TP
446 .B AUTHORS
447 A list of authors of the documentation or program.
448 .IP
449 \fBUse of an AUTHORS section is strongly discouraged\fP.
450 Generally, it is better not to clutter every page with a list
451 of (over time potentially numerous) authors;
452 if you write or significantly amend a page,
453 add a copyright notice as a comment in the source file.
454 If you are the author of a device driver and want to include
455 an address for reporting bugs, place this under the BUGS section.
456 .TP
457 .B REPORTING BUGS
458 The
459 .IR man-pages
460 project doesn't use a REPORTING BUGS section in manual pages.
461 Information on reporting bugs is instead supplied in the
462 script-generated COLOPHON section.
463 However, various projects do use a REPORTING BUGS section.
464 it is recommended to place it near the foot of the page.
465 .TP
466 .B COPYRIGHT
467 The
468 .IR man-pages
469 project doesn't use a COPYRIGHT section in manual pages.
470 Copyright information is instead maintained in the page source.
471 In pages where this section is present,
472 it is recommended to place it near the foot of the page, just above SEE ALSO.
473 .TP
474 .B SEE ALSO
475 A comma-separated list of related man pages, possibly followed by
476 other related pages or documents.
477 .IP
478 The list should be ordered by section number and
479 then alphabetically by name.
480 Do not terminate this list with a period.
481 .IP
482 Where the SEE ALSO list contains many long manual page names,
483 to improve the visual result of the output, it may be useful to employ the
484 .I .ad l
485 (don't right justify)
486 and
487 .I .nh
488 (don't hyphenate)
489 directives.
490 Hyphenation of individual page names can be prevented
491 by preceding words with the string "\e%".
492 .IP
493 Given the distributed, autonomous nature of FOSS projects
494 and their documentation, it is sometimes necessary\(emand in many cases
495 desirable\(emthat the SEE ALSO section includes references to
496 manual pages provided by other projects.
497 .SH STYLE GUIDE
498 The following subsections describe the preferred style for the
499 .IR man-pages
500 project.
501 For details not covered below, the Chicago Manual of Style
502 is usually a good source;
503 try also grepping for preexisting usage in the project source tree.
504 .SS Use of gender-neutral language
505 As far as possible, use gender-neutral language in the text of man
506 pages.
507 Use of "they" ("them", "themself", "their") as a gender-neutral singular
508 pronoun is acceptable.
509 .\"
510 .SS Formatting conventions for manual pages describing commands
511 .PP
512 For manual pages that describe a command (typically in Sections 1 and 8),
513 the arguments are always specified using italics,
514 .IR "even in the SYNOPSIS section" .
515 .PP
516 The name of the command, and its options, should
517 always be formatted in bold.
518 .\"
519 .SS Formatting conventions for manual pages describing functions
520 For manual pages that describe functions (typically in Sections 2 and 3),
521 the arguments are always specified using italics,
522 .IR "even in the SYNOPSIS section" ,
523 where the rest of the function is specified in bold:
524 .PP
525 .BI " int myfunction(int " argc ", char **" argv );
526 .PP
527 Variable names should, like argument names, be specified in italics.
528 .PP
529 Any reference to the subject of the current manual page
530 should be written with the name in bold followed by
531 a pair of parentheses in Roman (normal) font.
532 For example, in the
533 .BR fcntl (2)
534 man page, references to the subject of the page would be written as:
535 .BR fcntl ().
536 The preferred way to write this in the source file is:
537 .PP
538 .EX
539 .BR fcntl ()
540 .EE
541 .PP
542 (Using this format, rather than the use of "\efB...\efP()"
543 makes it easier to write tools that parse man page source files.)
544 .\"
545 .SS Use semantic newlines
546 In the source of a manual page,
547 new sentences should be started on new lines,
548 and long sentences should split into lines at clause breaks
549 (commas, semicolons, colons, and so on).
550 This convention, sometimes known as "semantic newlines",
551 makes it easier to see the effect of patches,
552 which often operate at the level of individual sentences or sentence clauses.
553 .\"
554 .SS Formatting conventions (general)
555 .PP
556 Paragraphs should be separated by suitable markers (usually either
557 .I .PP
558 or
559 .IR .IP ).
560 Do
561 .I not
562 separate paragraphs using blank lines, as this results in poor rendering
563 in some output formats (such as PostScript and PDF).
564 .PP
565 Filenames (whether pathnames, or references to header files)
566 are always in italics (e.g.,
567 .IR <stdio.h> ),
568 except in the SYNOPSIS section, where included files are in bold (e.g.,
569 .BR "#include <stdio.h>" ).
570 When referring to a standard header file include,
571 specify the header file surrounded by angle brackets,
572 in the usual C way (e.g.,
573 .IR <stdio.h> ).
574 .PP
575 Special macros, which are usually in uppercase, are in bold (e.g.,
576 .BR MAXINT ).
577 Exception: don't boldface NULL.
578 .PP
579 When enumerating a list of error codes, the codes are in bold (this list
580 usually uses the
581 .B \&.TP
582 macro).
583 .PP
584 Complete commands should, if long,
585 be written as an indented line on their own,
586 with a blank line before and after the command, for example
587 .PP
588 .in +4n
589 .EX
590 man 7 man\-pages
591 .EE
592 .in
593 .PP
594 If the command is short, then it can be included inline in the text,
595 in italic format, for example,
596 .IR "man 7 man-pages" .
597 In this case, it may be worth using nonbreaking spaces
598 ("\e\ ") at suitable places in the command.
599 Command options should be written in italics (e.g.,
600 .IR \-l ).
601 .PP
602 Expressions, if not written on a separate indented line, should
603 be specified in italics.
604 Again, the use of nonbreaking spaces may be appropriate
605 if the expression is inlined with normal text.
606 .PP
607 When showing example shell sessions, user input should be formatted in bold, for example
608 .PP
609 .in +4n
610 .EX
611 $ \fBdate\fP
612 Thu Jul 7 13:01:27 CEST 2016
613 .EE
614 .in
615 .PP
616 .PP
617 Any reference to another man page
618 should be written with the name in bold,
619 .I always
620 followed by the section number,
621 formatted in Roman (normal) font, without any
622 separating spaces (e.g.,
623 .BR intro (2)).
624 The preferred way to write this in the source file is:
625 .PP
626 .EX
627 .BR intro (2)
628 .EE
629 .PP
630 (Including the section number in cross references lets tools like
631 .BR man2html (1)
632 create properly hyperlinked pages.)
633 .PP
634 Control characters should be written in bold face,
635 with no quotes; for example,
636 .BR ^X .
637 .SS Spelling
638 Starting with release 2.59,
639 .I man-pages
640 follows American spelling conventions
641 (previously, there was a random mix of British and American spellings);
642 please write all new pages and patches according to these conventions.
643 .PP
644 Aside from the well-known spelling differences,
645 there are a few other subtleties to watch for:
646 .IP * 3
647 American English tends to use the forms "backward", "upward", "toward",
648 and so on
649 rather than the British forms "backwards", "upwards", "towards", and so on.
650 .SS BSD version numbers
651 The classical scheme for writing BSD version numbers is
652 .IR x.yBSD ,
653 where
654 .I x.y
655 is the version number (e.g., 4.2BSD).
656 Avoid forms such as
657 .IR "BSD 4.3" .
658 .SS Capitalization
659 In subsection ("SS") headings,
660 capitalize the first word in the heading, but otherwise use lowercase,
661 except where English usage (e.g., proper nouns) or programming
662 language requirements (e.g., identifier names) dictate otherwise.
663 For example:
664 .PP
665 .EX
666 .SS Unicode under Linux
667 .EE
668 .\"
669 .SS Indentation of structure definitions, shell session logs, and so on
670 When structure definitions, shell session logs, and so on are included
671 in running text, indent them by 4 spaces (i.e., a block enclosed by
672 .I ".in\ +4n"
673 and
674 .IR ".in" ),
675 format them using the
676 .I .EX
677 and
678 .I EE
679 macros, and surround them with suitable paragraph markers (either
680 .I .PP
681 or
682 .IR .IP ).
683 For example:
684 .PP
685 .in +4n
686 .EX
687 .PP
688 .in +4n
689 .EX
690 int
691 main(int argc, char *argv[])
692 {
693 return 0;
694 }
695 .EE
696 .in
697 .PP
698 .EE
699 .in
700 .SS Preferred terms
701 The following table lists some preferred terms to use in man pages,
702 mainly to ensure consistency across pages.
703 .TS
704 l l l
705 ---
706 l l l.
707 Term Avoid using Notes
708
709 bit mask bitmask
710 built-in builtin
711 Epoch epoch T{
712 For the UNIX Epoch (00:00:00, 1 Jan 1970 UTC)
713 T}
714 filename file name
715 filesystem file system
716 hostname host name
717 inode i-node
718 lowercase lower case, lower-case
719 nonzero non-zero
720 pathname path name
721 pseudoterminal pseudo-terminal
722 privileged port T{
723 reserved port,
724 system port
725 T}
726 real-time T{
727 realtime,
728 real time
729 T}
730 run time runtime
731 saved set-group-ID T{
732 saved group ID,
733 saved set-GID
734 T}
735 saved set-user-ID T{
736 saved user ID,
737 saved set-UID
738 T}
739 set-group-ID set-GID, setgid
740 set-user-ID set-UID, setuid
741 superuser T{
742 super user,
743 super-user
744 T}
745 superblock T{
746 super block,
747 super-block
748 T}
749 timestamp time stamp
750 timezone time zone
751 uppercase upper case, upper-case
752 usable useable
753 user space userspace
754 username user name
755 x86-64 x86_64 T{
756 Except if referring to result of "uname\ \-m" or similar
757 T}
758 zeros zeroes
759 .TE
760 .PP
761 See also the discussion
762 .IR "Hyphenation of attributive compounds"
763 below.
764 .SS Terms to avoid
765 The following table lists some terms to avoid using in man pages,
766 along with some suggested alternatives,
767 mainly to ensure consistency across pages.
768 .TS
769 l l l
770 ---
771 l l l.
772 Avoid Use instead Notes
773
774 32bit 32-bit T{
775 same for 8-bit, 16-bit, etc.
776 T}
777 current process calling process T{
778 A common mistake made by kernel programmers when writing man pages
779 T}
780 manpage T{
781 man page, manual page
782 T}
783 minus infinity negative infinity
784 non-root unprivileged user
785 non-superuser unprivileged user
786 nonprivileged unprivileged
787 OS operating system
788 plus infinity positive infinity
789 pty pseudoterminal
790 tty terminal
791 Unices UNIX systems
792 Unixes UNIX systems
793 .TE
794 .SS Trademarks
795 Use the correct spelling and case for trademarks.
796 The following is a list of the correct spellings of various
797 relevant trademarks that are sometimes misspelled:
798 .PP
799 DG/UX
800 HP-UX
801 UNIX
802 UnixWare
803 .SS NULL, NUL, null pointer, and null character
804 A
805 .IR "null pointer"
806 is a pointer that points to nothing,
807 and is normally indicated by the constant
808 .IR NULL .
809 On the other hand,
810 .I NUL
811 is the
812 .IR "null byte",
813 a byte with the value 0, represented in C via the character constant
814 .IR \(aq\e0\(aq .
815 .PP
816 The preferred term for the pointer is "null pointer" or simply "NULL";
817 avoid writing "NULL pointer".
818 .PP
819 The preferred term for the byte is "null byte".
820 Avoid writing "NUL", since it is too easily confused with "NULL".
821 Avoid also the terms "zero byte" and "null character".
822 The byte that terminates a C string should be described
823 as "the terminating null byte";
824 strings may be described as "null-terminated",
825 but avoid the use of "NUL-terminated".
826 .SS Hyperlinks
827 For hyperlinks, use the
828 .IR .UR / .UE
829 macro pair
830 (see
831 .BR groff_man (7)).
832 This produces proper hyperlinks that can be used in a web browser,
833 when rendering a page with, say:
834 .PP
835 BROWSER=firefox man -H pagename
836 .SS Use of e.g., i.e., etc., a.k.a., and similar
837 In general, the use of abbreviations such as "e.g.", "i.e.", "etc.",
838 "cf.", and "a.k.a." should be avoided,
839 in favor of suitable full wordings
840 ("for example", "that is", "compare to", "and so on", "also known as").
841 .PP
842 The only place where such abbreviations may be acceptable is in
843 .I short
844 parenthetical asides (e.g., like this one).
845 .PP
846 Always include periods in such abbreviations, as shown here.
847 In addition, "e.g." and "i.e." should always be followed by a comma.
848 .SS Em-dashes
849 The way to write an em-dash\(emthe glyph that appears
850 at either end of this subphrase\(emin *roff is with the macro "\e(em".
851 (On an ASCII terminal, an em-dash typically renders as two hyphens,
852 but in other typographical contexts it renders as a long dash.)
853 Em-dashes should be written
854 .I without
855 surrounding spaces.
856 .SS Hyphenation of attributive compounds
857 Compound terms should be hyphenated when used attributively
858 (i.e., to qualify a following noun). Some examples:
859 .PP
860 32-bit value
861 command-line argument
862 floating-point number
863 run-time check
864 user-space function
865 wide-character string
866 .SS Hyphenation with multi, non, pre, re, sub, and so on
867 The general tendency in modern English is not to hyphenate
868 after prefixes such as "multi", "non", "pre", "re", "sub", and so on.
869 Manual pages should generally follow this rule when these prefixes are
870 used in natural English constructions with simple suffixes.
871 The following list gives some examples of the preferred forms:
872 .PP
873 interprocess
874 multithreaded
875 multiprocess
876 nonblocking
877 nondefault
878 nonempty
879 noninteractive
880 nonnegative
881 nonportable
882 nonzero
883 preallocated
884 precreate
885 prerecorded
886 reestablished
887 reinitialize
888 rearm
889 reread
890 subcomponent
891 subdirectory
892 subsystem
893 .PP
894 Hyphens should be retained when the prefixes are used in nonstandard
895 English words, with trademarks, proper nouns, acronyms, or compound terms.
896 Some examples:
897 .PP
898 non-ASCII
899 non-English
900 non-NULL
901 non-real-time
902 .PP
903 Finally, note that "re-create" and "recreate" are two different verbs,
904 and the former is probably what you want.
905 .SS Real minus character
906 Where a real minus character is required (e.g., for numbers such as \-1,
907 for man page cross references such as
908 .BR utf\-8 (7),
909 or when writing options that have a leading dash, such as in
910 .IR "ls\ \-l"),
911 use the following form in the man page source:
912 .PP
913 \e\-
914 .PP
915 This guideline applies also to code examples.
916 .SS Character constants
917 To produce single quotes that render well in both ASCII and UTF-8,
918 use the following form for character constants in the man page source:
919 .PP
920 \e(aqC\e(aq
921 .PP
922 where
923 .I C
924 is the quoted character.
925 This guideline applies also to character constants used in code examples.
926 .SS Example programs and shell sessions
927 Manual pages may include example programs demonstrating how to
928 use a system call or library function.
929 However, note the following:
930 .IP * 3
931 Example programs should be written in C.
932 .IP *
933 An example program is necessary and useful only if it demonstrates
934 something beyond what can easily be provided in a textual
935 description of the interface.
936 An example program that does nothing
937 other than call an interface usually serves little purpose.
938 .IP *
939 Example programs should be fairly short (preferably less than 100 lines;
940 ideally less than 50 lines).
941 .IP *
942 Example programs should do error checking after system calls and
943 library function calls.
944 .IP *
945 Example programs should be complete, and compile without
946 warnings when compiled with \fIcc\ \-Wall\fP.
947 .IP *
948 Where possible and appropriate, example programs should allow
949 experimentation, by varying their behavior based on inputs
950 (ideally from command-line arguments, or alternatively, via
951 input read by the program).
952 .IP *
953 Example programs should be laid out according to Kernighan and
954 Ritchie style, with 4-space indents.
955 (Avoid the use of TAB characters in source code!)
956 The following command can be used to format your source code to
957 something close to the preferred style:
958 .IP
959 indent \-npro \-kr \-i4 \-ts4 \-sob \-l72 \-ss \-nut \-psl prog.c
960 .IP *
961 For consistency, all example programs should terminate using either of:
962 .IP
963 exit(EXIT_SUCCESS);
964 exit(EXIT_FAILURE);
965 .IP
966 Avoid using the following forms to terminate a program:
967 .IP
968 exit(0);
969 exit(1);
970 return n;
971 .IP *
972 If there is extensive explanatory text before the
973 program source code, mark off the source code
974 with a subsection heading
975 .IR "Program source" ,
976 as in:
977 .IP
978 .SS Program source
979 .IP
980 Always do this if the explanatory text includes a shell session log.
981 .PP
982 If you include a shell session log demonstrating the use of a program
983 or other system feature:
984 .IP * 3
985 Place the session log above the source code listing
986 .IP *
987 Indent the session log by four spaces.
988 .IP *
989 Boldface the user input text,
990 to distinguish it from output produced by the system.
991 .PP
992 For some examples of what example programs should look like, see
993 .BR wait (2)
994 and
995 .BR pipe (2).
996 .SH EXAMPLE
997 For canonical examples of how man pages in the
998 .I man-pages
999 package should look, see
1000 .BR pipe (2)
1001 and
1002 .BR fcntl (2).
1003 .SH SEE ALSO
1004 .BR man (1),
1005 .BR man2html (1),
1006 .BR attributes (7),
1007 .BR groff (7),
1008 .BR groff_man (7),
1009 .BR man (7),
1010 .BR mdoc (7)