Various pages: Remove unused <sys/types.h>
PATCH 1/1 Various pages: Remove unused <sys/types.h>
The manual pages are already inconsistent in which headers need to be included. Right now, not all of the types used by a function have their required header included in the SYNOPSIS.
If we were to add the headers required by all of the types used by functions, the SYNOPSIS would grow too much. Not only it would grow too much, but the information there would be less precise.
Having system_data_types(7) document each type with all the information about required includes is much more precise, and the info is centralized so that it's much easier to maintain.
So let's document only the include required for the function prototype, and also the ones required for the macros needed to call the function.
<sys/types.h> only defines types, not functions or constants, so it doesn't belong to man[23] (function) pages at all.
I ignore if some old systems had headers that required you to include <sys/types.h> *before* them (incomplete headers), but if so, those implementations would be broken, and those headers should probably provide some kind of warning. I hope this is not the case.
--- man2/accept.2 | 7 ------- man2/bind.2 | 7 ------- man2/connect.2 | 7 ------- man2/fork.2 | 1 - man2/get_robust_list.2 | 1 - man2/getgid.2 | 1 - man2/getgroups.2 | 1 - man2/getpid.2 | 1 - man2/getsid.2 | 1 - man2/getsockopt.2 | 7 ------- man2/gettid.2 | 1 - man2/getuid.2 | 1 - man2/getxattr.2 | 1 - man2/keyctl.2 | 1 - man2/kill.2 | 1 - man2/listen.2 | 7 ------- man2/listxattr.2 | 1 - man2/llseek.2 | 1 - man2/lseek.2 | 1 - man2/mkdir.2 | 1 - man2/mknod.2 | 1 - man2/modify_ldt.2 | 2 -- man2/mq_getsetattr.2 | 1 - man2/msgctl.2 | 11 ++++------- man2/msgget.2 | 11 ++++------- man2/msgop.2 | 11 ++++------- man2/open.2 | 1 - man2/open_by_handle_at.2 | 1 - man2/openat2.2 | 1 - man2/pidfd_open.2 | 2 -- man2/recv.2 | 1 - man2/removexattr.2 | 1 - man2/request_key.2 | 1 - man2/semctl.2 | 9 +++------ man2/semget.2 | 11 ++++------- man2/semop.2 | 11 ++++------- man2/send.2 | 1 - man2/seteuid.2 | 1 - man2/setgid.2 | 1 - man2/setpgid.2 | 1 - man2/setreuid.2 | 1 - man2/setsid.2 | 1 - man2/setuid.2 | 1 - man2/setxattr.2 | 1 - man2/shmctl.2 | 10 ++++------ man2/socket.2 | 7 ------- man2/socketpair.2 | 7 ------- man2/statx.2 | 1 - man2/vfork.2 | 1 - 49 files changed, 27 insertions(+), 133 deletions(-)
man2/accept.2 +0 -7
@@ -43,7 +43,6 @@ accept, accept4 \- accept a connection on a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int accept(int " sockfd ", struct sockaddr *restrict " addr ,
@@ -319,12 +318,6 @@ of file status flags and always explicitly set all required flags on the socket returned from .BR accept (). .SH NOTES -POSIX.1-2001 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP There may not always be a connection waiting after a .B SIGIO is delivered or
man2/bind.2 +0 -7
@@ -71,7 +71,6 @@ bind \- bind a name to a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int bind(int " sockfd ", const struct sockaddr *" addr ,
@@ -243,12 +242,6 @@ first appeared in 4.2BSD). .\" .B EISDIR .\" UNIX-domain error conditions. .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP For background on the .I socklen_t type, see
man2/connect.2 +0 -7
@@ -69,7 +69,6 @@ connect \- initiate a connection on a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int connect(int " sockfd ", const struct sockaddr *" addr ,
@@ -276,12 +275,6 @@ first appeared in 4.2BSD). .\" It also .\" documents many additional error conditions not described here. .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP For background on the .I socklen_t type, see
man2/fork.2 +0 -1
@@ -41,7 +41,6 @@ fork \- create a child process .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t fork(void);
man2/get_robust_list.2 +0 -1
@@ -33,7 +33,6 @@ get_robust_list, set_robust_list \- get/set list of robust futexes .SH SYNOPSIS .nf .B #include <linux/futex.h> -.B #include <sys/types.h> .B #include <syscall.h> .PP .BI "long get_robust_list(int " pid ", struct robust_list_head **" head_ptr ,
man2/getgid.2 +0 -1
@@ -28,7 +28,6 @@ getgid, getegid \- get group identity .SH SYNOPSIS .nf .B #include <unistd.h> -.B #include <sys/types.h> .PP .B gid_t getgid(void); .B gid_t getegid(void);
man2/getgroups.2 +0 -1
@@ -34,7 +34,6 @@ getgroups, setgroups \- get/set list of supplementary group IDs .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int getgroups(int " size ", gid_t " list []);
man2/getpid.2 +0 -1
@@ -27,7 +27,6 @@ getpid, getppid \- get process identification .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t getpid(void);
man2/getsid.2 +0 -1
@@ -29,7 +29,6 @@ getsid \- get session ID .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "pid_t getsid(pid_t" " pid" );
man2/getsockopt.2 +0 -7
@@ -46,7 +46,6 @@ getsockopt, setsockopt \- get and set options on sockets .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int getsockopt(int " sockfd ", int " level ", int " optname ,
@@ -179,12 +178,6 @@ SVr4, 4.4BSD (these system calls first appeared in 4.2BSD). .\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO .\" options .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP For background on the .I socklen_t type, see
man2/gettid.2 +0 -1
@@ -30,7 +30,6 @@ gettid \- get thread identification .nf .B #define _GNU_SOURCE .B #include <unistd.h> -.B #include <sys/types.h> .PP .B pid_t gettid(void); .fi
man2/getuid.2 +0 -1
@@ -29,7 +29,6 @@ getuid, geteuid \- get user identity .SH SYNOPSIS .nf .B #include <unistd.h> -.B #include <sys/types.h> .PP .B uid_t getuid(void); .B uid_t geteuid(void);
man2/getxattr.2 +0 -1
@@ -28,7 +28,6 @@ getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "ssize_t getxattr(const char *" path ", const char *" name ,
man2/keyctl.2 +0 -1
@@ -30,7 +30,6 @@ keyctl \- manipulate the kernel's key management facility .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <keyutils.h> .PP .BI "long keyctl(int " operation ", ...);"
man2/kill.2 +0 -1
@@ -46,7 +46,6 @@ kill \- send signal to a process .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <signal.h> .PP .BI "int kill(pid_t " pid ", int " sig );
man2/listen.2 +0 -7
@@ -47,7 +47,6 @@ listen \- listen for connections on a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int listen(int " sockfd ", int " backlog );
@@ -140,12 +139,6 @@ Connections are accepted with .BR accept (2). .RE .PP -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP The behavior of the .I backlog argument on TCP sockets changed with Linux 2.2.
man2/listxattr.2 +0 -1
@@ -29,7 +29,6 @@ listxattr, llistxattr, flistxattr \- list extended attribute names .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "ssize_t listxattr(const char *" path ", char *" list \
man2/llseek.2 +0 -1
@@ -31,7 +31,6 @@ _llseek \- reposition read/write file offset .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int _llseek(unsigned int " fd ", unsigned long " offset_high ,
man2/lseek.2 +0 -1
@@ -48,7 +48,6 @@ lseek \- reposition read/write file offset .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "off_t lseek(int " fd ", off_t " offset ", int " whence );
man2/mkdir.2 +0 -1
@@ -14,7 +14,6 @@ mkdir, mkdirat \- create a directory .SH SYNOPSIS .nf .B #include <sys/stat.h> -.B #include <sys/types.h> .\" .B #include <unistd.h> .PP .BI "int mkdir(const char *" pathname ", mode_t " mode );
man2/mknod.2 +0 -1
@@ -17,7 +17,6 @@ mknod, mknodat \- create a special or ordinary file .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .B #include <unistd.h>
man2/modify_ldt.2 +0 -2
@@ -27,8 +27,6 @@ modify_ldt \- get or set a per-process LDT entry .SH SYNOPSIS .nf -.B #include <sys/types.h> -.PP .BI "int modify_ldt(int " func ", void *" ptr ", unsigned long " bytecount ); .fi .PP
man2/mq_getsetattr.2 +0 -1
@@ -27,7 +27,6 @@ mq_getsetattr \- get/set message queue attributes .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <mqueue.h> .PP .BI "int mq_getsetattr(mqd_t " mqdes ", const struct mq_attr *" newattr ,
man2/msgctl.2 +4 -7
@@ -40,7 +40,6 @@ msgctl \- System V message control operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/msg.h> .PP
@@ -407,17 +406,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4. .\" SVID does not document the EIDRM error condition. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .BR IPC_INFO ,
man2/msgget.2 +4 -7
@@ -37,7 +37,6 @@ msgget \- get a System V message queue identifier .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/msg.h> .PP
@@ -190,17 +189,15 @@ would be exceeded. POSIX.1-2001, POSIX.1-2008, SVr4. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP .B IPC_PRIVATE isn't a flag field but a
man2/msgop.2 +4 -7
@@ -42,7 +42,6 @@ msgrcv, msgsnd \- System V message queue operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/msg.h> .PP
@@ -482,17 +481,15 @@ their definitions can be obtained by defining the feature test macro. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .I msgp
man2/open.2 +0 -1
@@ -53,7 +53,6 @@ open, openat, creat \- open and possibly create a file .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .PP
man2/open_by_handle_at.2 +0 -1
@@ -29,7 +29,6 @@ for a pathname and open file via a handle .SH SYNOPSIS .nf .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .PP
man2/openat2.2 +0 -1
@@ -26,7 +26,6 @@ openat2 \- open and possibly create a file (extended) .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .B #include <linux/openat2.h>
man2/pidfd_open.2 +0 -2
@@ -27,8 +27,6 @@ pidfd_open \- obtain a file descriptor that refers to a process .SH SYNOPSIS .nf -.B #include <sys/types.h> -.PP .BI "int pidfd_open(pid_t " pid ", unsigned int " flags ); .fi .PP
man2/recv.2 +0 -1
@@ -43,7 +43,6 @@ recv, recvfrom, recvmsg \- receive a message from a socket .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/socket.h> .PP .BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags );
man2/removexattr.2 +0 -1
@@ -28,7 +28,6 @@ removexattr, lremovexattr, fremovexattr \- remove an extended attribute .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "int removexattr(const char\ *" path ", const char\ *" name );
man2/request_key.2 +0 -1
@@ -14,7 +14,6 @@ request_key \- request a key from the kernel's key management facility .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <keyutils.h> .PP .BI "key_serial_t request_key(const char *" type ", const char *" description ,
man2/semctl.2 +3 -6
@@ -44,7 +44,6 @@ semctl \- System V semaphore control operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/sem.h> .PP
@@ -538,15 +537,13 @@ but, since Linux 2.4, the field has the type .IR "unsigned\ long" . .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document .\" the inclusion of these header files. .PP
man2/semget.2 +4 -7
@@ -39,7 +39,6 @@ semget \- get a System V semaphore set identifier .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/sem.h> .fi
@@ -221,17 +220,15 @@ SVr4, POSIX.1-2001. .\" ERANGE, EFAULT. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP .B IPC_PRIVATE isn't a flag field but a
man2/semop.2 +4 -7
@@ -37,7 +37,6 @@ semop, semtimedop \- System V semaphore operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/sem.h> .PP
@@ -385,17 +384,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4. .\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .I sem_undo
man2/send.2 +0 -1
@@ -42,7 +42,6 @@ send, sendto, sendmsg \- send a message on a socket .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/socket.h> .PP .BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \
man2/seteuid.2 +0 -1
@@ -31,7 +31,6 @@ seteuid, setegid \- set effective user or group ID .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int seteuid(uid_t " euid );
man2/setgid.2 +0 -1
@@ -32,7 +32,6 @@ setgid \- set group identity .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setgid(gid_t " gid );
man2/setpgid.2 +0 -1
@@ -50,7 +50,6 @@ setpgid, getpgid, setpgrp, getpgrp \- set/get process group .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setpgid(pid_t " pid ", pid_t " pgid );
man2/setreuid.2 +0 -1
@@ -48,7 +48,6 @@ setreuid, setregid \- set real and/or effective user or group ID .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setreuid(uid_t " ruid ", uid_t " euid );
man2/setsid.2 +0 -1
@@ -34,7 +34,6 @@ setsid \- creates a session and sets the process group ID .SH SYNOPSIS .nf .ad l -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t setsid(void);
man2/setuid.2 +0 -1
@@ -33,7 +33,6 @@ setuid \- set user identity .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setuid(uid_t " uid );
man2/setxattr.2 +0 -1
@@ -28,7 +28,6 @@ setxattr, lsetxattr, fsetxattr \- set an extended attribute value .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "int setxattr(const char\ *" path ", const char\ *" name ,
man2/shmctl.2 +4 -6
@@ -467,17 +467,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4. .\" an EIDRM error condition. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .BR IPC_INFO ,
man2/socket.2 +0 -7
@@ -44,7 +44,6 @@ socket \- create an endpoint for communication .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int socket(int " domain ", int " type ", int " protocol );
@@ -467,12 +466,6 @@ It is generally portable to/from non-BSD systems supporting clones of the BSD socket layer (including System\ V variants). .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP The manifest constants used under 4.x BSD for protocol families are .BR PF_UNIX ,
man2/socketpair.2 +0 -7
@@ -44,7 +44,6 @@ socketpair \- create a pair of connected sockets .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int socketpair(int " domain ", int " type ", int " protocol \
@@ -130,12 +129,6 @@ flags in the .I type argument, as described in .BR socket (2). -.PP -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. .SH SEE ALSO .BR pipe (2), .BR read (2),
man2/statx.2 +0 -1
@@ -32,7 +32,6 @@ statx \- get file status (extended) .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <unistd.h> .BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
man2/vfork.2 +0 -1
@@ -31,7 +31,6 @@ vfork \- create a child process and block parent .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t vfork(void);
Signature · 1 line
2.30.2
Quoted 9 lines · Alejandro Colomar via Libc-alpha
The manual pages are already inconsistent in which headers need to be included. Right now, not all of the types used by a function have their required header included in the SYNOPSIS.
If we were to add the headers required by all of the types used by functions, the SYNOPSIS would grow too much. Not only it would grow too much, but the information there would be less precise.
Quoted 7 lines
Having
system_data_types(7)document each type with all the information about required includes is much more precise, and the info is centralized so that it's much easier to maintain.So let's document only the include required for the function prototype, and also the ones required for the macros needed to call the function.
I endorse this change. For glibc, if the header file containing the function prototype doesn't also provide everything you need to call the function, it's a bug (except for a few cases where the relevant standards prevent us from doing this, e.g. a function that calls vprintf will need the macros in <stdarg.h>, but the C standard specifically forbids <stdio.h> to include <stdarg.h>).
Quoted 4 lines
<
sys/types.h> only defines types, not functions or constants, so it doesn't belong to man[23] (function) pages at all. I ignore if some old systems had headers that required you to include <sys/types.h> *before* them (incomplete headers),
Such systems did exist in the past, but they are too old to worry about nowadays. I don't think it's possible for them to be compliant with POSIX.1-1995, and the examples I know of personally (SunOS 4, for instance) were not even fully compliant with C89.
zw
Hello Zack,
Quoted 16 lines · Zack Weinberg
Quoted 13 lines · Alejandro Colomar via Libc-alpha
The manual pages are already inconsistent in which headers need to be included. Right now, not all of the types used by a function have their required header included in the SYNOPSIS.
If we were to add the headers required by all of the types used by functions, the SYNOPSIS would grow too much. Not only it would grow too much, but the information there would be less precise.
Having
system_data_types(7)document each type with all the information about required includes is much more precise, and the info is centralized so that it's much easier to maintain.
Quoted 5 lines
Quoted 3 lines
So let's document only the include required for the function prototype, and also the ones required for the macros needed to call the function.
I endorse this change.
I agree. Do you want to add an "Acked-by:"?
Thanks,
Michael
Quoted 16 lines
For glibc, if the header file containing the
function prototype doesn't also provide everything you need to call the function, it's a bug (except for a few cases where the relevant standards prevent us from doing this, e.g. a function that calls vprintf will need the macros in <stdarg.h>, but the C standard specifically forbids <stdio.h> to include <stdarg.h>).Quoted 4 lines
<
sys/types.h> only defines types, not functions or constants, so it doesn't belong to man[23] (function) pages at all. I ignore if some old systems had headers that required you to include <sys/types.h> *before* them (incomplete headers),Such systems did exist in the past, but they are too old to worry about nowadays. I don't think it's possible for them to be compliant with POSIX.1-1995, and the examples I know of personally (SunOS 4, for instance) were not even fully compliant with C89.
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/
Quoted 6 lines · Zack Weinberg
I endorse this change. For glibc, if the header file containing the function prototype doesn't also provide everything you need to call the function, it's a bug (except for a few cases where the relevant standards prevent us from doing this, e.g. a function that calls vprintf will need the macros in <
stdarg.h>, but the C standard specifically forbids <stdio.h> to include <stdarg.h>).
And in particular, where older POSIX doesn't require the types used in the function declarations to be defined by a header, but permits them to be defined by virtue of the general *_t reservation in POSIX (that's not in ISO C), it's appropriate to define those types whenever declaring functions that use them, rather than only for the newer POSIX versions that require those types to be defined alongside declaring the functions that use them. (So we could simplify some of the conditionals in unistd.h and remove the "# define uid_t __uid_t" and similar hacks in conform/data/unistd.h-data, for example.)
Signature · 2 lines
Joseph S. Myers [email protected]
Hi Joseph,
Quoted 9 lines · Joseph Myers
Quoted 6 lines · Zack Weinberg
I endorse this change. For glibc, if the header file containing the function prototype doesn't also provide everything you need to call the function, it's a bug (except for a few cases where the relevant standards prevent us from doing this, e.g. a function that calls vprintf will need the macros in <
stdarg.h>, but the C standard specifically forbids <stdio.h> to include <stdarg.h>).
Quoted 9 lines
And in particular, where older POSIX doesn't require the types used in the function declarations to be defined by a header, but permits them to be defined by virtue of the general *_t reservation in POSIX (that's not in ISO C), it's appropriate to define those types whenever declaring functions that use them, rather than only for the newer POSIX versions that require those types to be defined alongside declaring the functions that use them. (So we could simplify some of the conditionals in
unistd.hand remove the "# defineuid_t__uid_t" and similar hacks in conform/data/unistd.h-data, for example.)
If you plan to do that (simplify glibc), maybe the changes I'm doing right now may help you. It'll take me a few months to complete, but I plan to further clean the includes in the SYNOPSIS of man[23], so that only the include that provides the prototype is listed, and if any other headers are needed, they'll have an explicit comment about why.
After that is merged, you should be able to list all the SYNOPSIS of man[23] (check our <scripts/bash_aliases> for that) and see which specify more than one header (and therefore you'll be able to check if a standard requires it, or if it's a bug in glibc). I'll CC you both when I push those changes.
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,
Quoted 19 lines · Alejandro Colomar
The manual pages are already inconsistent in which headers need to be included. Right now, not all of the types used by a function have their required header included in the SYNOPSIS.
If we were to add the headers required by all of the types used by functions, the SYNOPSIS would grow too much. Not only it would grow too much, but the information there would be less precise.
Having
system_data_types(7)document each type with all the information about required includes is much more precise, and the info is centralized so that it's much easier to maintain.So let's document only the include required for the function prototype, and also the ones required for the macros needed to call the function.
<
sys/types.h> only defines types, not functions or constants, so it doesn't belong to man[23] (function) pages at all.
Quoted 7 lines
I ignore if some old systems had headers that required you to include <
sys/types.h> *before* them (incomplete headers), but if so, those implementations would be broken, and those headers should probably provide some kind of warning. I hope this is not the case.Signed-off-by Alejandro Colomar <[email protected]>
If I recall correctly, I had a conversation about this topic with the previous maintainer, who pointed out that the need to include <sys/types.h> was (then) still quite current on various implementations. But it is (by now) 20 years since POSIX.1-2001/SUSv3 dropped the requirement to include <sys/types.h> when using various APIs, so this patch seems well past due, and I have applied it (with an Acked-by from Zack).
Cheers,
Michael
Quoted 877 lines
--- man2/accept.2 | 7 ------- man2/bind.2 | 7 ------- man2/connect.2 | 7 ------- man2/fork.2 | 1 - man2/get_robust_list.2 | 1 - man2/getgid.2 | 1 - man2/getgroups.2 | 1 - man2/getpid.2 | 1 - man2/getsid.2 | 1 - man2/getsockopt.2 | 7 ------- man2/gettid.2 | 1 - man2/getuid.2 | 1 - man2/getxattr.2 | 1 - man2/keyctl.2 | 1 - man2/kill.2 | 1 - man2/listen.2 | 7 ------- man2/listxattr.2 | 1 - man2/llseek.2 | 1 - man2/lseek.2 | 1 - man2/mkdir.2 | 1 - man2/mknod.2 | 1 - man2/modify_ldt.2 | 2 -- man2/mq_getsetattr.2 | 1 - man2/msgctl.2 | 11 ++++------- man2/msgget.2 | 11 ++++------- man2/msgop.2 | 11 ++++------- man2/open.2 | 1 - man2/open_by_handle_at.2 | 1 - man2/openat2.2 | 1 - man2/pidfd_open.2 | 2 -- man2/recv.2 | 1 - man2/removexattr.2 | 1 - man2/request_key.2 | 1 - man2/semctl.2 | 9 +++------ man2/semget.2 | 11 ++++------- man2/semop.2 | 11 ++++------- man2/send.2 | 1 - man2/seteuid.2 | 1 - man2/setgid.2 | 1 - man2/setpgid.2 | 1 - man2/setreuid.2 | 1 - man2/setsid.2 | 1 - man2/setuid.2 | 1 - man2/setxattr.2 | 1 - man2/shmctl.2 | 10 ++++------ man2/socket.2 | 7 ------- man2/socketpair.2 | 7 ------- man2/statx.2 | 1 - man2/vfork.2 | 1 - 49 files changed, 27 insertions(+), 133 deletions(-)man2/accept.2 +0
-7@@ -43,7 +43,6 @@ accept, accept4 \- accept a connection on a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int accept(int " sockfd ", struct sockaddr *restrict " addr ,@@ -319,12 +318,6 @@ of file status flags and always explicitly set all required flags on the socket returned from .BR accept (). .SH NOTES -POSIX.1-2001 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP There may not always be a connection waiting after a .B SIGIO is delivered orman2/bind.2 +0
-7@@ -71,7 +71,6 @@ bind \- bind a name to a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int bind(int " sockfd ", const struct sockaddr *" addr ,@@ -243,12 +242,6 @@ first appeared in 4.2BSD). .\" .B EISDIR .\" UNIX-domain error conditions. .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP For background on the .I socklen_t type, seeman2/connect.2 +0
-7@@ -69,7 +69,6 @@ connect \- initiate a connection on a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int connect(int " sockfd ", const struct sockaddr *" addr ,@@ -276,12 +275,6 @@ first appeared in 4.2BSD). .\" It also .\" documents many additional error conditions not described here. .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP For background on the .I socklen_t type, seeman2/fork.2 +0
-1@@ -41,7 +41,6 @@ fork \- create a child process .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t fork(void);man2/get_robust_list.2 +0
-1@@ -33,7 +33,6 @@ get_robust_list, set_robust_list \- get/set list of robust futexes .SH SYNOPSIS .nf .B #include <linux/futex.h> -.B #include <sys/types.h> .B #include <syscall.h> .PP .BI "long get_robust_list(int " pid ", struct robust_list_head **" head_ptr ,man2/getgid.2 +0
-1@@ -28,7 +28,6 @@ getgid, getegid \- get group identity .SH SYNOPSIS .nf .B #include <unistd.h> -.B #include <sys/types.h> .PP .B gid_t getgid(void); .B gid_t getegid(void);man2/getgroups.2 +0
-1@@ -34,7 +34,6 @@ getgroups, setgroups \- get/set list of supplementary group IDs .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int getgroups(int " size ", gid_t " list []);man2/getpid.2 +0
-1@@ -27,7 +27,6 @@ getpid, getppid \- get process identification .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t getpid(void);man2/getsid.2 +0
-1@@ -29,7 +29,6 @@ getsid \- get session ID .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "pid_t getsid(pid_t" " pid" );man2/getsockopt.2 +0
-7@@ -46,7 +46,6 @@ getsockopt, setsockopt \- get and set options on sockets .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int getsockopt(int " sockfd ", int " level ", int " optname ,@@ -179,12 +178,6 @@ SVr4, 4.4BSD (these system calls first appeared in 4.2BSD). .\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO .\" options .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP For background on the .I socklen_t type, seeman2/gettid.2 +0
-1@@ -30,7 +30,6 @@ gettid \- get thread identification .nf .B #define _GNU_SOURCE .B #include <unistd.h> -.B #include <sys/types.h> .PP .B pid_t gettid(void); .fiman2/getuid.2 +0
-1@@ -29,7 +29,6 @@ getuid, geteuid \- get user identity .SH SYNOPSIS .nf .B #include <unistd.h> -.B #include <sys/types.h> .PP .B uid_t getuid(void); .B uid_t geteuid(void);man2/getxattr.2 +0
-1@@ -28,7 +28,6 @@ getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "ssize_t getxattr(const char *" path ", const char *" name ,man2/keyctl.2 +0
-1@@ -30,7 +30,6 @@ keyctl \- manipulate the kernel's key management facility .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <keyutils.h> .PP .BI "long keyctl(int " operation ", ...);"man2/kill.2 +0
-1@@ -46,7 +46,6 @@ kill \- send signal to a process .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <signal.h> .PP .BI "int kill(pid_t " pid ", int " sig );man2/listen.2 +0
-7@@ -47,7 +47,6 @@ listen \- listen for connections on a socket .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int listen(int " sockfd ", int " backlog );@@ -140,12 +139,6 @@ Connections are accepted with .BR accept (2). .RE .PP -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP The behavior of the .I backlog argument on TCP sockets changed with Linux 2.2.man2/listxattr.2 +0
-1@@ -29,7 +29,6 @@ listxattr, llistxattr, flistxattr \- list extended attribute names .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "ssize_t listxattr(const char *" path ", char *" list \man2/llseek.2 +0
-1@@ -31,7 +31,6 @@ _llseek \- reposition read/write file offset .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int _llseek(unsigned int " fd ", unsigned long " offset_high ,man2/lseek.2 +0
-1@@ -48,7 +48,6 @@ lseek \- reposition read/write file offset .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "off_t lseek(int " fd ", off_t " offset ", int " whence );man2/mkdir.2 +0
-1@@ -14,7 +14,6 @@ mkdir, mkdirat \- create a directory .SH SYNOPSIS .nf .B #include <sys/stat.h> -.B #include <sys/types.h> .\" .B #include <unistd.h> .PP .BI "int mkdir(const char *" pathname ", mode_t " mode );man2/mknod.2 +0
-1@@ -17,7 +17,6 @@ mknod, mknodat \- create a special or ordinary file .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .B #include <unistd.h>man2/modify_ldt.2 +0
-2@@ -27,8 +27,6 @@ modify_ldt \- get or set a per-process LDT entry .SH SYNOPSIS .nf -.B #include <sys/types.h> -.PP .BI "int modify_ldt(int " func ", void *" ptr ", unsigned long " bytecount ); .fi .PPman2/mq_getsetattr.2 +0
-1@@ -27,7 +27,6 @@ mq_getsetattr \- get/set message queue attributes .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <mqueue.h> .PP .BI "int mq_getsetattr(mqd_t " mqdes ", const struct mq_attr *" newattr ,man2/msgctl.2 +4
-7@@ -40,7 +40,6 @@ msgctl \- System V message control operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/msg.h> .PP@@ -407,17 +406,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4. .\" SVID does not document the EIDRM error condition. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .BR IPC_INFO ,man2/msgget.2 +4
-7@@ -37,7 +37,6 @@ msgget \- get a System V message queue identifier .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/msg.h> .PP@@ -190,17 +189,15 @@ would be exceeded. POSIX.1-2001, POSIX.1-2008, SVr4. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP .B IPC_PRIVATE isn't a flag field but aman2/msgop.2 +4
-7@@ -42,7 +42,6 @@ msgrcv, msgsnd \- System V message queue operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/msg.h> .PP@@ -482,17 +481,15 @@ their definitions can be obtained by defining the feature test macro. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .I msgpman2/open.2 +0
-1@@ -53,7 +53,6 @@ open, openat, creat \- open and possibly create a file .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .PPman2/open_by_handle_at.2 +0
-1@@ -29,7 +29,6 @@ for a pathname and open file via a handle .SH SYNOPSIS .nf .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .PPman2/openat2.2 +0
-1@@ -26,7 +26,6 @@ openat2 \- open and possibly create a file (extended) .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <fcntl.h> .B #include <linux/openat2.h>man2/pidfd_open.2 +0
-2@@ -27,8 +27,6 @@ pidfd_open \- obtain a file descriptor that refers to a process .SH SYNOPSIS .nf -.B #include <sys/types.h> -.PP .BI "int pidfd_open(pid_t " pid ", unsigned int " flags ); .fi .PPman2/recv.2 +0
-1@@ -43,7 +43,6 @@ recv, recvfrom, recvmsg \- receive a message from a socket .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/socket.h> .PP .BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags );man2/removexattr.2 +0
-1@@ -28,7 +28,6 @@ removexattr, lremovexattr, fremovexattr \- remove an extended attribute .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "int removexattr(const char\ *" path ", const char\ *" name );man2/request_key.2 +0
-1@@ -14,7 +14,6 @@ request_key \- request a key from the kernel's key management facility .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <keyutils.h> .PP .BI "key_serial_t request_key(const char *" type ", const char *" description ,man2/semctl.2 +3
-6@@ -44,7 +44,6 @@ semctl \- System V semaphore control operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/sem.h> .PP@@ -538,15 +537,13 @@ but, since Linux 2.4, the field has the type .IR "unsigned\ long" . .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document .\" the inclusion of these header files. .PPman2/semget.2 +4
-7@@ -39,7 +39,6 @@ semget \- get a System V semaphore set identifier .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/sem.h> .fi@@ -221,17 +220,15 @@ SVr4, POSIX.1-2001. .\" ERANGE, EFAULT. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP .B IPC_PRIVATE isn't a flag field but aman2/semop.2 +4
-7@@ -37,7 +37,6 @@ semop, semtimedop \- System V semaphore operations .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/ipc.h> .B #include <sys/sem.h> .PP@@ -385,17 +384,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4. .\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .I sem_undoman2/send.2 +0
-1@@ -42,7 +42,6 @@ send, sendto, sendmsg \- send a message on a socket .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/socket.h> .PP .BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \man2/seteuid.2 +0
-1@@ -31,7 +31,6 @@ seteuid, setegid \- set effective user or group ID .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int seteuid(uid_t " euid );man2/setgid.2 +0
-1@@ -32,7 +32,6 @@ setgid \- set group identity .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setgid(gid_t " gid );man2/setpgid.2 +0
-1@@ -50,7 +50,6 @@ setpgid, getpgid, setpgrp, getpgrp \- set/get process group .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setpgid(pid_t " pid ", pid_t " pgid );man2/setreuid.2 +0
-1@@ -48,7 +48,6 @@ setreuid, setregid \- set real and/or effective user or group ID .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setreuid(uid_t " ruid ", uid_t " euid );man2/setsid.2 +0
-1@@ -34,7 +34,6 @@ setsid \- creates a session and sets the process group ID .SH SYNOPSIS .nf .ad l -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t setsid(void);man2/setuid.2 +0
-1@@ -33,7 +33,6 @@ setuid \- set user identity .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .BI "int setuid(uid_t " uid );man2/setxattr.2 +0
-1@@ -28,7 +28,6 @@ setxattr, lsetxattr, fsetxattr \- set an extended attribute value .SH SYNOPSIS .fam C .nf -.B #include <sys/types.h> .B #include <sys/xattr.h> .PP .BI "int setxattr(const char\ *" path ", const char\ *" name ,man2/shmctl.2 +4
-6@@ -467,17 +467,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4. .\" an EIDRM error condition. .SH NOTES The inclusion of -.I <sys/types.h> -and .I <sys/ipc.h> isn't required on Linux or by any version of POSIX. However, -some old implementations required the inclusion of these header files, -and the SVID also documented their inclusion. +some old implementations required the inclusion of this header file, +and the SVID also documented its inclusion. Applications intended to be portable to such old systems may need -to include these header files. +to include this header file. .\" Like Linux, the FreeBSD man pages still document -.\" the inclusion of these header files. +.\" the inclusion of this header file. .PP The .BR IPC_INFO ,man2/socket.2 +0
-7@@ -44,7 +44,6 @@ socket \- create an endpoint for communication .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int socket(int " domain ", int " type ", int " protocol );@@ -467,12 +466,6 @@ It is generally portable to/from non-BSD systems supporting clones of the BSD socket layer (including System\ V variants). .SH NOTES -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. -.PP The manifest constants used under 4.x BSD for protocol families are .BR PF_UNIX ,man2/socketpair.2 +0
-7@@ -44,7 +44,6 @@ socketpair \- create a pair of connected sockets .SH SYNOPSIS .nf -.BR "#include <sys/types.h>" " /* See NOTES */" .B #include <sys/socket.h> .PP .BI "int socketpair(int " domain ", int " type ", int " protocol \@@ -130,12 +129,6 @@ flags in the .I type argument, as described in .BR socket (2). -.PP -POSIX.1 does not require the inclusion of -.IR <sys/types.h> , -and this header file is not required on Linux. -However, some historical (BSD) implementations required this header -file, and portable applications are probably wise to include it. .SH SEE ALSO .BR pipe (2), .BR read (2),man2/statx.2 +0
-1@@ -32,7 +32,6 @@ statx \- get file status (extended) .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <sys/stat.h> .B #include <unistd.h> .BR "#include <fcntl.h> " "/* Definition of AT_* constants */"man2/vfork.2 +0
-1@@ -31,7 +31,6 @@ vfork \- create a child process and block parent .SH SYNOPSIS .nf -.B #include <sys/types.h> .B #include <unistd.h> .PP .B pid_t vfork(void);
Signature · 3 lines
Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/