Add LIBRARY section (based on FreeBSD manual pages)
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
PATCH 1/45 _exit.2: Add LIBRARY section
--- man2/_exit.2 | 3 +++ 1 file changed, 3 insertions(+)
man2/_exit.2 +3 -0
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
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
@@ -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
Quoted 37 lines · Alejandro Colomar
Alejandro Colomar (45):
_exit.2: Add LIBRARY section
keyctl.2: Add LIBRARY sectionrequest_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}
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 sectionI'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/
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 sectionI'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}
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 sectionI'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/
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
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}
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}
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/
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}
* 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