Skip to contentSkip to conversation

Add LIBRARY section (based on FreeBSD manual pages)

PATCH In review Alejandro Colomar 4 participants 55 messages Sep 11, 2021 – Sep 17, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

cover Add LIBRARY section (based on FreeBSD manual pages)

Hi Michael,

Here's a first patch set adding a new LIBRARY section to man2 and man3 pages (I started with man2).

It is based on (mostly cloned from) FreeBSD's man pages, as I liked that section from them.

It normalizes the information we had in comments in
NOTES or SYNOPSIS or DESCRIPTION.
Or in most pages we didn't even have it, as we assume that 'cc' already handles '-lc' by deafult.

Patch 20/45 was removed on purpose due to a mistake.

Cheers,

Alex

Alejandro Colomar (45):
_exit.2: Add LIBRARY section
keyctl.2: Add LIBRARY section
gamma.3: Add LIBRARY section
request_key.2: Add LIBRARY section
write.2: Add LIBRARY section
wait4.2: Add LIBRARY section
wait.2: Add LIBRARY section
vmsplice.2: Add LIBRARY section
vm86.2: Add LIBRARY section
vhangup.2: Add LIBRARY section
vfork.2: Add LIBRARY section
utimensat.2: Add LIBRARY section
utime.2: Add LIBRARY section
ustat.2: Add LIBRARY section
userfaultfd.2: Add LIBRARY section
unshare.2: Add LIBRARY section
uname.2: Add LIBRARY section
umount.2: Add LIBRARY section
tkill.2: Add LIBRARY section
unlink.2: Add LIBRARY section
umask.2: Add LIBRARY section
truncate.2: Add LIBRARY section
timer_getoverrun.2: Add LIBRARY section
timerfd_create.2: Add LIBRARY section
timer_delete.2: Add LIBRARY section
timer_create.2: Add LIBRARY section
time.2: Add LIBRARY section
tee.2: Add LIBRARY section
syslog.2: Add LIBRARY section
sysinfo.2: Add LIBRARY section
syscall.2: Add LIBRARY section
sync_file_range.2: Add LIBRARY section
sync.2: Add LIBRARY section
symlink.2: Add LIBRARY section
swapon.2: Add LIBRARY section
subpage_prot.2: Add LIBRARY section
statx.2: Add LIBRARY section
stat.2: Add LIBRARY section
spu_run.2: Add LIBRARY section
spu_create.2: Add LIBRARY section
splice.2: Add LIBRARY section
socketpair.2: Add LIBRARY section
socketcall.2: Add LIBRARY section
sigwaitinfo.2: Add LIBRARY section

 man2/_exit.2            |  3 +++
 man2/keyctl.2           |  9 +++++++--
 man2/request_key.2      | 18 ++++--------------
 man2/sigwaitinfo.2      |  3 +++
 man2/socketcall.2       |  3 +++
 man2/socketpair.2       |  3 +++
 man2/splice.2           |  3 +++
 man2/spu_create.2       |  3 +++
 man2/spu_run.2          |  3 +++
 man2/stat.2             |  3 +++
 man2/statx.2            |  3 +++
 man2/subpage_prot.2     |  3 +++
 man2/swapon.2           |  3 +++
 man2/symlink.2          |  3 +++
 man2/sync.2             |  3 +++
 man2/sync_file_range.2  |  3 +++
 man2/syscall.2          |  3 +++
 man2/sysinfo.2          |  3 +++
 man2/syslog.2           |  3 +++
 man2/tee.2              |  3 +++
 man2/time.2             |  3 +++
 man2/timer_create.2     |  5 +++--
 man2/timer_delete.2     |  5 +++--
 man2/timer_getoverrun.2 |  5 +++--
 man2/timer_settime.2    |  5 +++--
 man2/timerfd_create.2   |  3 +++
 man2/times.2            |  3 +++
 man2/tkill.2            |  3 +++
 man2/truncate.2         |  3 +++
 man2/umask.2            |  3 +++
 man2/umount.2           |  3 +++
 man2/uname.2            |  3 +++
 man2/unlink.2           |  3 +++
 man2/unshare.2          |  3 +++
 man2/userfaultfd.2      |  3 +++
 man2/ustat.2            |  3 +++
 man2/utime.2            |  3 +++
 man2/utimensat.2        |  3 +++
 man2/vfork.2            |  3 +++
 man2/vhangup.2          |  3 +++
 man2/vm86.2             |  3 +++
 man2/vmsplice.2         |  3 +++
 man2/wait.2             |  3 +++
 man2/wait4.2            |  3 +++
 man2/write.2            |  3 +++
 man3/gamma.3            |  5 +++--
 46 files changed, 143 insertions(+), 26 deletions(-)
Signature · 1 line
2.33.0
#1 lore raw

PATCH 1/45 _exit.2: Add LIBRARY section

---
 man2/_exit.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/_exit.2 +3 -0
index 4b3cfd7ac..9a0e9bdd5 100644
@@ -29,6 +29,9 @@
 .TH _EXIT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 _exit, _Exit \- terminate the calling process
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#2 lore raw

PATCH 2/45 keyctl.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/keyctl.2 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
man2/keyctl.2 +7 -2
index 4e3ca5dac..226ae2800 100644
@@ -28,6 +28,13 @@
 .TH KEYCTL 2 2021-08-27 Linux "Linux Key Management Calls"
 .SH NAME
 keyctl \- manipulate the kernel's key management facility
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
+.PP
+Alternatively, Linux Key Management Utilities
+.RI ( libkeyutils ", " -lkeyutils );
+see NOTES.
 .SH SYNOPSIS
 .nf
 .BR "#include <linux/keyctl.h>" "     /* Definition of " KEY* " constants */"
@@ -1958,8 +1965,6 @@ library.
 (The accompanying package provides the
 .I <keyutils.h>
 header file.)
-When employing the wrapper in that library, link with
-.IR \-lkeyutils .
 However, rather than using this system call directly,
 you probably want to use the various library functions
 mentioned in the descriptions of individual operations above.
Signature · 1 line
2.33.0
#3 lore raw

PATCH 3/45 gamma.3: Add LIBRARY section

In reply to Alejandro Colomar
---
 man3/gamma.3 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
man3/gamma.3 +3 -2
index 003964158..e7115ec47 100644
@@ -9,6 +9,9 @@
 .TH GAMMA 3 2021-03-22 "GNU" "Linux Programmer's Manual"
 .SH NAME
 gamma, gammaf, gammal \- (logarithm of the) gamma function
+.SH LIBRARY
+Math library
+.RI ( libm ", " -lm )
 .SH SYNOPSIS
 .nf
 .B #include <math.h>
@@ -18,8 +21,6 @@ gamma, gammaf, gammal \- (logarithm of the) gamma function
 .BI "long double gammal(long double " x ");"
 .fi
 .PP
-Link with \fI\-lm\fP.
-.PP
 .RS -4
 Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
Signature · 1 line
2.33.0
#4 lore raw

PATCH 4/45 request_key.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/request_key.2 | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
man2/request_key.2 +4 -14
index 145aff506..e0d05525a 100644
@@ -12,17 +12,17 @@
 .TH REQUEST_KEY 2 2021-08-27 Linux "Linux Key Management Calls"
 .SH NAME
 request_key \- request a key from the kernel's key management facility
+.SH LIBRARY
+Linux Key Management Utilities
+.RI ( libkeyutils ", " -lkeyutils )
 .SH SYNOPSIS
 .nf
 .B #include <keyutils.h>
 .PP
 .BI "key_serial_t request_key(const char *" type ", const char *" description ,
 .BI "                         const char *" callout_info ,
-.BI "                         key_serial_t " dest_keyring ");"
+.BI "                         key_serial_t " dest_keyring );
 .fi
-.PP
-.IR Note :
-There is no glibc wrapper for this system call; see NOTES.
 .SH DESCRIPTION
 .BR request_key ()
 attempts to find a key of the given
@@ -437,16 +437,6 @@ The ability to instantiate keys upon request was added
 in Linux 2.6.13.
 .SH CONFORMING TO
 This system call is a nonstandard Linux extension.
-.SH NOTES
-Glibc does not provide a wrapper for this system call.
-A wrapper is provided in the
-.IR libkeyutils
-library.
-(The accompanying package provides the
-.I <keyutils.h>
-header file.)
-When employing the wrapper in that library, link with
-.IR \-lkeyutils .
 .SH EXAMPLES
 The program below demonstrates the use of
 .BR request_key ().
Signature · 1 line
2.33.0
#5 lore raw

PATCH 5/45 write.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/write.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/write.2 +3 -0
index 1a2de2722..18936a2cf 100644
@@ -39,6 +39,9 @@
 .TH WRITE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 write \- write to a file descriptor
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#6 lore raw

PATCH 6/45 wait4.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/wait4.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/wait4.2 +3 -0
index 3bd60367e..12d55a556 100644
@@ -33,6 +33,9 @@
 .TH WAIT4 2  2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 wait3, wait4 \- wait for process to change state, BSD style
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/wait.h>
Signature · 1 line
2.33.0
#7 lore raw

PATCH 7/45 wait.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/wait.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/wait.2 +3 -0
index 4fe501ce7..18781b26d 100644
@@ -49,6 +49,9 @@
 .TH WAIT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
 .SH NAME
 wait, waitpid, waitid \- wait for process to change state
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/wait.h>
Signature · 1 line
2.33.0
#8 lore raw

PATCH 8/45 vmsplice.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/vmsplice.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/vmsplice.2 +3 -0
index 9102c4c92..eacf842b2 100644
@@ -26,6 +26,9 @@
 .TH VMSPLICE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 vmsplice \- splice user pages to/from a pipe
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
Signature · 1 line
2.33.0
#9 lore raw

PATCH 9/45 vm86.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/vm86.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/vm86.2 +3 -0
index 743882f02..09ffee46c 100644
@@ -26,6 +26,9 @@
 .TH VM86 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 vm86old, vm86 \- enter virtual 8086 mode
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/vm86.h>
Signature · 1 line
2.33.0
#10 lore raw

PATCH 10/45 vhangup.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/vhangup.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/vhangup.2 +3 -0
index 688c5d480..affba8110 100644
@@ -28,6 +28,9 @@
 .TH VHANGUP 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 vhangup \- virtually hangup the current terminal
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#11 lore raw

PATCH 11/45 vfork.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/vfork.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/vfork.2 +3 -0
index cd59a374f..7a75469cf 100644
@@ -29,6 +29,9 @@
 .TH VFORK 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 vfork \- create a child process and block parent
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#12 lore raw

PATCH 12/45 utimensat.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/utimensat.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/utimensat.2 +3 -0
index cb5f6b693..ca5fdeb44 100644
@@ -26,6 +26,9 @@
 .TH UTIMENSAT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
 .SH NAME
 utimensat, futimens \- change file timestamps with nanosecond precision
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <fcntl.h>" "            /* Definition of " AT_* " constants */"
Signature · 1 line
2.33.0
#13 lore raw

PATCH 13/45 utime.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/utime.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/utime.2 +3 -0
index 55ea8fc27..e529ae979 100644
@@ -31,6 +31,9 @@
 .TH UTIME 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 utime, utimes \- change file last access and modification times
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <utime.h>
Signature · 1 line
2.33.0
#14 lore raw

PATCH 14/45 ustat.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/ustat.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/ustat.2 +3 -0
index cb26ab23e..5153d2a47 100644
@@ -30,6 +30,9 @@
 .TH USTAT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 ustat \- get filesystem statistics
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/types.h>
Signature · 1 line
2.33.0
#15 lore raw

PATCH 15/45 userfaultfd.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/userfaultfd.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/userfaultfd.2 +3 -0
index cee7c01d2..d55c6e19e 100644
@@ -27,6 +27,9 @@
 .TH USERFAULTFD 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 userfaultfd \- create a file descriptor for handling page faults in user space
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <fcntl.h>" "            /* Definition of " O_* " constants */"
Signature · 1 line
2.33.0
#16 lore raw

PATCH 16/45 unshare.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/unshare.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/unshare.2 +3 -0
index 851c2b20e..7eee0050d 100644
@@ -20,6 +20,9 @@
 .TH UNSHARE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 unshare \- disassociate parts of the process execution context
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #define _GNU_SOURCE
Signature · 1 line
2.33.0
#17 lore raw

PATCH 17/45 uname.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/uname.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/uname.2 +3 -0
index 295eff294..2161354cb 100644
@@ -27,6 +27,9 @@
 .TH UNAME 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 uname \- get name and information about current kernel
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/utsname.h>
Signature · 1 line
2.33.0
#18 lore raw

PATCH 18/45 umount.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/umount.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/umount.2 +3 -0
index e9059c405..a18cf6175 100644
@@ -30,6 +30,9 @@
 .TH UMOUNT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
 .SH NAME
 umount, umount2 \- unmount filesystem
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B "#include <sys/mount.h>"
Signature · 1 line
2.33.0
#19 lore raw

PATCH 19/45 tkill.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/tkill.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/tkill.2 +3 -0
index 6e1afcd36..72fb429dc 100644
@@ -29,6 +29,9 @@
 .TH TKILL 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 tkill, tgkill \- send a signal to a thread
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <signal.h>" "           /* Definition of " SIG* " constants */"
Signature · 1 line
2.33.0
#20 lore raw

PATCH 21/45 unlink.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/unlink.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/unlink.2 +3 -0
index 97b71f6e7..dbb0774cb 100644
@@ -33,6 +33,9 @@
 .TH UNLINK 2 2021-08-27 "Linux" "Linux Programmer's Manual"
 .SH NAME
 unlink, unlinkat \- delete a name and possibly the file it refers to
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#21 lore raw

PATCH 22/45 umask.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/umask.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/umask.2 +3 -0
index 8a11c50e9..8a6dc1f98 100644
@@ -34,6 +34,9 @@
 .TH UMASK 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 umask \- set file mode creation mask
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/stat.h>
Signature · 1 line
2.33.0
#22 lore raw

PATCH 23/45 truncate.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/truncate.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/truncate.2 +3 -0
index ebe3c4ef4..054f4fc2b 100644
@@ -43,6 +43,9 @@
 .TH TRUNCATE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 truncate, ftruncate \- truncate a file to a specified length
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#23 lore raw

PATCH 24/45 timer_getoverrun.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/timer_getoverrun.2 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
man2/timer_getoverrun.2 +3 -2
index 5a0601a49..94f86c1c0 100644
@@ -26,6 +26,9 @@
 .TH TIMER_GETOVERRUN 2 2021-03-22 Linux "Linux Programmer's Manual"
 .SH NAME
 timer_getoverrun \- get overrun count for a POSIX per-process timer
+.SH LIBRARY
+Real-time library
+.RI ( librt ", " -lrt )
 .SH SYNOPSIS
 .nf
 .B  #include <time.h>
@@ -33,8 +36,6 @@ timer_getoverrun \- get overrun count for a POSIX per-process timer
 .BI "int timer_getoverrun(timer_t " timerid );
 .fi
 .PP
-Link with \fI\-lrt\fP.
-.PP
 .RS -4
 Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
Signature · 1 line
2.33.0
#24 lore raw

PATCH 25/45 timerfd_create.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/timerfd_create.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/timerfd_create.2 +3 -0
index 65fdfcc45..5434c12de 100644
@@ -20,6 +20,9 @@
 .SH NAME
 timerfd_create, timerfd_settime, timerfd_gettime \-
 timers that notify via file descriptors
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/timerfd.h>
Signature · 1 line
2.33.0
#25 lore raw

PATCH 26/45 timer_delete.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/timer_delete.2 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
man2/timer_delete.2 +3 -2
index dbfe35b92..e1990470b 100644
@@ -26,6 +26,9 @@
 .TH TIMER_DELETE 2 2021-03-22 Linux "Linux Programmer's Manual"
 .SH NAME
 timer_delete \- delete a POSIX per-process timer
+.SH LIBRARY
+Real-time library
+.RI ( librt ", " -lrt )
 .SH SYNOPSIS
 .nf
 .B  #include <time.h>
@@ -33,8 +36,6 @@ timer_delete \- delete a POSIX per-process timer
 .BI "int timer_delete(timer_t " timerid );
 .fi
 .PP
-Link with \fI\-lrt\fP.
-.PP
 .RS -4
 Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
Signature · 1 line
2.33.0
#26 lore raw

PATCH 27/45 timer_create.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/timer_create.2 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
man2/timer_create.2 +3 -2
index 9d3534570..5d67602e7 100644
@@ -26,6 +26,9 @@
 .TH TIMER_CREATE 2 2021-03-22 Linux "Linux Programmer's Manual"
 .SH NAME
 timer_create \- create a POSIX per-process timer
+.SH LIBRARY
+Real-time library
+.RI ( librt ", " -lrt )
 .SH SYNOPSIS
 .nf
 .BR "#include <signal.h>" "           /* Definition of " SIGEV_* " constants */"
@@ -35,8 +38,6 @@ timer_create \- create a POSIX per-process timer
 .BI "                 timer_t *restrict " timerid );
 .fi
 .PP
-Link with \fI\-lrt\fP.
-.PP
 .RS -4
 Feature Test Macro Requirements for glibc (see
 .BR feature_test_macros (7)):
Signature · 1 line
2.33.0
#27 lore raw

PATCH 28/45 time.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/time.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/time.2 +3 -0
index ab3d3ecba..4caf49960 100644
@@ -29,6 +29,9 @@
 .TH TIME 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 time \- get time in seconds
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <time.h>
Signature · 1 line
2.33.0
#28 lore raw

PATCH 29/45 tee.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/tee.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/tee.2 +3 -0
index d2ceef331..11d6281d4 100644
@@ -26,6 +26,9 @@
 .TH TEE 2 2020-06-09 "Linux" "Linux Programmer's Manual"
 .SH NAME
 tee \- duplicating pipe content
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
Signature · 1 line
2.33.0
#29 lore raw

PATCH 30/45 syslog.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/syslog.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/syslog.2 +3 -0
index 46928df49..78a1e2335 100644
@@ -33,6 +33,9 @@
 .SH NAME
 syslog, klogctl \- read and/or clear kernel message ring buffer;
 set console_loglevel
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <sys/klog.h>" "        /* Definition of " SYSLOG_* " constants */"
Signature · 1 line
2.33.0
#30 lore raw

PATCH 31/45 sysinfo.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/sysinfo.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/sysinfo.2 +3 -0
index a45211cd3..09e02bec2 100644
@@ -35,6 +35,9 @@
 .TH SYSINFO 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 sysinfo \- return system information
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/sysinfo.h>
Signature · 1 line
2.33.0
#31 lore raw

PATCH 32/45 syscall.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/syscall.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/syscall.2 +3 -0
index abdf1c702..96a200ce9 100644
@@ -42,6 +42,9 @@
 .TH SYSCALL 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 syscall \- indirect system call
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
Signature · 1 line
2.33.0
#32 lore raw

PATCH 33/45 sync_file_range.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/sync_file_range.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/sync_file_range.2 +3 -0
index e01a9f9bb..b613dc3b8 100644
@@ -30,6 +30,9 @@
 .TH SYNC_FILE_RANGE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 sync_file_range \- sync a file segment with disk
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
Signature · 1 line
2.33.0
#33 lore raw

PATCH 34/45 sync.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/sync.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/sync.2 +3 -0
index 0fa39ae71..a282b1802 100644
@@ -36,6 +36,9 @@
 .TH SYNC 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 sync, syncfs \- commit filesystem caches to disk
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#34 lore raw

PATCH 35/45 symlink.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/symlink.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/symlink.2 +3 -0
index 6c929101c..8b05fc081 100644
@@ -33,6 +33,9 @@
 .TH SYMLINK 2 2021-08-27 "Linux" "Linux Programmer's Manual"
 .SH NAME
 symlink, symlinkat \- make a new name for a file
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <unistd.h>
Signature · 1 line
2.33.0
#35 lore raw

PATCH 36/45 swapon.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/swapon.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/swapon.2 +3 -0
index 07d5fe86c..ffa3892d3 100644
@@ -42,6 +42,9 @@
 .TH SWAPON 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 swapon, swapoff \- start/stop swapping to file/device
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/swap.h>
Signature · 1 line
2.33.0
#36 lore raw

PATCH 37/45 subpage_prot.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/subpage_prot.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/subpage_prot.2 +3 -0
index 91bb789e1..f379a6297 100644
@@ -30,6 +30,9 @@
 .TH SUBPAGE_PROT 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 subpage_prot \- define a subpage protection for an address range
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
Signature · 1 line
2.33.0
#37 lore raw

PATCH 38/45 statx.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/statx.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/statx.2 +3 -0
index 04b3e5075..670264cda 100644
@@ -30,6 +30,9 @@
 .TH STATX 2 2021-08-27 "Linux" "Linux Programmer's Manual"
 .SH NAME
 statx \- get file status (extended)
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <fcntl.h>           " "/* Definition of " AT_* " constants */"
Signature · 1 line
2.33.0
#38 lore raw

PATCH 39/45 stat.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/stat.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/stat.2 +3 -0
index 016c1f47d..7def2d683 100644
@@ -39,6 +39,9 @@
 .TH STAT 2 2021-08-27 "Linux" "Linux Programmer's Manual"
 .SH NAME
 stat, fstat, lstat, fstatat \- get file status
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/stat.h>
Signature · 1 line
2.33.0
#39 lore raw

PATCH 40/45 spu_run.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/spu_run.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/spu_run.2 +3 -0
index d5fdc2280..607abaac6 100644
@@ -26,6 +26,9 @@
 .TH SPU_RUN 2 2021-03-22 Linux "Linux Programmer's Manual"
 .SH NAME
 spu_run \- execute an SPU context
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <sys/spu.h>" "          /* Definition of " SPU_* " constants */"
Signature · 1 line
2.33.0
#40 lore raw

PATCH 41/45 spu_create.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/spu_create.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/spu_create.2 +3 -0
index 746a86ed6..1810e94db 100644
@@ -25,6 +25,9 @@
 .TH SPU_CREATE 2 2021-03-22 Linux "Linux Programmer's Manual"
 .SH NAME
 spu_create \- create a new spu context
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <sys/spu.h>" "          /* Definition of " SPU_* " constants */"
Signature · 1 line
2.33.0
#41 lore raw

PATCH 42/45 splice.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/splice.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/splice.2 +3 -0
index ddb0b2d53..d71a1ef6d 100644
@@ -26,6 +26,9 @@
 .TH SPLICE 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 splice \- splice data to/from a pipe
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
Signature · 1 line
2.33.0
#42 lore raw

PATCH 43/45 socketpair.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/socketpair.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/socketpair.2 +3 -0
index a799babda..c07c51fa2 100644
@@ -42,6 +42,9 @@
 .TH SOCKETPAIR 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 socketpair \- create a pair of connected sockets
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <sys/socket.h>
Signature · 1 line
2.33.0
#43 lore raw

PATCH 44/45 socketcall.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/socketcall.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/socketcall.2 +3 -0
index b39f61039..55bf75ba3 100644
@@ -25,6 +25,9 @@
 .TH SOCKETCALL 2 2021-03-22 "Linux" "Linux Programmer's Manual"
 .SH NAME
 socketcall \- socket system calls
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .BR "#include <linux/net.h>" "        /* Definition of " SYS_* " constants */"
Signature · 1 line
2.33.0
#44 lore raw

PATCH 45/45 sigwaitinfo.2: Add LIBRARY section

In reply to Alejandro Colomar
---
 man2/sigwaitinfo.2 | 3 +++
 1 file changed, 3 insertions(+)
man2/sigwaitinfo.2 +3 -0
index 00bc50485..08f318769 100644
@@ -26,6 +26,9 @@
 .SH NAME
 sigwaitinfo, sigtimedwait, rt_sigtimedwait \- synchronously wait
 for queued signals
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " -lc )
 .SH SYNOPSIS
 .nf
 .B #include <signal.h>
Signature · 1 line
2.33.0
#45 lore raw
In reply to Alejandro Colomar
Quoted 37 lines · Alejandro Colomar

Alejandro Colomar (45):
_exit.2: Add LIBRARY section
keyctl.2: Add LIBRARY section

request_key.2: Add LIBRARY section
write.2: Add LIBRARY section
wait4.2: Add LIBRARY section
wait.2: Add LIBRARY section
vmsplice.2: Add LIBRARY section
vm86.2: Add LIBRARY section
vhangup.2: Add LIBRARY section
vfork.2: Add LIBRARY section
utimensat.2: Add LIBRARY section
utime.2: Add LIBRARY section
ustat.2: Add LIBRARY section
userfaultfd.2: Add LIBRARY section
unshare.2: Add LIBRARY section
uname.2: Add LIBRARY section
umount.2: Add LIBRARY section
tkill.2: Add LIBRARY section
unlink.2: Add LIBRARY section
umask.2: Add LIBRARY section
truncate.2: Add LIBRARY section
timer_getoverrun.2: Add LIBRARY section
timerfd_create.2: Add LIBRARY section
timer_delete.2: Add LIBRARY section
timer_create.2: Add LIBRARY section
time.2: Add LIBRARY section
tee.2: Add LIBRARY section
syslog.2: Add LIBRARY section
sysinfo.2: Add LIBRARY section
syscall.2: Add LIBRARY section
sync_file_range.2: Add LIBRARY section
sync.2: Add LIBRARY section
symlink.2: Add LIBRARY section
swapon.2: Add LIBRARY section
subpage_prot.2: Add LIBRARY section

Quoted 8 lines

statx.2: Add LIBRARY section
stat.2: Add LIBRARY section
spu_run.2: Add LIBRARY section
spu_create.2: Add LIBRARY section
splice.2: Add LIBRARY section
socketpair.2: Add LIBRARY section
socketcall.2: Add LIBRARY section
sigwaitinfo.2: Add LIBRARY section

I'm not sure about these, my understanding is that the primary purpose of section 2 is syscalls, userspace-kernel interface, and not their libc wrappers. Even intro(2) states that it is Linux-specific:
“Section 2 of the manual describes the Linux system calls. A system call is an entry point into the Linux kernel.” Tying it to libc feels like a bit of a stretch, even though it is the exceedingly common interface for invoking them.

Signature · 3 lines
Eugene Syromyatnikov
mailto:[email protected]
xmpp:esyr@jabber.{ru|org}
#46 lore raw

Hi Eugene,

Quoted 5 lines · Eugene Syromyatnikov
Quoted 3 lines · Alejandro Colomar

Alejandro Colomar (45):
_exit.2: Add LIBRARY section
keyctl.2: Add LIBRARY section

...

Quoted 11 lines
Quoted 2 lines

socketcall.2: Add LIBRARY section
sigwaitinfo.2: Add LIBRARY section

I'm not sure about these, my understanding is that the primary purpose of section 2 is syscalls, userspace-kernel interface, and not their libc wrappers. Even intro(2) states that it is Linux-specific:
“Section 2 of the manual describes the Linux system calls. A system call is an entry point into the Linux kernel.” Tying it to libc feels like a bit of a stretch, even though it is the exceedingly common interface for invoking them.

Thanks for pointing that out. I had some doubts about this in the beginning. I started writing something like "Linux kernel - GNU C library" meaning that it's not only a thing of glibc but also the kernel. But no one replied my RFCs... :/

In the end I simplified it to Standard C library (as FreeBSD does), because I wasn't convinced of the syntax I had used. And also, since a man page being in section 2 already implies that it is implemented in the kernel, I didn't want to be repetitive, and just point what the user has to link to to make a program work.

There are some system calls that are wrapped by other libraries, such as keyctl(2) by libkeyutils, and those get a different LIBRARY (you can check patch 02/45).

But if you think there's a better way to express this, please propose it.

Thanks!

Alex.

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#47 lore raw
Quoted 22 lines · Alejandro Colomar (man-pages)

Hi Eugene,

Quoted 5 lines · Eugene Syromyatnikov
Quoted 3 lines · Alejandro Colomar

Alejandro Colomar (45):
_exit.2: Add LIBRARY section
keyctl.2: Add LIBRARY section

...

Quoted 11 lines
Quoted 2 lines

socketcall.2: Add LIBRARY section
sigwaitinfo.2: Add LIBRARY section

I'm not sure about these, my understanding is that the primary purpose of section 2 is syscalls, userspace-kernel interface, and not their libc wrappers. Even intro(2) states that it is Linux-specific:
“Section 2 of the manual describes the Linux system calls. A system call is an entry point into the Linux kernel.” Tying it to libc feels like a bit of a stretch, even though it is the exceedingly common interface for invoking them.

Quoted 4 lines

Thanks for pointing that out. I had some doubts about this in the beginning. I started writing something like "Linux kernel - GNU C library" meaning that it's not only a thing of glibc but also the kernel. But no one replied my RFCs... :/

Apologies on my part—I read the list only occasionally.

Quoted 1 line

In the end I simplified it to Standard C library (as FreeBSD does),

The issue here is that FreeBSD has a bit of a different approach, where libc and kernel are parts of the whole operating systems and quite tied together, so there's no (assumption about) multiple libc implementations like in Linux (it is possible, but meaningless—libc is a part of OS already, after all), so calling syscalls without libc is much more unusual than in Linux (where it is sometimes even required, for example, to do weird stuff on x32, for which libc, and even its syscall() implementation, could stand in the way).

Quoted 10 lines

because I wasn't convinced of the syntax I had used. And also, since a man page being in section 2 already implies that it is implemented in the kernel, I didn't want to be repetitive, and just point what the user has to link to to make a program work.

There are some system calls that are wrapped by other libraries, such as keyctl(2) by libkeyutils, and those get a different LIBRARY (you can check patch 02/45).

But if you think there's a better way to express this, please propose it.

After some thinking, I think it's okay; I re-read some “C library/kernel differences”, and those are clearly written with the assumption that the described call is invoked via its libc wrapper; notes about the absence of a glibc wrapper for some other syscalls hint at the same expectation.

Quoted 9 lines

Thanks!

Alex.

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

Signature · 3 lines
Eugene Syromyatnikov
mailto:[email protected]
xmpp:esyr@jabber.{ru|org}
#48 lore raw

Hi, Eugene!

Quoted 24 lines · Eugene Syromyatnikov
Quoted 22 lines · Alejandro Colomar (man-pages)

Hi Eugene,

Quoted 5 lines · Eugene Syromyatnikov
Quoted 3 lines · Alejandro Colomar

Alejandro Colomar (45):
_exit.2: Add LIBRARY section
keyctl.2: Add LIBRARY section

...

Quoted 11 lines
Quoted 2 lines

socketcall.2: Add LIBRARY section
sigwaitinfo.2: Add LIBRARY section

I'm not sure about these, my understanding is that the primary purpose of section 2 is syscalls, userspace-kernel interface, and not their libc wrappers. Even intro(2) states that it is Linux-specific:
“Section 2 of the manual describes the Linux system calls. A system call is an entry point into the Linux kernel.” Tying it to libc feels like a bit of a stretch, even though it is the exceedingly common interface for invoking them.

Quoted 6 lines
Quoted 4 lines

Thanks for pointing that out. I had some doubts about this in the beginning. I started writing something like "Linux kernel - GNU C library" meaning that it's not only a thing of glibc but also the kernel. But no one replied my RFCs... :/

Apologies on my part—I read the list only occasionally.

No need to apologize. We're doing this for free :)

Quoted 11 lines
Quoted 2 lines

In the end I simplified it to Standard C library (as FreeBSD does),

The issue here is that FreeBSD has a bit of a different approach, where libc and kernel are parts of the whole operating systems and quite tied together, so there's no (assumption about) multiple libc implementations like in Linux (it is possible, but meaningless—libc is a part of OS already, after all), so calling syscalls without libc is much more unusual than in Linux (where it is sometimes even required, for example, to do weird stuff on x32, for which libc, and even its syscall() implementation, could stand in the way).

Yes, that was my first thought...

Quoted 10 lines
Quoted 10 lines

because I wasn't convinced of the syntax I had used. And also, since a man page being in section 2 already implies that it is implemented in the kernel, I didn't want to be repetitive, and just point what the user has to link to to make a program work.

There are some system calls that are wrapped by other libraries, such as keyctl(2) by libkeyutils, and those get a different LIBRARY (you can check patch 02/45).

Quoted 7 lines
Quoted 1 line

But if you think there's a better way to express this, please propose it.

After some thinking, I think it's okay; I re-read some “C library/kernel differences”, and those are clearly written with the assumption that the described call is invoked via its libc wrapper; notes about the absence of a glibc wrapper for some other syscalls hint at the same expectation.

but as you say, man-pages already assume use of the glibc (or other libraries') wrappers almost everywhere; and I think doing otherwise would overcomplicate it.

Thanks for reviewing my patches!!

Cheers,

Alex

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#49 lore raw
In reply to Alejandro Colomar

Hi Alex,

More 2 cents from me :).

Quoted 61 lines · Alejandro Colomar

Hi Michael,

Here's a first patch set adding a new LIBRARY section to man2 and man3 pages (I started with man2).

It is based on (mostly cloned from) FreeBSD's man pages, as I liked that section from them.

It normalizes the information we had in comments in
NOTES or SYNOPSIS or DESCRIPTION.
Or in most pages we didn't even have it, as we assume that 'cc' already handles '-lc' by deafult.

Patch 20/45 was removed on purpose due to a mistake.

Cheers,

Alex

Alejandro Colomar (45):
_exit.2: Add LIBRARY section
keyctl.2: Add LIBRARY section
gamma.3: Add LIBRARY section
request_key.2: Add LIBRARY section
write.2: Add LIBRARY section
wait4.2: Add LIBRARY section
wait.2: Add LIBRARY section
vmsplice.2: Add LIBRARY section
vm86.2: Add LIBRARY section
vhangup.2: Add LIBRARY section
vfork.2: Add LIBRARY section
utimensat.2: Add LIBRARY section
utime.2: Add LIBRARY section
ustat.2: Add LIBRARY section
userfaultfd.2: Add LIBRARY section
unshare.2: Add LIBRARY section
uname.2: Add LIBRARY section
umount.2: Add LIBRARY section
tkill.2: Add LIBRARY section
unlink.2: Add LIBRARY section
umask.2: Add LIBRARY section
truncate.2: Add LIBRARY section
timer_getoverrun.2: Add LIBRARY section
timerfd_create.2: Add LIBRARY section
timer_delete.2: Add LIBRARY section
timer_create.2: Add LIBRARY section
time.2: Add LIBRARY section
tee.2: Add LIBRARY section
syslog.2: Add LIBRARY section
sysinfo.2: Add LIBRARY section
syscall.2: Add LIBRARY section
sync_file_range.2: Add LIBRARY section
sync.2: Add LIBRARY section
symlink.2: Add LIBRARY section
swapon.2: Add LIBRARY section
subpage_prot.2: Add LIBRARY section

Quoted 8 lines

statx.2: Add LIBRARY section
stat.2: Add LIBRARY section
spu_run.2: Add LIBRARY section
spu_create.2: Add LIBRARY section
splice.2: Add LIBRARY section
socketpair.2: Add LIBRARY section
socketcall.2: Add LIBRARY section
sigwaitinfo.2: Add LIBRARY section

Not sure what value "libc, -lc" to the man pages. I think having a standardized section for functions that require libraries other than libc is fine, so you remember when you need -lm or -lrt (although IIRC recently a few of these were folded in libc, at least for glibc). But -lc feels kind of redundant. Does that mean you need to add -lc in your Makefile? Some people might interpret it as such.

I think no library section = no special library required might be clearer.

Also, on FreeBSD it's quite obvious you're talking about THE library. But on Linux, you have glibc, musl libc, diet libc... Is the plan to document requirements for all of these? E.g link with -lm on musl libc, no special flags on glibc..?

Thanks,
Stefan.

Quoted 52 lines
 man2/_exit.2            |  3 +++
 man2/keyctl.2           |  9 +++++++--
 man2/request_key.2      | 18 ++++--------------
 man2/sigwaitinfo.2      |  3 +++
 man2/socketcall.2       |  3 +++
 man2/socketpair.2       |  3 +++
 man2/splice.2           |  3 +++
 man2/spu_create.2       |  3 +++
 man2/spu_run.2          |  3 +++
 man2/stat.2             |  3 +++
 man2/statx.2            |  3 +++
 man2/subpage_prot.2     |  3 +++
 man2/swapon.2           |  3 +++
 man2/symlink.2          |  3 +++
 man2/sync.2             |  3 +++
 man2/sync_file_range.2  |  3 +++
 man2/syscall.2          |  3 +++
 man2/sysinfo.2          |  3 +++
 man2/syslog.2           |  3 +++
 man2/tee.2              |  3 +++
 man2/time.2             |  3 +++
 man2/timer_create.2     |  5 +++--
 man2/timer_delete.2     |  5 +++--
 man2/timer_getoverrun.2 |  5 +++--
 man2/timer_settime.2    |  5 +++--
 man2/timerfd_create.2   |  3 +++
 man2/times.2            |  3 +++
 man2/tkill.2            |  3 +++
 man2/truncate.2         |  3 +++
 man2/umask.2            |  3 +++
 man2/umount.2           |  3 +++
 man2/uname.2            |  3 +++
 man2/unlink.2           |  3 +++
 man2/unshare.2          |  3 +++
 man2/userfaultfd.2      |  3 +++
 man2/ustat.2            |  3 +++
 man2/utime.2            |  3 +++
 man2/utimensat.2        |  3 +++
 man2/vfork.2            |  3 +++
 man2/vhangup.2          |  3 +++
 man2/vm86.2             |  3 +++
 man2/vmsplice.2         |  3 +++
 man2/wait.2             |  3 +++
 man2/wait4.2            |  3 +++
 man2/write.2            |  3 +++
 man3/gamma.3            |  5 +++--
 46 files changed, 143 insertions(+), 26 deletions(-)

--
2.33.0

#50 lore raw
Quoted 6 lines · Stefan Puiu

Not sure what value "libc, -lc" to the man pages. I think having a standardized section for functions that require libraries other than libc is fine, so you remember when you need -lm or -lrt (although IIRC recently a few of these were folded in libc, at least for glibc). But -lc feels kind of redundant. Does that mean you need to add -lc in your Makefile? Some people might interpret it as such.

Isn't it covered by the

Quoted 6 lines

I think no library section = no special library required might be clearer.

Also, on FreeBSD it's quite obvious you're talking about THE library. But on Linux, you have glibc, musl libc, diet libc... Is the plan to document requirements for all of these? E.g link with -lm on musl libc, no special flags on glibc..?

I think, the split is codified in the standards[1][2][3][4][5] (so, -lm/-lrt are expected to be supported by the compiler, per my understanding, and providing the necessary -l* option will always work, because it's codified in C standard, contrary to not providing one) and the fact that glibc provides libm/librt symbols in -lc is more akin to a bit of convenience (for application or glibc developers, not sure which ones), and not something one should rely upon.

[1] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libc.html
[2] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libm.html
[3] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libpthread.html
[4] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libdl.html
[5] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/librt.html

Signature · 3 lines
Eugene Syromyatnikov
mailto:[email protected]
xmpp:esyr@jabber.{ru|org}
#51 lore raw
Quoted 1 line · Eugene Syromyatnikov

Isn't it covered by the

"by the gcc manual in the -nostdlib option description"

Signature · 3 lines
Eugene Syromyatnikov
mailto:[email protected]
xmpp:esyr@jabber.{ru|org}
#52 lore raw
In reply to Eugene Syromyatnikov

Hi, Eugene!

Quoted 9 lines · Eugene Syromyatnikov

I think, the split is codified in the standards[1][2][3][4][5] (so, -lm/-lrt are expected to be supported by the compiler, per my understanding, and providing the necessary -l* option will always work, because it's codified in C standard, contrary to not providing one) and the fact that glibc provides libm/librt symbols in -lc is more akin to a bit of convenience (for application or glibc developers, not sure which ones), and not something one should rely upon.

Thanks for the references!

With those, I'll do a second round of changes (after all of the man[23] pages are changed to use LIBRARY, which is the first round), checking that the info in LIBRARY is accurate, and possibly documenting also the standard if we were documenting a glibc extension. Now I'll assume the man pages are correct, and only move around the info.

Cheers,

Alex

Quoted 6 lines

[1] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libc.html
[2] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libm.html
[3] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libpthread.html
[4] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libdl.html
[5] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/librt.html

Signature · 3 lines
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
#53 lore raw
In reply to Eugene Syromyatnikov

Hi Eugene,

Quoted 2 lines · Eugene Syromyatnikov

On Tue, Sep 14, 2021 at 2:53 AM Stefan Puiu <[email protected]> wrote:

[...]

Quoted 8 lines
Quoted 4 lines

Also, on FreeBSD it's quite obvious you're talking about THE library. But on Linux, you have glibc, musl libc, diet libc... Is the plan to document requirements for all of these? E.g link with -lm on musl libc, no special flags on glibc..?

I think, the split is codified in the standards[1][2][3][4][5] (so, -lm/-lrt are expected to be supported by the compiler, per my understanding, and providing the necessary -l* option will always

I think libc provides libm/librt as library files; the linker just finds them in /usr/lib, /usr/lib64 or whatever other folder they are installed into. So I would say it's not "supported by the compiler" technically, but by libc.

Quoted 5 lines

work, because it's codified in C standard, contrary to not providing one) and the fact that glibc provides libm/librt symbols in -lc is more akin to a bit of convenience (for application or glibc developers, not sure which ones), and not something one should rely upon.

That's assuming that the libraries adhere to those standards, I'm not sure if that's the situation. There are also functions like backtrace
(https://man7.org/linux/man-pages/man3/backtrace.3.html) which are extensions, and some might not be implemented in other libraries besides glibc. Maybe the Linux man-pages should mention glibc explicitly instead of a rather ambiguous libc? And then details about the other libs can be added, wherever they differ.

Thanks,
Stefan.

Quoted 11 lines

[1] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libc.html
[2] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libm.html
[3] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libpthread.html
[4] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libdl.html
[5] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/librt.html

--
Eugene Syromyatnikov
mailto:[email protected]
xmpp:esyr@jabber.{ru|org}

#54 lore raw
In reply to Eugene Syromyatnikov

* Eugene Syromyatnikov:

Quoted 5 lines

I think, the split is codified in the standards[1][2][3][4][5] (so, -lm/-lrt are expected to be supported by the compiler, per my understanding, and providing the necessary -l* option will always work, because it's codified in C standard, contrary to not providing one)

The C standard does not specify compiler invocations.

POSIX specifies some of these libraries and says that you have to link with, e.g., -lm if you use math functions. It also says that the same functions may be available without -lm.

But some of these libraries are not in POSIX. dlopen, for example, should be usable without -ldl according to POSIX, but in glibc before 2.34, it is not.

And yes, in glibc 2.34, there are libdl.a etc. files, so that the old -ldl etc. options still work.

Thanks,
Florian