man-pages/man7/man-pages.7

631 lines
20 KiB
Groff
Raw Normal View History

.\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler
.\" (faith@cs.unc.edu and dwheeler@ida.org)
2007-09-20 06:52:22 +00:00
.\" and (C) Copyright 2007 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
intro.1, _exit.2, access.2, alarm.2, alloc_hugepages.2, arch_prctl.2, bind.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, close.2, connect.2, delete_module.2, dup.2, execve.2, exit_group.2, faccessat.2, fchmodat.2, fchownat.2, fcntl.2, fork.2, fstatat.2, fsync.2, futimesat.2, get_robust_list.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getpagesize.2, getpid.2, getresuid.2, getrlimit.2, getrusage.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, idle.2, init_module.2, intro.2, iopl.2, kcmp.2, kexec_load.2, kill.2, link.2, linkat.2, llseek.2, lookup_dcookie.2, madvise.2, mincore.2, mkdirat.2, mknodat.2, mmap.2, mmap2.2, mount.2, mprotect.2, mq_getsetattr.2, msgctl.2, msgget.2, msgop.2, msync.2, nice.2, open.2, openat.2, pause.2, perfmonctl.2, personality.2, pipe.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, quotactl.2, read.2, readahead.2, readdir.2, readlinkat.2, readv.2, reboot.2, recvmmsg.2, remap_file_pages.2, rename.2, renameat.2, rmdir.2, rt_sigqueueinfo.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, sendmmsg.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setresuid.2, setuid.2, setup.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, signal.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, splice.2, stat.2, statfs.2, stime.2, subpage_prot.2, swapon.2, symlink.2, symlinkat.2, sync.2, sync_file_range.2, syscalls.2, sysctl.2, sysfs.2, syslog.2, tee.2, time.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, times.2, tkill.2, umask.2, umount.2, uname.2, unlink.2, unlinkat.2, uselib.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, INFINITY.3, abort.3, abs.3, acos.3, acosh.3, adjtime.3, aio_init.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, basename.3, bcmp.3, bcopy.3, bindresvport.3, bsd_signal.3, bsearch.3, bstring.3, byteorder.3, bzero.3, catgets.3, catopen.3, cbrt.3, ceil.3, clearenv.3, clock.3, clock_getcpuclockid.3, closedir.3, confstr.3, copysign.3, cos.3, cosh.3, ctermid.3, ctime.3, difftime.3, dirfd.3, div.3, dl_iterate_phdr.3, dprintf.3, drand48.3, drand48_r.3, dysize.3, ecvt.3, ecvt_r.3, end.3, endian.3, erf.3, erfc.3, ether_aton.3, euidaccess.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fcloseall.3, fexecve.3, ffs.3, fgetgrent.3, fgetpwent.3, finite.3, flockfile.3, floor.3, fmod.3, fnmatch.3, fopencookie.3, fpathconf.3, fpurge.3, frexp.3, fseeko.3, ftok.3, futimes.3, gcvt.3, get_nprocs_conf.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getenv.3, getfsent.3, getgrent.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getlogin.3, getmntent.3, getnetent.3, getnetent_r.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwnam.3, getrpcent_r.3, gets.3, getservent.3, getservent_r.3, getumask.3, getusershell.3, getutmp.3, getw.3, glob.3, gnu_get_libc_version.3, gsignal.3, hypot.3, if_nameindex.3, if_nametoindex.3, ilogb.3, index.3, inet.3, inet_ntop.3, inet_pton.3, infnan.3, initgroups.3, insque.3, intro.3, isalpha.3, isatty.3, j0.3, ldexp.3, localeconv.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, mallinfo.3, malloc.3, malloc_get_state.3, malloc_info.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, mallopt.3, matherr.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, memset.3, mkdtemp.3, mkfifo.3, mkfifoat.3, mkstemp.3, mktemp.3, modf.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, on_exit.3, opendir.3, posix_fallocate.3, posix_memalign.3, posix_openpt.3, pow.3, pow10.3, profil.3, psignal.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, putenv.3, putpwent.3, puts.3, qecvt.3, qsort.3, raise.3, rand.3, random.3, random_r.3, re_comp.3, readdir.3, realpath.3, regex.3, remainder.3, remove.3, resolver.3, rewinddir.3, rint.3, round.3, scalb.3, scalbln.3, scandir.3, sched_getcpu.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setenv.3, setlocale.3, setlogmask.3, shm_open.3, siginterrupt.3, sigpause.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sinh.3, sleep.3, sockatmark.3, sqrt.3, statvfs.3, stdio_ext.3, stpcpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfry.3, strftime.3, string.3, strlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, trunc.3, tsearch.3, ttyslot.3, tzset.3, ulimit.3, undocumented.3, unlocked_stdio.3, usleep.3, y0.3, cpuid.4, full.4, initrd.4, mouse.4, msr.4, sd.4, st.4, acct.5, core.5, services.5, slabinfo.5, aio.7, capabilities.7, credentials.7, feature_test_macros.7, hier.7, inotify.7, libc.7, locale.7, man-pages.7, man.7, math_error.7, mq_overview.7, numa.7, path_resolution.7, pipe.7, pthreads.7, pty.7, rtld-audit.7, sem_overview.7, shm_overview.7, sigevent.7, signal.7, suffixes.7, svipc.7, termio.7, time.7, udplite.7, units.7, uri.7, sln.8: s/LICENSE_START(verbatim)/LICENSE_START(VERBATIM)/ Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-10 09:29:01 +00:00
.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
intro.1, _exit.2, access.2, alarm.2, alloc_hugepages.2, arch_prctl.2, bind.2, chdir.2, chmod.2, chown.2, chroot.2, clock_getres.2, clock_nanosleep.2, close.2, connect.2, delete_module.2, dup.2, execve.2, exit_group.2, faccessat.2, fchmodat.2, fchownat.2, fcntl.2, fork.2, fstatat.2, fsync.2, futimesat.2, get_robust_list.2, getdents.2, getdomainname.2, getgid.2, getgroups.2, gethostname.2, getpagesize.2, getpid.2, getresuid.2, getrlimit.2, getrusage.2, gettid.2, gettimeofday.2, getuid.2, getunwind.2, idle.2, init_module.2, intro.2, iopl.2, kcmp.2, kexec_load.2, kill.2, link.2, linkat.2, llseek.2, lookup_dcookie.2, madvise.2, mincore.2, mkdirat.2, mknodat.2, mmap.2, mmap2.2, mount.2, mprotect.2, mq_getsetattr.2, msgctl.2, msgget.2, msgop.2, msync.2, nice.2, open.2, openat.2, pause.2, perfmonctl.2, personality.2, pipe.2, poll.2, posix_fadvise.2, prctl.2, pread.2, process_vm_readv.2, quotactl.2, read.2, readahead.2, readdir.2, readlinkat.2, readv.2, reboot.2, recvmmsg.2, remap_file_pages.2, rename.2, renameat.2, rmdir.2, rt_sigqueueinfo.2, select.2, select_tut.2, semctl.2, semget.2, semop.2, sendmmsg.2, set_tid_address.2, seteuid.2, setfsgid.2, setfsuid.2, setgid.2, setresuid.2, setuid.2, setup.2, sgetmask.2, shmctl.2, shmget.2, shmop.2, sigaction.2, sigaltstack.2, signal.2, sigpending.2, sigprocmask.2, sigreturn.2, sigsuspend.2, sigwaitinfo.2, splice.2, stat.2, statfs.2, stime.2, subpage_prot.2, swapon.2, symlink.2, symlinkat.2, sync.2, sync_file_range.2, syscalls.2, sysctl.2, sysfs.2, syslog.2, tee.2, time.2, timer_create.2, timer_delete.2, timer_getoverrun.2, timer_settime.2, times.2, tkill.2, umask.2, umount.2, uname.2, unlink.2, unlinkat.2, uselib.2, ustat.2, utime.2, utimensat.2, vfork.2, vhangup.2, vm86.2, vmsplice.2, wait.2, wait4.2, write.2, CPU_SET.3, INFINITY.3, abort.3, abs.3, acos.3, acosh.3, adjtime.3, aio_init.3, asin.3, asinh.3, asprintf.3, assert.3, assert_perror.3, atan.3, atan2.3, atanh.3, atexit.3, atof.3, atoi.3, basename.3, bcmp.3, bcopy.3, bindresvport.3, bsd_signal.3, bsearch.3, bstring.3, byteorder.3, bzero.3, catgets.3, catopen.3, cbrt.3, ceil.3, clearenv.3, clock.3, clock_getcpuclockid.3, closedir.3, confstr.3, copysign.3, cos.3, cosh.3, ctermid.3, ctime.3, difftime.3, dirfd.3, div.3, dl_iterate_phdr.3, dprintf.3, drand48.3, drand48_r.3, dysize.3, ecvt.3, ecvt_r.3, end.3, endian.3, erf.3, erfc.3, ether_aton.3, euidaccess.3, exit.3, exp.3, exp10.3, exp2.3, expm1.3, fabs.3, fcloseall.3, fexecve.3, ffs.3, fgetgrent.3, fgetpwent.3, finite.3, flockfile.3, floor.3, fmod.3, fnmatch.3, fopencookie.3, fpathconf.3, fpurge.3, frexp.3, fseeko.3, ftok.3, futimes.3, gcvt.3, get_nprocs_conf.3, getaddrinfo.3, getaddrinfo_a.3, getauxval.3, getcontext.3, getcwd.3, getdate.3, getdirentries.3, getdtablesize.3, getenv.3, getfsent.3, getgrent.3, getgrnam.3, getgrouplist.3, gethostbyname.3, gethostid.3, getifaddrs.3, getipnodebyname.3, getline.3, getlogin.3, getmntent.3, getnetent.3, getnetent_r.3, getopt.3, getprotoent.3, getprotoent_r.3, getpw.3, getpwent.3, getpwnam.3, getrpcent_r.3, gets.3, getservent.3, getservent_r.3, getumask.3, getusershell.3, getutmp.3, getw.3, glob.3, gnu_get_libc_version.3, gsignal.3, hypot.3, if_nameindex.3, if_nametoindex.3, ilogb.3, index.3, inet.3, inet_ntop.3, inet_pton.3, infnan.3, initgroups.3, insque.3, intro.3, isalpha.3, isatty.3, j0.3, ldexp.3, localeconv.3, log.3, log10.3, log1p.3, log2.3, logb.3, lrint.3, lround.3, lsearch.3, lseek64.3, makecontext.3, makedev.3, mallinfo.3, malloc.3, malloc_get_state.3, malloc_info.3, malloc_stats.3, malloc_trim.3, malloc_usable_size.3, mallopt.3, matherr.3, mcheck.3, memccpy.3, memchr.3, memcmp.3, memcpy.3, memfrob.3, memmem.3, memmove.3, memset.3, mkdtemp.3, mkfifo.3, mkfifoat.3, mkstemp.3, mktemp.3, modf.3, mq_close.3, mq_getattr.3, mq_notify.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, mtrace.3, on_exit.3, opendir.3, posix_fallocate.3, posix_memalign.3, posix_openpt.3, pow.3, pow10.3, profil.3, psignal.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_cleanup_push_defer_np.3, pthread_create.3, pthread_detach.3, pthread_equal.3, pthread_exit.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_join.3, pthread_kill.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setname_np.3, pthread_setschedparam.3, pthread_setschedprio.3, pthread_sigmask.3, pthread_sigqueue.3, pthread_testcancel.3, pthread_tryjoin_np.3, pthread_yield.3, putenv.3, putpwent.3, puts.3, qecvt.3, qsort.3, raise.3, rand.3, random.3, random_r.3, re_comp.3, readdir.3, realpath.3, regex.3, remainder.3, remove.3, resolver.3, rewinddir.3, rint.3, round.3, scalb.3, scalbln.3, scandir.3, sched_getcpu.3, seekdir.3, sem_close.3, sem_destroy.3, sem_getvalue.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sem_wait.3, setenv.3, setlocale.3, setlogmask.3, shm_open.3, siginterrupt.3, sigpause.3, sigqueue.3, sigset.3, sigsetops.3, sigvec.3, sigwait.3, sin.3, sinh.3, sleep.3, sockatmark.3, sqrt.3, statvfs.3, stdio_ext.3, stpcpy.3, strcasecmp.3, strcat.3, strchr.3, strcmp.3, strcoll.3, strcpy.3, strdup.3, strerror.3, strfry.3, strftime.3, string.3, strlen.3, strpbrk.3, strptime.3, strsep.3, strsignal.3, strspn.3, strstr.3, strtok.3, strtol.3, strtoul.3, strverscmp.3, strxfrm.3, swab.3, sysconf.3, syslog.3, system.3, sysv_signal.3, tan.3, tanh.3, tcgetpgrp.3, tcgetsid.3, telldir.3, tempnam.3, timegm.3, timeradd.3, tmpfile.3, tmpnam.3, toascii.3, toupper.3, trunc.3, tsearch.3, ttyslot.3, tzset.3, ulimit.3, undocumented.3, unlocked_stdio.3, usleep.3, y0.3, cpuid.4, full.4, initrd.4, mouse.4, msr.4, sd.4, st.4, acct.5, core.5, services.5, slabinfo.5, aio.7, capabilities.7, credentials.7, feature_test_macros.7, hier.7, inotify.7, libc.7, locale.7, man-pages.7, man.7, math_error.7, mq_overview.7, numa.7, path_resolution.7, pipe.7, pthreads.7, pty.7, rtld-audit.7, sem_overview.7, shm_overview.7, sigevent.7, signal.7, suffixes.7, svipc.7, termio.7, time.7, udplite.7, units.7, uri.7, sln.8: Global fix: Add LICENSE_START(verbatim) Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-10 09:28:40 +00:00
.\" %%%LICENSE_END
2007-06-21 22:55:04 +00:00
.\"
.\" 2007-05-30 created by mtk, using text from old man.7 plus
2007-05-23 06:16:43 +00:00
.\" rewrites and additional text.
.\"
.TH MAN-PAGES 7 2013-07-24 "Linux" "Linux Programmer's Manual"
.SH NAME
man-pages \- conventions for writing Linux man pages
.SH SYNOPSIS
.B man
.RI [ section ]
.I title
.SH DESCRIPTION
This page describes the conventions that should be employed
when writing man pages for the Linux \fIman-pages\fP project,
which documents the user-space API provided by the Linux kernel
and the GNU C library.
The project thus provides most of the pages in Section 2,
as well as many of the pages that appear
in Sections 3, 4, 5, and 7 of the man pages on a Linux system.
The conventions described on this page may also be useful
for authors writing man pages for other projects.
intro.1, time.1, _syscall.2, accept.2, brk.2, capget.2, faccessat.2, futimesat.2, gethostname.2, intro.2, ioprio_set.2, kill.2, madvise.2, mlock.2, mount.2, msgget.2, perf_event_open.2, poll.2, readv.2, sched_rr_get_interval.2, sched_setscheduler.2, select.2, select_tut.2, shmget.2, stat.2, timer_create.2, ustat.2, vfork.2, wait.2, alloca.3, atexit.3, catopen.3, crypt.3, dbopen.3, fenv.3, fopen.3, getaddrinfo_a.3, gethostbyname.3, getutent.3, intro.3, login.3, mallopt.3, queue.3, regex.3, sigpause.3, sigsetops.3, stdio.3, strftime.3, strptime.3, sysconf.3, ttyslot.3, undocumented.3, cciss.4, console_codes.4, hpsa.4, initrd.4, intro.4, rtc.4, st.4, tty_ioctl.4, wavelan.4, acct.5, charmap.5, dir_colors.5, hosts.5, intro.5, termcap.5, utmp.5, intro.6, armscii-8.7, boot.7, bootparam.7, capabilities.7, cpuset.7, credentials.7, ddp.7, epoll.7, glob.7, intro.7, ip.7, ipv6.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, koi8-r.7, koi8-u.7, man-pages.7, man.7, math_error.7, netlink.7, numa.7, packet.7, path_resolution.7, pipe.7, pthreads.7, raw.7, rtnetlink.7, signal.7, socket.7, spufs.7, svipc.7, tcp.7, time.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, utf-8.7, x25.7, intro.8: Global fix: use consistent capitalization in .SS headings Capitalization in .SS sections across pages (and sometimes even within a single page) is wildly inconsistent. Make it consistent. Capitalize first word in heading, but otherwise use lower case, except where English usage (e.g., proper nouns) or programming language requirements (e.g., identifier names) dictate otherwise. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-02-24 14:08:38 +00:00
.SS Sections of the manual pages
.PP
The manual Sections are traditionally defined as follows:
.TP 10
.B 1 Commands (Programs)
Those commands that can be executed by the user from within
a shell.
.TP
.B 2 System calls
Those functions which must be performed by the kernel.
.TP
.B 3 Library calls
Most of the
.I libc
functions.
.TP
.B 4 Special files (devices)
Files found in
.IR /dev .
.TP
.B 5 File formats and conventions
The format for
.I /etc/passwd
and other human-readable files.
.TP
.B 6 Games
.TP
.B 7 Overview, conventions, and miscellaneous
Overviews of various topics, conventions and protocols,
character set standards, and miscellaneous other things.
.TP
.B 8 System management commands
Commands like
.BR mount (8),
many of which only root can execute.
.\" .TP
.\" .B 9 Kernel routines
.\" This is an obsolete manual section.
.\" Once it was thought a good idea to document the Linux kernel here,
.\" but in fact very little has been documented, and the documentation
.\" that exists is outdated already.
.\" There are better sources of
.\" information for kernel developers.
.SS Macro package
New manual pages should be marked up using the
2007-08-27 09:56:58 +00:00
.B groff an.tmac
package described in
.BR man (7).
2007-06-21 22:55:04 +00:00
This choice is mainly for consistency: the vast majority of
existing Linux manual pages are marked up using these macros.
.SS Conventions for source file layout
2007-06-21 22:55:04 +00:00
Please limit source code line length to no more than about 75 characters
wherever possible.
This helps avoid line-wrapping in some mail clients when patches are
submitted inline.
New sentences should be started on new lines.
This makes it easier to see the effect of patches,
which often operate at the level of individual sentences.
.SS Title line
The first command in a man page should be a
.B TH
command:
.RS
.sp
.B \&.TH
2007-09-20 16:26:31 +00:00
.I "title section date source manual"
.sp
.RE
where:
.RS
.TP 10
.I title
The title of the man page, written in all caps (e.g.,
.IR MAN-PAGES ).
.TP
.I section
The section number in which the man page should be placed (e.g.,
.IR 7 ).
.TP
.I date
The date of the last revision\(emremember to change this every time a
2007-05-23 06:16:43 +00:00
change is made to the man page,
since this is the most general way of doing version control.
Dates should be written in the form YYYY-MM-DD.
.TP
.I source
The source of the command, function, or system call.
2008-01-01 14:13:55 +00:00
For those few \fIman-pages\fP pages in Sections 1 and 8,
probably you just want to write
.IR GNU .
2008-01-01 14:13:55 +00:00
For system calls, just write
.IR "Linux" .
(An earlier practice was to write the version number
of the kernel from which the manual page was being written/checked.
However, this was never done consistently, and so was
probably worse than including no version number.
Henceforth, avoid including a version number.)
2008-01-01 14:13:55 +00:00
2007-06-21 22:55:04 +00:00
For library calls that are part of glibc or one of the
other common GNU libraries, just use
.IR "GNU C Library" ", " GNU ,
or an empty string.
2008-01-01 14:13:55 +00:00
For Section 4 pages, use
.IR "Linux" .
2008-01-01 14:13:55 +00:00
In cases of doubt, just write
.IR Linux ", or " GNU .
.TP
.I manual
2007-06-21 22:55:04 +00:00
The title of the manual (e.g., for Section 2 and 3 pages in
the \fIman-pages\fP package, use
.IR "Linux Programmer's Manual" ).
.RE
.SS Sections within a manual page
The list below shows conventional or suggested sections.
2007-06-21 22:55:04 +00:00
Most manual pages should include at least the
.B highlighted
sections.
2007-05-23 06:16:43 +00:00
Arrange a new manual page so that sections
are placed in the order shown in the list.
.in +0.5i
.nf
\fBNAME\fP
\fBSYNOPSIS\fP
CONFIGURATION [Normally only in Section 4]
\fBDESCRIPTION\fP
OPTIONS [Normally only in Sections 1, 8]
EXIT STATUS [Normally only in Sections 1, 8]
RETURN VALUE [Normally only in Sections 2, 3]
.\" May 07: Few current man pages have an ERROR HANDLING section,,,
.\" ERROR HANDLING,
ERRORS [Typically only in Sections 2, 3]
.\" May 07: Almost no current man pages have a USAGE section,,,
2007-06-21 22:55:04 +00:00
.\" USAGE,
2007-07-16 18:45:21 +00:00
.\" DIAGNOSTICS,
.\" May 07: Almost no current man pages have a SECURITY section,,,
.\" SECURITY,
ENVIRONMENT
FILES
man-pages.7: Add description of "ATTRIBUTES" "ATTRIBUTES" section can mention thread safety, cancellation safety, and async-cancel-safety. For future reference, this is Peng's 2010-11-14 list of functions that need work (from the linux-man mail thread "About thread-safety information in library functions' man-pages"): Safe functions' list: closelog dladdr endutent endutxent _flushlbf gai_cancel initstate lckpwdf openlog putchar rand random setstate srand srandom ulckpwdf unsetenv Safe with exceptions functions' list: dl_iterate_phdr getutent_r getutid_r getutline_r pututline pututxline setutent setutxent Unsafe functions' list: abort bindresvport bsd_signal clearerr_unlocked drand48 ecvt erand48 ether_aton fcloseall feof_unlocked ferror_unlocked fflush_unlocked fputc_unlocked fread_unlocked __fsetlocking hsearch jrand48 l64a lcong48 localeconv longjmp lrand48 mrand48 nrand48 profil pthread_exit pthread_setcancelstate pthread_setcanceltype pthread_testcancel ptsname putchar_unlocked putc_unlocked seed48 setjmp siginterrupt siglongjmp srand48 ssignal strfry strtok MT-Safe functions' list: a64l abs adjtime aio_error aio_return alloca argz_count argz_extract argz_next argz_stringify asinh asinhf asinhl atan atanf atanl backtrace_symbols_fd basename bcmp bcopy bzero catgets cbc_crypt cbrt cbrtf cbrtl ceil ceilf ceill cexp cexpf cexpl cfgetispeed cfgetospeed cfmakeraw cfsetispeed cfsetospeed cfsetspeed cimag cimagf cimagl clearerr clnt_control clnt_geterr clock_getcpuclockid clock_getres clock_gettime clock_settime conj conjf conjl copysign copysignf copysignl cos cosf cosl cproj cprojf cprojl creal crealf creall daemon des_setparity difftime dirfd dirname div dn_comp drand48_r dysize eaccess ecb_crypt ecvt_r envz_entry envz_get envz_strip erand48_r erf erfc erfcf erfcl erff erfl ether_aton_r ether_line euidaccess eventfd_read eventfd_write execv expm1 expm1f expm1l fabs fabsf fabsl __fbufsize FD_CLR fdim fdimf fdiml FD_ISSET feclearexcept fedisableexcept feenableexcept fegetenv fegetexcept fegetexceptflag fegetround feholdexcept feof feraiseexcept ferror fesetenv fesetexceptflag fesetround fetestexcept feupdateenv fflush ffs ffsl ffsll fileno fileno_unlocked finite finitef finitel __flbf flockfile floor floorf floorl fma fmaf fmal fmax fmaxf fmaxl fmin fminf fminl fpathconf fpclassify __fpending fputc fread __freadable __freading frexp frexpf frexpl fstatvfs ftime ftok ftrylockfile fts_set funlockfile futimens futimes __fwritable __fwriting gai_error getdirentries getloadavg getpt getsubopt getutmp getutmpx getw gnu_dev_major gnu_dev_makedev gnu_dev_minor gnu_get_libc_release gnu_get_libc_version gsignal hasmntopt hsearch_r htonl htons iconv ilogb ilogbf ilogbl imaxabs imaxdiv index inet_lnaof inet_makeaddr inet_netof inet_network inet_pton initstate_r insque isascii isatty isfinite isgreater isgreaterequal isinf isinff isinfl isless islessequal islessgreater isnan isnanf isnanl isnormal isunordered iswctype jrand48_r klogctl labs lcong48_r ldexp ldexpf ldexpl ldiv llabs lldiv llrint llrintf llrintl llround llroundf llroundl lockf log1p log1pf log1pl logb logbf logbl login_tty logwtmp lrand48_r lrint lrintf lrintl lround lroundf lroundl lseek64 lutimes makecontext matherr mbsinit memccpy memchr memcmp memcpy memfrob memmem memmove mempcpy memrchr memset mkdtemp mkfifo mkfifoat mkostemp mkostemps mkstemp mkstemps mktemp mmap64 modf modff modfl mq_close mq_getattr mq_open mq_receive mq_send mq_setattr mq_timedreceive mq_timedsend mq_unlink mrand48_r nearbyint nearbyintf nearbyintl nextafter nextafterf nextafterl nexttoward nexttowardf nexttowardl nrand48_r ntohl ntohs passwd2des pathconf posix_fallocate posix_openpt pthread_attr_getdetachstate pthread_attr_getguardsize pthread_attr_getinheritsched pthread_attr_getschedparam pthread_attr_getschedpolicy pthread_attr_getscope pthread_attr_getstack pthread_attr_getstackaddr pthread_attr_getstacksize pthread_attr_init pthread_attr_setdetachstate pthread_attr_setguardsize pthread_attr_setinheritsched pthread_attr_setschedparam pthread_attr_setschedpolicy pthread_attr_setscope pthread_attr_setstack pthread_attr_setstackaddr pthread_attr_setstacksize pthread_cleanup_push pthread_equal pthread_getaffinity_np pthread_getconcurrency pthread_getcpuclockid pthread_getschedparam pthread_kill pthread_kill_other_threads_np pthread_self pthread_setconcurrency pthread_setschedparam pthread_setschedprio pthread_sigmask pthread_yield ptsname_r putc raise random_r rand_r rawmemchr readdir readdir_r remove remque remquo remquof remquol rewinddir rindex rint rintf rintl round roundf roundl rresvport rtime scalbln scalblnf scalblnl scalbn scalbnf scalbnl sched_getcpu seed48_r seekdir sem_destroy sem_getvalue sem_init sem_post sem_timedwait sem_trywait sem_unlink sem_wait setbuf setbuffer sethostid setlinebuf setlogmask setstate_r setvbuf sigaddset sigandset sigblock sigdelset sigemptyset sigfillset siggetmask sighold sigignore sigisemptyset sigismember signbit significand significandf significandl sigorset sigpause sigrelse sigset sigsetmask sigstack sigvec sigwait sin sincos sincosf sincosl sinf sinl sleep sockatmark srand48_r srandom_r statvfs stpcpy stpncpy strcat strchr strchrnul strcmp strcpy strcspn strdupa strlen strncat strncmp strncpy strndupa strnlen strpbrk strrchr strsep strspn strstr strtok_r strverscmp swab swapcontext system sysv_signal tan tanf tanh tanhf tanhl tanl tcdrain tcflow tcflush tcgetattr tcgetpgrp tcgetsid tcsendbreak tcsetattr tcsetpgrp telldir toascii towctrans trunc truncf truncl ualarm ungetc ungetwc unlockpt updwtmp updwtmpx usleep va_arg va_copy va_end va_start versionsort vlimit vtimes wcpcpy wcpncpy wcscat wcschr wcscmp wcscpy wcscspn wcslen wcsncat wcsncmp wcsncpy wcsnlen wcspbrk wcsrchr wcsspn wcsstr wcstok wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset xdrmem_create xdrstdio_create xdr_void MT-Safe with exceptions functions' list: atof atoi atol atoll bsearch clnt_call clnt_destroy clnt_freeres ctermid inet_addr inet_aton isalnum isalpha isblank iscntrl isdigit isgraph islower isprint ispunct isspace isupper iswalnum iswalpha iswblank iswcntrl iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper iswxdigit isxdigit lfind lsearch mbstowcs nl_langinfo pthread_cleanup_pop sgetspent_r strcasecmp strcasestr strncasecmp strtod strtof strtoimax strtol strtold strtoll strtoq strtoul strtoull strtoumax strtouq svcerr_auth svcerr_decode svcerr_noproc svcerr_noprog svcerr_progvers svcerr_systemerr svcerr_weakauth svc_sendreply tdestroy tfind tolower toupper towlower towupper twalk wcscasecmp wcsncasecmp wcstoimax wcstoumax wcswidth wctrans wctype wcwidth xdr_bool xdr_callhdr xdr_char xdr_double xdr_enum xdr_float xdr_free xdr_int xdr_long xdr_opaque xdr_pmap xdrrec_endofrecord xdrrec_eof xdrrec_skiprecord xdr_rejected_reply xdr_replymsg xdr_short xdr_u_char xdr_u_int xdr_u_long xdr_union xdr_u_short xdr_vector Signed-off-by: Peng Haitao <penght@cn.fujitsu.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-12 10:41:35 +00:00
ATTRIBUTES [Normally only in Sections 2, 3]
VERSIONS [Normally only in Sections 2, 3]
CONFORMING TO
NOTES
BUGS
EXAMPLE
.\" AUTHORS sections are discouraged
.\" AUTHORS [Discouraged]
\fBSEE ALSO\fP
.fi
.in
.IR "Where a traditional heading would apply" ", " "please use it" ;
this kind of consistency can make the information easier to understand.
2007-06-21 22:55:04 +00:00
If you must, you can create your own
headings if they make things easier to understand (this can
be especially useful for pages in Sections 4 and 5).
However, before doing this, consider whether you could use the
traditional headings, with some subsections (\fI.SS\fP) within
those sections.
2007-06-21 22:55:04 +00:00
The following list elaborates on the contents of each of
the above sections.
.TP 14
.B NAME
The name of this manual page.
2007-06-21 22:55:04 +00:00
See
.BR man (7)
for important details of the line(s) that should follow the
2007-07-16 18:45:21 +00:00
\fB.SH NAME\fP command.
All words in this line (including the word immediately
following the "\\\-") should be in lowercase,
except where English or technical terminological convention
dictates otherwise.
.TP
.B SYNOPSIS
briefly describes the command or function's interface.
For commands, this shows the syntax of the command and its arguments
(including options);
2007-05-23 06:16:43 +00:00
boldface is used for as-is text and italics are used to
indicate replaceable arguments.
Brackets ([]) surround optional arguments, vertical bars (|)
separate choices, and ellipses (\&...) can be repeated.
For functions, it shows any required data declarations or
.B #include
directives, followed by the function declaration.
Where a feature test macro must be defined in order to obtain
the declaration of a function (or a variable) from a header file,
then the SYNOPSIS should indicate this, as described in
.BR feature_test_macros (7).
2007-07-03 06:52:50 +00:00
.\" FIXME . Say something here about compiler options
.TP
.B CONFIGURATION
Configuration details for a device.
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only" Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
This section normally appears only in Section 4 pages.
.TP
.B DESCRIPTION
gives an explanation of what the program, function, or format does.
Discuss how it interacts with files and standard input, and what it
produces on standard output or standard error.
Omit internals and implementation details unless they're critical for
understanding the interface.
Describe the usual case;
for information on command-line options of a program use the
.B OPTIONS
section.
.\" If there is some kind of input grammar or complex set of subcommands,
.\" consider describing them in a separate
.\" .B USAGE
.\" section (and just place an overview in the
.\" .B DESCRIPTION
.\" section).
When describing new behavior or new flags for
a system call or library function,
be careful to note the kernel or C library version
that introduced the change.
The preferred method of noting this information for flags is as part of a
.B .TP
list, in the following form (here, for a new system call flag):
.RS 22
.TP
.BR XYZ_FLAG " (since Linux 3.7)"
Description of flag...
.RE
.IP
Including version information is especially useful to users
who are constrained to using older kernel or C library versions
(which is typical in embedded systems, for example).
.TP
.B OPTIONS
2007-06-21 22:55:04 +00:00
describes the command-line options accepted by a
program and how they change its behavior.
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only" Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
This section should appear only for Section 1 and 8 manual pages.
.\" .TP
.\" .B USAGE
.\" describes the grammar of any sublanguage this implements.
.TP
.B EXIT STATUS
lists the possible exit status values of a program and
the conditions that cause these values to be returned.
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only" Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
This section should appear only for Section 1 and 8 manual pages.
.TP
.B RETURN VALUE
For Section 2 and 3 pages, this section gives a
list of the values the library routine will return to the caller
and the conditions that cause these values to be returned.
.TP
.B ERRORS
For Section 2 and 3 manual pages, this is a list of the
values that may be placed in
.I errno
in the event of an error, along with information about the cause
of the errors.
.IR "The error list should be in alphabetical order" .
.TP
.B ENVIRONMENT
lists all environment variables that affect the program or function
and how they affect it.
.TP
.B FILES
lists the files the program or function uses, such as
configuration files, startup files,
and files the program directly operates on.
Give the full pathname of these files, and use the installation
process to modify the directory part to match user preferences.
For many programs, the default installation location is in
.IR /usr/local ,
so your base manual page should use
.I /usr/local
as the base.
.\" May 07: Almost no current man pages have a DIAGNOSTICS section;
.\" "RETURN VALUE" or "EXIT STATUS" is preferred.
.\" .TP
.\" .B DIAGNOSTICS
.\" gives an overview of the most common error messages and how to
.\" cope with them.
.\" You don't need to explain system error messages
.\" or fatal signals that can appear during execution of any program
.\" unless they're special in some way to the program.
.\"
.\" May 07: Almost no current man pages have a SECURITY section.
.\".TP
.\".B SECURITY
.\"discusses security issues and implications.
.\"Warn about configurations or environments that should be avoided,
.\"commands that may have security implications, and so on, especially
.\"if they aren't obvious.
.\"Discussing security in a separate section isn't necessary;
.\"if it's easier to understand, place security information in the
.\"other sections (such as the
.\" .B DESCRIPTION
.\" or
.\" .B USAGE
.\" section).
.\" However, please include security information somewhere!
.TP
man-pages.7: Add description of "ATTRIBUTES" "ATTRIBUTES" section can mention thread safety, cancellation safety, and async-cancel-safety. For future reference, this is Peng's 2010-11-14 list of functions that need work (from the linux-man mail thread "About thread-safety information in library functions' man-pages"): Safe functions' list: closelog dladdr endutent endutxent _flushlbf gai_cancel initstate lckpwdf openlog putchar rand random setstate srand srandom ulckpwdf unsetenv Safe with exceptions functions' list: dl_iterate_phdr getutent_r getutid_r getutline_r pututline pututxline setutent setutxent Unsafe functions' list: abort bindresvport bsd_signal clearerr_unlocked drand48 ecvt erand48 ether_aton fcloseall feof_unlocked ferror_unlocked fflush_unlocked fputc_unlocked fread_unlocked __fsetlocking hsearch jrand48 l64a lcong48 localeconv longjmp lrand48 mrand48 nrand48 profil pthread_exit pthread_setcancelstate pthread_setcanceltype pthread_testcancel ptsname putchar_unlocked putc_unlocked seed48 setjmp siginterrupt siglongjmp srand48 ssignal strfry strtok MT-Safe functions' list: a64l abs adjtime aio_error aio_return alloca argz_count argz_extract argz_next argz_stringify asinh asinhf asinhl atan atanf atanl backtrace_symbols_fd basename bcmp bcopy bzero catgets cbc_crypt cbrt cbrtf cbrtl ceil ceilf ceill cexp cexpf cexpl cfgetispeed cfgetospeed cfmakeraw cfsetispeed cfsetospeed cfsetspeed cimag cimagf cimagl clearerr clnt_control clnt_geterr clock_getcpuclockid clock_getres clock_gettime clock_settime conj conjf conjl copysign copysignf copysignl cos cosf cosl cproj cprojf cprojl creal crealf creall daemon des_setparity difftime dirfd dirname div dn_comp drand48_r dysize eaccess ecb_crypt ecvt_r envz_entry envz_get envz_strip erand48_r erf erfc erfcf erfcl erff erfl ether_aton_r ether_line euidaccess eventfd_read eventfd_write execv expm1 expm1f expm1l fabs fabsf fabsl __fbufsize FD_CLR fdim fdimf fdiml FD_ISSET feclearexcept fedisableexcept feenableexcept fegetenv fegetexcept fegetexceptflag fegetround feholdexcept feof feraiseexcept ferror fesetenv fesetexceptflag fesetround fetestexcept feupdateenv fflush ffs ffsl ffsll fileno fileno_unlocked finite finitef finitel __flbf flockfile floor floorf floorl fma fmaf fmal fmax fmaxf fmaxl fmin fminf fminl fpathconf fpclassify __fpending fputc fread __freadable __freading frexp frexpf frexpl fstatvfs ftime ftok ftrylockfile fts_set funlockfile futimens futimes __fwritable __fwriting gai_error getdirentries getloadavg getpt getsubopt getutmp getutmpx getw gnu_dev_major gnu_dev_makedev gnu_dev_minor gnu_get_libc_release gnu_get_libc_version gsignal hasmntopt hsearch_r htonl htons iconv ilogb ilogbf ilogbl imaxabs imaxdiv index inet_lnaof inet_makeaddr inet_netof inet_network inet_pton initstate_r insque isascii isatty isfinite isgreater isgreaterequal isinf isinff isinfl isless islessequal islessgreater isnan isnanf isnanl isnormal isunordered iswctype jrand48_r klogctl labs lcong48_r ldexp ldexpf ldexpl ldiv llabs lldiv llrint llrintf llrintl llround llroundf llroundl lockf log1p log1pf log1pl logb logbf logbl login_tty logwtmp lrand48_r lrint lrintf lrintl lround lroundf lroundl lseek64 lutimes makecontext matherr mbsinit memccpy memchr memcmp memcpy memfrob memmem memmove mempcpy memrchr memset mkdtemp mkfifo mkfifoat mkostemp mkostemps mkstemp mkstemps mktemp mmap64 modf modff modfl mq_close mq_getattr mq_open mq_receive mq_send mq_setattr mq_timedreceive mq_timedsend mq_unlink mrand48_r nearbyint nearbyintf nearbyintl nextafter nextafterf nextafterl nexttoward nexttowardf nexttowardl nrand48_r ntohl ntohs passwd2des pathconf posix_fallocate posix_openpt pthread_attr_getdetachstate pthread_attr_getguardsize pthread_attr_getinheritsched pthread_attr_getschedparam pthread_attr_getschedpolicy pthread_attr_getscope pthread_attr_getstack pthread_attr_getstackaddr pthread_attr_getstacksize pthread_attr_init pthread_attr_setdetachstate pthread_attr_setguardsize pthread_attr_setinheritsched pthread_attr_setschedparam pthread_attr_setschedpolicy pthread_attr_setscope pthread_attr_setstack pthread_attr_setstackaddr pthread_attr_setstacksize pthread_cleanup_push pthread_equal pthread_getaffinity_np pthread_getconcurrency pthread_getcpuclockid pthread_getschedparam pthread_kill pthread_kill_other_threads_np pthread_self pthread_setconcurrency pthread_setschedparam pthread_setschedprio pthread_sigmask pthread_yield ptsname_r putc raise random_r rand_r rawmemchr readdir readdir_r remove remque remquo remquof remquol rewinddir rindex rint rintf rintl round roundf roundl rresvport rtime scalbln scalblnf scalblnl scalbn scalbnf scalbnl sched_getcpu seed48_r seekdir sem_destroy sem_getvalue sem_init sem_post sem_timedwait sem_trywait sem_unlink sem_wait setbuf setbuffer sethostid setlinebuf setlogmask setstate_r setvbuf sigaddset sigandset sigblock sigdelset sigemptyset sigfillset siggetmask sighold sigignore sigisemptyset sigismember signbit significand significandf significandl sigorset sigpause sigrelse sigset sigsetmask sigstack sigvec sigwait sin sincos sincosf sincosl sinf sinl sleep sockatmark srand48_r srandom_r statvfs stpcpy stpncpy strcat strchr strchrnul strcmp strcpy strcspn strdupa strlen strncat strncmp strncpy strndupa strnlen strpbrk strrchr strsep strspn strstr strtok_r strverscmp swab swapcontext system sysv_signal tan tanf tanh tanhf tanhl tanl tcdrain tcflow tcflush tcgetattr tcgetpgrp tcgetsid tcsendbreak tcsetattr tcsetpgrp telldir toascii towctrans trunc truncf truncl ualarm ungetc ungetwc unlockpt updwtmp updwtmpx usleep va_arg va_copy va_end va_start versionsort vlimit vtimes wcpcpy wcpncpy wcscat wcschr wcscmp wcscpy wcscspn wcslen wcsncat wcsncmp wcsncpy wcsnlen wcspbrk wcsrchr wcsspn wcsstr wcstok wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset xdrmem_create xdrstdio_create xdr_void MT-Safe with exceptions functions' list: atof atoi atol atoll bsearch clnt_call clnt_destroy clnt_freeres ctermid inet_addr inet_aton isalnum isalpha isblank iscntrl isdigit isgraph islower isprint ispunct isspace isupper iswalnum iswalpha iswblank iswcntrl iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper iswxdigit isxdigit lfind lsearch mbstowcs nl_langinfo pthread_cleanup_pop sgetspent_r strcasecmp strcasestr strncasecmp strtod strtof strtoimax strtol strtold strtoll strtoq strtoul strtoull strtoumax strtouq svcerr_auth svcerr_decode svcerr_noproc svcerr_noprog svcerr_progvers svcerr_systemerr svcerr_weakauth svc_sendreply tdestroy tfind tolower toupper towlower towupper twalk wcscasecmp wcsncasecmp wcstoimax wcstoumax wcswidth wctrans wctype wcwidth xdr_bool xdr_callhdr xdr_char xdr_double xdr_enum xdr_float xdr_free xdr_int xdr_long xdr_opaque xdr_pmap xdrrec_endofrecord xdrrec_eof xdrrec_skiprecord xdr_rejected_reply xdr_replymsg xdr_short xdr_u_char xdr_u_int xdr_u_long xdr_union xdr_u_short xdr_vector Signed-off-by: Peng Haitao <penght@cn.fujitsu.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-12 10:41:35 +00:00
.B ATTRIBUTES
A summary of various attributes of the function(s) documented on this page,
broken into subsections.
The following subsections are defined:
.sp
.RS
.TP
.B "Multithreading (see pthreads(7))"
This subsection notes attributes relating to multithreaded applications:
.RS
.IP * 3
Whether the function is thread-safe.
.IP *
Whether the function is a cancellation point.
.IP *
Whether the function is async-cancel-safe.
.RE
.IP
Details of these attributes can be found in
.BR pthreads (7).
.RE
.TP
.B VERSIONS
A brief summary of the Linux kernel or glibc versions where a
system call or library function appeared,
or changed significantly in its operation.
As a general rule, every new interface should
include a VERSIONS section in its manual page.
Unfortunately,
many existing manual pages don't include this information
(since there was no policy to do so when they were written).
Patches to remedy this are welcome,
but, from the perspective of programmers writing new code,
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only" Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
this information probably matters only in the case of kernel
interfaces that have been added in Linux 2.4 or later
(i.e., changes since kernel 2.2),
and library functions that have been added to glibc since version 2.1
(i.e., changes since glibc 2.0).
The
.BR syscalls (2)
2008-06-16 10:08:53 +00:00
manual page also provides information about kernel versions
in which various system calls first appeared.
.TP
.B CONFORMING TO
2007-05-23 06:16:43 +00:00
describes any standards or conventions that relate to the function
or command described by the manual page.
For a page in Section 2 or 3,
this section should note the POSIX.1
version(s) that the call conforms to,
and also whether the call is specified in C99.
(Don't worry too much about other standards like SUS, SUSv2, and XPG,
or the SVr4 and 4.xBSD implementation standards,
unless the call was specified in those standards,
but isn't in the current version of POSIX.1.)
(See
.BR standards (7).)
2007-06-21 22:55:04 +00:00
If the call is not governed by any standards but commonly
exists on other systems, note them.
2007-12-25 21:28:09 +00:00
If the call is Linux-specific, note this.
If this section consists of just a list of standards
(which it commonly does),
terminate the list with a period (\(aq.\(aq).
.TP
.B NOTES
provides miscellaneous notes.
2007-05-23 21:35:13 +00:00
For Section 2 and 3 man pages you may find it useful to include
subsections (\fBSS\fP) named \fILinux Notes\fP and \fIGlibc Notes\fP.
.TP
.B BUGS
lists limitations, known defects or inconveniences,
and other questionable activities.
.TP
.B EXAMPLE
provides one or more examples describing how this function, file or
command is used.
2007-05-23 06:16:43 +00:00
For details on writing example programs,
see \fIExample Programs\fP below.
.TP
.B AUTHORS
2007-05-23 21:35:13 +00:00
lists authors of the documentation or program.
\fBUse of an AUTHORS section is strongly discouraged\fP.
Generally, it is better not to clutter every page with a list
of (over time potentially numerous) authors;
if you write or significantly amend a page,
add a copyright notice as a comment in the source file.
2007-06-25 08:28:31 +00:00
If you are the author of a device driver and want to include
2007-05-23 21:35:13 +00:00
an address for reporting bugs, place this under the BUGS section.
.TP
.B SEE ALSO
2008-10-28 14:55:32 +00:00
provides a comma-separated list of related man pages,
ordered by section number and
2007-07-08 11:01:55 +00:00
then alphabetically by name, possibly followed by
other related pages or documents.
Do not terminate this with a period.
.IP
Where the SEE ALSO list contains many long manual page names,
to improve the visual result of the output, it may be useful to employ the
.I .ad l
(don't right justify)
and
.I .nh
(don't hyphenate)
directives.
Hyphenation of individual page names can be prevented
by preceding words with the string "\\%".
.SS Font conventions
.PP
For functions, the arguments are always specified using italics,
.IR "even in the SYNOPSIS section" ,
where the rest of the function is specified in bold:
.PP
.BI " int myfunction(int " argc ", char **" argv );
.PP
Variable names should, like argument names, be specified in italics.
.PP
Filenames (whether pathnames, or references to files in the
.I /usr/include
directory)
are always in italics (e.g.,
.IR <stdio.h> ),
except in the SYNOPSIS section, where included files are in bold (e.g.,
.BR "#include <stdio.h>" ).
When referring to a standard include file under
.IR /usr/include ,
specify the header file surrounded by angle brackets,
in the usual C way (e.g.,
2008-01-01 07:52:59 +00:00
.IR <stdio.h> ).
.PP
Special macros, which are usually in upper case, are in bold (e.g.,
.BR MAXINT ).
Exception: don't boldface NULL.
.PP
When enumerating a list of error codes, the codes are in bold (this list
usually uses the
.B \&.TP
macro).
.PP
Complete commands should, if long,
be written as an indented line on their own, for example
.in +4n
.nf
man 7 man-pages
.fi
.in
2009-02-20 10:56:07 +00:00
If the command is short, then it can be included inline in the text,
in italic format, for example,
.IR "man 7 man-pages" .
In this case, it may be worth using nonbreaking spaces
("\e\ ") at suitable places in the command.
Command options should be written in italics (e.g.,
.IR \-l ).
.PP
Expressions, if not written on a separate indented line, should
be specified in italics.
Again, the use of nonbreaking spaces may be appropriate
if the expression is inlined with normal text.
.PP
Any reference to the subject of the current manual page
2007-05-23 21:35:13 +00:00
should be written with the name in bold.
If the subject is a function (i.e., this is a Section 2 or 3 page),
2007-06-21 22:55:04 +00:00
then the name should be followed by a pair of parentheses
2007-05-23 21:35:13 +00:00
in Roman (normal) font.
For example, in the
.BR fcntl (2)
man page, references to the subject of the page would be written as:
.BR fcntl ().
The preferred way to write this in the source file is:
.nf
2007-05-23 21:35:13 +00:00
.BR fcntl ()
.fi
(Using this format, rather than the use of "\\fB...\\fP()"
makes it easier to write tools that parse man page source files.)
.PP
Any reference to another man page
should be written with the name in bold,
.I always
followed by the section number,
formatted in Roman (normal) font, without any
separating spaces (e.g.,
.BR intro (2)).
The preferred way to write this in the source file is:
.nf
.BR intro (2)
.fi
(Including the section number in cross references lets tools like
.BR man2html (1)
create properly hyperlinked pages.)
.SS Spelling
2007-06-08 10:06:05 +00:00
Starting with release 2.59,
.I man-pages
follows American spelling conventions
(previously, there was a random mix of British and American spallings);
please write all new pages and patches according to these conventions.
.SS Capitalization
In subsection ("SS") headings
capitalize the first word in heading, but otherwise use lower case,
except where English usage (e.g., proper nouns) or programming
language requirements (e.g., identifier names) dictate otherwise.
intro.1, time.1, _syscall.2, accept.2, brk.2, capget.2, faccessat.2, futimesat.2, gethostname.2, intro.2, ioprio_set.2, kill.2, madvise.2, mlock.2, mount.2, msgget.2, perf_event_open.2, poll.2, readv.2, sched_rr_get_interval.2, sched_setscheduler.2, select.2, select_tut.2, shmget.2, stat.2, timer_create.2, ustat.2, vfork.2, wait.2, alloca.3, atexit.3, catopen.3, crypt.3, dbopen.3, fenv.3, fopen.3, getaddrinfo_a.3, gethostbyname.3, getutent.3, intro.3, login.3, mallopt.3, queue.3, regex.3, sigpause.3, sigsetops.3, stdio.3, strftime.3, strptime.3, sysconf.3, ttyslot.3, undocumented.3, cciss.4, console_codes.4, hpsa.4, initrd.4, intro.4, rtc.4, st.4, tty_ioctl.4, wavelan.4, acct.5, charmap.5, dir_colors.5, hosts.5, intro.5, termcap.5, utmp.5, intro.6, armscii-8.7, boot.7, bootparam.7, capabilities.7, cpuset.7, credentials.7, ddp.7, epoll.7, glob.7, intro.7, ip.7, ipv6.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, koi8-r.7, koi8-u.7, man-pages.7, man.7, math_error.7, netlink.7, numa.7, packet.7, path_resolution.7, pipe.7, pthreads.7, raw.7, rtnetlink.7, signal.7, socket.7, spufs.7, svipc.7, tcp.7, time.7, udp.7, udplite.7, unicode.7, unix.7, uri.7, utf-8.7, x25.7, intro.8: Global fix: use consistent capitalization in .SS headings Capitalization in .SS sections across pages (and sometimes even within a single page) is wildly inconsistent. Make it consistent. Capitalize first word in heading, but otherwise use lower case, except where English usage (e.g., proper nouns) or programming language requirements (e.g., identifier names) dictate otherwise. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-02-24 14:08:38 +00:00
.SS Example programs and shell sessions
2007-06-21 22:55:04 +00:00
Manual pages can include example programs demonstrating how to
use a system call or library function.
However, note the following:
.IP * 3
Example programs should be written in C.
.IP *
intro.1, _syscall.2, access.2, arch_prctl.2, cacheflush.2, chown.2, clock_getres.2, clone.2, create_module.2, fcntl.2, flock.2, get_kernel_syms.2, get_robust_list.2, get_thread_area.2, getcpu.2, getpriority.2, getrlimit.2, getrusage.2, ioprio_set.2, kexec_load.2, madvise.2, mbind.2, migrate_pages.2, mknod.2, mmap.2, mount.2, move_pages.2, mprotect.2, open.2, pause.2, pciconfig_read.2, perf_event_open.2, prctl.2, ptrace.2, query_module.2, read.2, reboot.2, recv.2, s390_runtime_instr.2, sched_setscheduler.2, select_tut.2, send.2, set_mempolicy.2, setfsgid.2, setfsuid.2, sigaction.2, spu_create.2, spu_run.2, stime.2, swapon.2, syslog.2, timer_create.2, timer_getoverrun.2, times.2, tkill.2, umount.2, unimplemented.2, ustat.2, vm86.2, wait.2, abs.3, aio_read.3, aio_write.3, bsd_signal.3, catgets.3, clearenv.3, cmsg.3, dbopen.3, dirfd.3, dlopen.3, exec.3, fenv.3, ferror.3, fmemopen.3, fnmatch.3, fopen.3, futimes.3, getaddrinfo.3, getifaddrs.3, getipnodebyname.3, hsearch.3, if_nameindex.3, inet_pton.3, mblen.3, mbrlen.3, mbsrtowcs.3, mbtowc.3, mcheck.3, memfrob.3, mq_notify.3, netlink.3, posix_memalign.3, printf.3, pthread_attr_setscope.3, pthread_cleanup_push.3, pthread_kill_other_threads_np.3, pthread_self.3, pthread_setcancelstate.3, pthread_setconcurrency.3, raise.3, resolver.3, rpc.3, rtime.3, rtnetlink.3, scanf.3, setbuf.3, setnetgrent.3, shm_open.3, sigpause.3, sigset.3, sigwait.3, sockatmark.3, strcasecmp.3, strcmp.3, strdup.3, strftime.3, strptime.3, strsignal.3, strverscmp.3, sysv_signal.3, termios.3, wcrtomb.3, wcsnlen.3, wcsnrtombs.3, wcsrtombs.3, wctomb.3, wprintf.3, console_codes.4, cpuid.4, msr.4, rtc.4, sk98lin.4, st.4, tty.4, charmap.5, core.5, elf.5, hosts.equiv.5, proc.5, resolv.conf.5, services.5, slabinfo.5, arp.7, bootparam.7, capabilities.7, charsets.7, cpuset.7, ddp.7, epoll.7, feature_test_macros.7, futex.7, hier.7, icmp.7, inotify.7, ip.7, ipv6.7, man-pages.7, mdoc.7, mdoc.samples.7, netdevice.7, netlink.7, numa.7, packet.7, path_resolution.7, posixoptions.7, pthreads.7, raw.7, rtld-audit.7, rtnetlink.7, sem_overview.7, sigevent.7, socket.7, spufs.7, tcp.7, udp.7, unicode.7, uri.7, utf-8.7, intro.8, ldconfig.8, sync.8: Global fix: fix placement of word "only" Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2013-03-31 08:53:00 +00:00
An example program is necessary and useful only if it demonstrates
something beyond what can easily be provided in a textual
description of the interface.
An example program that does nothing
other than call an interface usually serves little purpose.
.IP *
2008-07-09 15:41:19 +00:00
Example programs should be fairly short (preferably less than 100 lines;
ideally less than 50 lines).
.IP *
Example programs should do error checking after system calls and
library function calls.
.IP *
Example programs should be complete, and compile without
2008-06-26 13:23:48 +00:00
warnings when compiled with \fIcc\ \-Wall\fP.
.IP *
Where possible and appropriate, example programs should allow
experimentation, by varying their behavior based on inputs
(ideally from command-line arguments, or alternatively, via
input read by the program).
.IP *
Example programs should be laid out according to Kernighan and
Ritchie style, with 4-space indents.
(Avoid the use of TAB characters in source code!)
.IP *
If there is extensive explanatory text before the
program source code, mark off the source code
with a susbsection heading
.IR "Program source" ,
as in:
.SS Program source
Always do this if the explanatory text includes a shell session log.
.PP
If you include a shell session log demonstrating the use of a program
or other system feature:
.IP * 3
Place the session log above the source code listing
.IP *
Indent the session log by four spaces.
.IP *
Boldface the user input text,
to distinguish it from output produced by the system.
.PP
For some examples of what example programs should look like, see
.BR wait (2)
and
.BR pipe (2).
.SS Indentation of structure definitions, shell session logs, etc.
When structure definitions, shell session logs, and so on are included
in running text, indent them by 4 spaces (i.e., a block enclosed by
.I ".in\ +4n"
and
.IR ".in" ).
.SH EXAMPLE
For canonical examples of how man pages in the
2007-09-20 16:26:31 +00:00
.I man-pages
package should look, see
.BR pipe (2)
and
.BR fcntl (2).
.SH SEE ALSO
.BR man (1),
.BR man2html (1),
2007-07-08 11:01:55 +00:00
.BR groff (7),
.BR groff_man (7),
.BR man (7),
.BR mdoc (7)