]> git.ipfire.org Git - thirdparty/man-pages.git/blob - HOWTOHELP
Ready for 2.28.
[thirdparty/man-pages.git] / HOWTOHELP
1 The following notes are written for people who want to help with
2 maintaining manual pages in the Linux man-pages package.
3
4 Send suggestions and corrections to:
5
6 mtk-manpages@gmx.net
7
8 Cheers
9
10 Michael Kerrisk
11 man-pages maintainer
12
13
14 THINGS YOU CAN DO TO HELP
15 =========================
16
17 You can help in the following ways:
18
19 -- sending in bug reports about problems in existing pages;
20 (An alternative is to report the bug in one of the
21 distribution-specific Bugzilla facilities, if that facility
22 provides a mechanism to automatically forward bug reports
23 to me. Currently, I am registered to receive man-page bug
24 reports from the Debian bugzilla, but if other distributions
25 provide a similar facility I may get myself registered for
26 those; let me know.)
27
28 -- writing patches that improve existing pages (see below);
29
30 -- writing new pages (see below for a list of currently missing pages);
31
32 -- grepping for the string FIXME in existing pages and writing a
33 suitable patch (see below);
34
35 -- asking me to add you to my distribution list for notification of
36 new man-pages releases, and reviewing the changes that have
37 occurred during a release (do "diff -ruN" between the directory
38 trees for the current and previous releases); and
39
40 -- suggesting improvements to this document.
41
42
43 HOW TO CONTRIBUTE PATCHES
44 =========================
45
46 Patches should be sent to Michael Kerrisk, mtk-manpages@gmx.net.
47 When you submit a patch, please note the following:
48
49 -- Submit a patch against the current version of the page. The current
50 version of the man-pages package can be downloaded from
51
52 ftp://ftp.win.tue.nl/pub/linux-local/manpages
53
54 or:
55
56 ftp://ftp.kernel.org/pub/linux/docs/manpages
57 or mirrors: ftp://ftp.XX.kernel.org/pub/linux/docs/manpages
58
59 -- Let me know how you obtained the information: was it by reading (or
60 writing) the relevant kernel or (g)libc source code; by writing a
61 test program (send it to me, if you want, and if it is clear and
62 simple to use); from other documentation; from a mailing list or
63 Usenet thread (please provide a URL if possible).
64
65 -- Send patches in "diff -u" format, inline inside the mail message
66 is usually best; if it is a very long patch then send it both inline
67 and as an attachment.
68
69 -- Send logically separate patches (e.g., for unrelated pages) as
70 separate mails.
71
72 -- In the body of the mail message, identify the manual page
73 version against which the patch applies.
74
75 -- Make sure that the mail has a suitable SUBJECT line (i.e., one that
76 mentions the name(s) of the page(s) being patched). Don't put the
77 manual page version in the subject line (it should already be in the
78 body, and cluttering the subject line with a version number does
79 not help me when filing messages...). A suitable subject line might
80 be something like:
81
82 [patch] shmop.2: add "(void *)" cast to RETURN VALUE
83
84
85 MANUAL PAGES IN OTHER PACKAGES
86 ==============================
87
88 Not all Linux manual pages are part of the man-pages set. In
89 particular, most Section 1 and 8 pages come as part of some other
90 package. The easiest way to determine which pages are part of the
91 man-pages package is to download the latest tarball, and see if the
92 page is present.
93
94 If you want to submit a patch for a manual page that comes from another
95 source, then you need to work out where the manual page comes from
96 (i.e., which package) and who the maintainer of that manual page is.
97
98 On an RPM-based distribution, you can do the following to find out
99 which package owns a particular file. For example, suppose we want
100 to find out who maintains the fstab(5) manual page:
101
102 $ man -w fstab
103 /usr/share/man/man5/fstab.5.gz
104 $ rpm -qf /usr/share/man/man5/fstab.5.gz
105 util-linux-2.12q-7.2
106
107 If we then look in the MAINTAINERS file in the util-linux
108 package, we see:
109
110 Maintainer: Adrian Bunk <bunk@stusta.de>
111
112 Maintainer of getopt: Frodo Looijaard <frodol@dds.nl>
113 Maintainer of simpleinit: Richard Gooch <rgooch@atnf.csiro.au>
114
115 On a Debian-based distribution (e.g. Debian, Knoppix, Ubuntu) you can
116 do the following:
117
118 $ man -w fstab
119 /usr/share/man/man5/fstab.5.gz
120 $ dpkg -S /usr/share/man/man5/fstab.5.gz
121 mount: /usr/share/man/man5/fstab.5.gz
122 $ dpkg -p mount | grep Maintainer
123 Maintainer: LaMont Jones <lamont@debian.org>
124
125 Note: this gives you the Debian maintainer of the package in question,
126 which is a good address to report to, since many packages and manual
127 pages are modified by Debian. The maintainer of the original package
128 can usually be found in a README in /usr/share/doc/<package-name>.
129 Use "dpkg -L mount" to find all files from the mount package.
130
131 (FIXME: add instructions for doing the equivalent of the above on
132 distributions that use other schemes.)
133
134
135 REPAIRING PAGES MARKED "FIXME"
136 ==============================
137
138 Grepping the source of the manual pages will show various places where
139 pages are marked with the string FIXME. This usually indicates that
140 someone has noticed that some information on the page is incorrect
141 or incomplete, but has not had the time/knowledge to fix problem.
142 (Sometimes a FIXME relates to a kernel or glibc bug report that is
143 awaiting resolution, and it may be sufficient to check if the bug
144 has been resolved and then provide a suitable write-up on the page.)
145
146 If you know how to fix the problem, then please send a patch.
147 However, note that many of the FIXME markings are associated with
148 problems that are quite difficult: you need to ensure that you are
149 knowledgeable on the relevant point(s), or you need to be willing to
150 invest the time to become knowledgeable (by reading kernel or
151 [g]libc source files and/or writing suitable test programs).
152
153
154 CONVENTIONS FOR MANUAL PAGE LAYOUT
155 ==================================
156
157 Please keep source code line length <= 72 characters wherever possible.
158 This helps avoid line-wrapping in some mail clients when patches are
159 submitted inline.
160
161 New sentences are generally best started on new lines. This makes
162 it easier to see the effect of patches, which often operate at the
163 level of individual sentences.
164
165
166 EXAMPLE PROGRAMS
167 ================
168
169 New manual pages, or patches to existing manual pages, can include
170 example programs demonstrating how to use a system call or library
171 function. However, note the following:
172
173 -- Example programs should be written in C.
174
175 -- An example program is only necessary and useful if it demonstrates
176 something beyond what can easily be provided in a textual
177 description of the interface. An example program that does nothing
178 other than call an interface usually serves little purpose.
179
180 -- Example programs should be fairly short (preferably < 100 lines;
181 ideally < 50 lines).
182
183 -- Example programs should do error checking after system calls and
184 library function calls.
185
186 -- Example programs should be complete, and compile without
187 warnings when compiled with "cc -Wall",
188
189 -- Where possible and appropriate, example programs should allow
190 experimentation, by varying their behaviour based on inputs
191 (ideally from command-line arguments, or alternatively, via
192 input read by the program).
193
194 Example programs should be laid out according to Kernighan and
195 Ritchie, with a few concessions:
196
197 -- 4-space indents are preferred, in unusual cases, 2-space indents
198 may be okay. (Avoid the use of TAB characters in source code!)
199
200 -- In the interests of keeping a program short, compressing
201 error-handling code such as the following is acceptable:
202
203 if (func(...) == -1)
204 { perror("func"); exit(EXIT_FAILURE); }
205
206 For some examples of what example programs should look like, see
207 the wait.2 and pipe.2 manual pages.
208
209
210 MISSING MANUAL PAGES
211 ====================
212
213 Below is a list of pages that I would like to see in the man-pages set.
214 If you are thinking of writing one or more of these pages, then:
215
216 -- It might be wise to let me know in advance, just in case someone
217 else has started working on the page, or a related page. I may
218 also be able point you at useful sources of information for
219 the manual page.
220
221 -- You need to have a reasonably high degree of understanding of the
222 topic, or be prepared to invest the time (e.g., reading source code,
223 writing test programs) to gain that understanding.
224
225 -- Follow the existing formatting conventions for manual pages.
226 Some information about formatting is provided in the "man(7)"
227 manual page. As an example of how these conventions are employed,
228 have a look at the "fcntl(2)" manual page and read its source file
229 (man2/fcntl.2).
230
231 -- The page must be submitted under some sort of license that permits
232 the page to be freely redistributed and modified. Include that
233 license or a reference to it, in the source code of the manual page.
234 Possible licenses include the GPL, the BSD license, or a range of
235 other licenses, some of which can be seen in existing manual pages.
236
237 -- You may find it useful to check the information in your page
238 against the specifications in SUSv3/POSIX.1-2001
239 (http://www.opengroup.org/onlinepubs/009695399/toc.htm) or against
240 manual pages on other implementations, but do not not violate the
241 copyright on those publications by copying text from them.
242
243 -- The GNU C library documents many of the functions that it provides
244 using info(1). If you are thinking of writing a manual page for
245 a function that is already documented in info(1) format, then
246 ideally this page needs to present new or different information from
247 that provided by the info(1) page (for example, historical
248 information about how the function has changed across various glibc
249 versions, or variations in operation across C libraries; such
250 information is often not present in info pages). (An alternative to
251 consider is submitting a patch to the maintainers of the glibc
252 documentation, if that is more appropriate.)
253
254
255 System Calls
256 ------------
257
258 add_key(2) (new in kernel 2.6.10)
259 keyctl(2) (new in kernel 2.6.10)
260 request_key(2) (new in kernel 2.6.10)
261 See:
262 Documentation/keys.txt
263 Documentation/keys-request-key.txt
264
265
266 ioprio_get(2) (new in kernel 2.6.13)
267 ioprio_set(2) (new in kernel 2.6.13)
268 See Documentation/block/ioprio.txt
269
270
271 restart_syscall(2) (new in kernel 2.6)
272 kexec_load(2) (new in kernel 2.6.13)
273
274 migrate_pages(2) (new in kernel 2.6.16)
275 See Documentation/vm/page_migration
276
277 preadv(2), pwritev(2) (new in ?? -- see
278 http://www.lwn.net/Articles/164887/ )
279
280
281 epoll_pwait(2) (probably will arrive in 2.6.17)
282
283
284 The new *at(2) system calls in 2.6.16:
285
286 openat(2) S [Already documented]
287 faccessat(2)
288 fstatat(2) S f (AT_SYMLINK_NOFOLLOW)
289 fchmodat(2)
290 fchownat(2) S f (AT_SYMLINK_NOFOLLOW)
291 futimesat(2) S [See also glibc wrapper]
292 mkdirat(2)
293 mknodat(2)
294 linkat(2) 2
295 unlinkat(2) S f (AT_REMOVEDIR)
296 symlinkat(2)
297 readlinkat(2)
298 renameat(2) 2
299
300 In the above list: functions marked '2' take two dirfd arguments;
301 functions marked 'f' take a flags argument that is not present
302 in their traditional counterparts (and possible flag values
303 are listed in parentheses); and functions marked 'S' have
304 counterparts (not exactly the same) on Solaris.
305
306 Note that openat(2) is already documented and includes some NOTES
307 on the rationale for the *at() interfaces; this page could serve
308 as a template for the documentation of the remaining system calls.
309
310
311 /sys file system
312 ----------------
313
314 There is no man page for the /sys file system: there probably should
315 be a sys.5 page similar to proc.5. The kernel source file
316 Documentation/filesystems/sysfs.txt provides a starting point for
317 this page.
318
319
320 Library Functions
321 -----------------
322
323 (See a further list of missing pages in the "undocumented(3)" manual page.
324
325 Searches like the following are likely to sugest other functions
326 that need to be documented:
327
328
329 MPDIR=~/man-pages # Directory containing uncompressed man-pages
330 GLIBCDIR=/SOME_DIR # Directory containing glibc tree
331
332 for f in $(cat $(echo $GLIBCDIR/abilist/*.abilist) | grep -v 'GLIBC' | \
333 awk '{print $1}' | grep -v '^_' | sort -u); do
334 if ! test -f $MPDIR/man3/$f.3 > /dev/null 2>&1 && \
335 ! test -f $MPDIR/man2/$f.2 > /dev/null 2>&1 ; then
336 echo $f;
337 fi
338 done
339 )
340
341 adjtime(3)
342 bsd_signal(3)
343 clock_nanosleep(3)
344 crypt_r(3) (To be added to crypt.3)
345 dlinfo(3) (Solaris and FreeBSD have a similar function.)
346 dladdr1(3)
347 dlmopen(3) (Since glibc 2.3.4; probably to be documented in dlopen.3)
348 euidaccess(3) / eaccess(3)
349 fdopendir(3) (since glibc 2.4)
350 fopencookie(3)
351 getsubopt(3)
352 getutmp(3)
353 getutmpx(3)
354 gnu_get_libc_release(3)
355 gnu_get_libc_version(3)
356 mallinfo(3)
357 mallopt(3)
358 mcheck(3), mprobe(3)
359 memmem(3) (GNU extension)
360 mkfifoat(3) -- see notes on the *at(2) syscalls above (since glibc 2.4)
361 readdir_r(3) (probably as additional text in readdir.3)
362 open_wmemstream(3) (since glibc 2.4)
363 posix_madvise(3)
364 program_invocation_name(3)
365 program_invocation_short_name(3)
366 sigstack(3)
367 sigwait(3)
368 sockatmark(3)
369 strftime_l(3) (since glibc 2.3)
370 strptime_l(3) (since glibc 2.3.2)
371 sysv_signal(3)
372 updwtmpx(3)
373
374 sigandset(3), sigosset(3), sigisemptyset(3)
375 (perhaps on same page as sigemptyset(3))
376
377 fwscanf(3), swscanf(3), vfwscanf(3), vswscanf(3), wscanf(3)
378
379
380 argp_error(3)
381 argp_failure(3)
382 argp_help(3)
383 argp_parse(3)
384 argp_program_bug_address(3)
385 argp_program_version(3)
386 argp_program_version_hook(3)
387 argp_state_help(3)
388 argp_usage(3)
389
390
391 posix_spawn(3)
392 posix_spawnattr_destroy(3)
393 posix_spawnattr_getflags(3)
394 posix_spawnattr_getpgroup(3)
395 posix_spawnattr_getschedparam(3)
396 posix_spawnattr_getschedpolicy(3)
397 posix_spawnattr_getsigdefault(3)
398 posix_spawnattr_getsigmask(3)
399 posix_spawnattr_init(3)
400 posix_spawnattr_setflags(3)
401 posix_spawnattr_setpgroup(3)
402 posix_spawnattr_setschedparam(3)
403 posix_spawnattr_setschedpolicy(3)
404 posix_spawnattr_setsigdefault(3)
405 posix_spawnattr_setsigmask(3)
406 posix_spawn_file_actions_addclose(3)
407 posix_spawn_file_actions_adddup2(3)
408 posix_spawn_file_actions_addopen(3)
409 posix_spawn_file_actions_destroy(3)
410 posix_spawn_file_actions_init(3)
411 posix_spawnp(3)
412
413
414 if_freenameindex(3)
415 if_indextoname(3)
416 if_nameindex(3)
417 if_nametoindex(3)
418
419
420 getaddrinfo_a(3), gai_cancel(3), gai_error(3), gai_suspend(3)
421 (libanl; since glibc 2.2.3; See
422 http://people.redhat.com/~drepper/asynchnl.pdf)
423
424
425 Various wide character functions (with their traditional equivalents
426 mentioned in parentheses):
427
428 wcscoll(3) (strcoll(3))
429 wcsxfrm(3) (strxfrm(3))
430 wcschrnul(3) (strchrnul(3))
431 wcswcs(3) (strstr(3))
432 wcstod(3) (strtod(3))
433 wcstof(3) (strtof(3))
434 wcstold(3) (strtold(3))
435 wcstol(3) (atol(3))
436 wcstol(3) (strtol(3))
437 wcstoul(3) (strtoul(3))
438 wcstoll(3) (strtoll(3))
439 wcstoull(3) (strtoull(3))
440 wcstoq(3) (atoq(3))
441 wcstoq(3) (strtoq(3))
442 wcstouq(3) (strtouq(3))
443 wscanf(3) (scanf(3))
444 wcsftime(3) (strftime(3))
445
446 After these manual pages are written, add SEE ALSO entries
447 from the pages for the traditional functions to the pages
448 describing their wide-character equivalents.
449
450
451 And last, but far from least, the POSIX threads API. Note that there is
452 an existing, outdated set of pages supplied with glibc that document the
453 old LinuxThreads implementation. (These pages are written under a
454 license that allows re-use, so some material that they contain could
455 be used in new pages.) What is required is a set of pages that document
456 the complete API, describing details where LinuxThreads and NPTL diverge
457 from the standard. The existing pthreads(7) manual page, which gives an
458 overview of Pthreads implementations on Linux, is designed as a base
459 document for these manual pages. The list of required manual pages is
460 long (related functions can be grouped on a single page); those marked
461 with more asterisks are probably the most desirable to get done first:
462
463 pthread_atfork() *
464 pthread_attr_destroy()
465 pthread_attr_getaffinity_np()
466 pthread_attr_getdetachstate()
467 pthread_attr_getguardsize()
468 pthread_attr_getinheritsched()
469 pthread_attr_getschedparam()
470 pthread_attr_getschedpolicy()
471 pthread_attr_getscope()
472 pthread_attr_getstack()
473 pthread_attr_getstackaddr()
474 pthread_attr_getstacksize()
475 pthread_attr_init()
476 pthread_attr_setaffinity_np()
477 pthread_attr_setdetachstate()
478 pthread_attr_setguardsize()
479 pthread_attr_setinheritsched()
480 pthread_attr_setschedparam()
481 pthread_attr_setschedpolicy()
482 pthread_attr_setscope()
483 pthread_attr_setstack()
484 pthread_attr_setstackaddr()
485 pthread_attr_setstacksize()
486 pthread_barrierattr_destroy()
487 pthread_barrierattr_getpshared()
488 pthread_barrierattr_init()
489 pthread_barrierattr_setpshared()
490 pthread_barrier_destroy()
491 pthread_barrier_init()
492 pthread_barrier_wait()
493 pthread_cancel() **
494 pthread_cleanup_pop() **
495 pthread_cleanup_pop_restore_np()
496 pthread_cleanup_push() **
497 pthread_cleanup_push_defer_np()
498 pthread_condattr_destroy()
499 pthread_condattr_getclock()
500 pthread_condattr_getpshared()
501 pthread_condattr_init()
502 pthread_condattr_setclock()
503 pthread_condattr_setpshared()
504 pthread_cond_broadcast() **
505 pthread_cond_destroy() **
506 pthread_cond_init() **
507 pthread_cond_signal() **
508 pthread_cond_timedwait() **
509 pthread_cond_wait() **
510 pthread_create() ***
511 pthread_detach() ***
512 pthread_equal() ***
513 pthread_exit() ***
514 pthread_getaffinity_np()
515 pthread_getattr_np()
516 pthread_getconcurrency()
517 pthread_getcpuclockid()
518 pthread_getschedparam()
519 pthread_getspecific() **
520 pthread_join() ***
521 pthread_key_create() **
522 pthread_key_delete() **
523 pthread_kill() *
524 pthread_kill_other_threads_np()
525 pthread_mutexattr_destroy()
526 pthread_mutexattr_getpshared()
527 pthread_mutexattr_gettype()
528 pthread_mutexattr_init()
529 pthread_mutexattr_setpshared()
530 pthread_mutexattr_settype()
531 pthread_mutex_destroy() **
532 pthread_mutex_init() **
533 pthread_mutex_lock() **
534 pthread_mutex_timedlock() **
535 pthread_mutex_trylock() **
536 pthread_mutex_unlock() **
537 pthread_once() **
538 pthread_rwlockattr_destroy()
539 pthread_rwlockattr_getkind_np()
540 pthread_rwlockattr_getpshared()
541 pthread_rwlockattr_init()
542 pthread_rwlockattr_setkind_np()
543 pthread_rwlockattr_setpshared()
544 pthread_rwlock_destroy()
545 pthread_rwlock_init()
546 pthread_rwlock_rdlock()
547 pthread_rwlock_timedrdlock()
548 pthread_rwlock_timedwrlock()
549 pthread_rwlock_tryrdlock()
550 pthread_rwlock_trywrlock()
551 pthread_rwlock_unlock()
552 pthread_rwlock_wrlock()
553 pthread_self() **
554 pthread_setaffinity_np()
555 pthread_setcancelstate()
556 pthread_setcanceltype()
557 pthread_setconcurrency()
558 pthread_setschedparam()
559 pthread_setspecific() **
560 pthread_sigmask() *
561 pthread_spin_destroy()
562 pthread_spin_init()
563 pthread_spin_lock()
564 pthread_spin_trylock()
565 pthread_spin_unlock()
566 pthread_testcancel() **
567 pthread_timedjoin_np()
568 pthread_tryjoin_np()
569 pthread_yield() *
570 pthread_yield_np()
571
572 And new in glibc 2.4:
573
574 pthread_mutex_consistent_np()
575 pthread_mutexattr_getrobust_np()
576 pthread_mutexattr_setrobust_np()
577 pthread_mutexattr_getprotocol()
578 pthread_mutexattr_setprotocol()
579 pthread_mutexattr_getprioceiling()
580 pthread_mutexattr_setprioceiling()
581 pthread_mutex_getprioceiling()
582 pthread_mutex_setprioceiling()