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.

[mtk: Already in 2001, POSIX.1 removed the requirement to
include <sys/types.h> for many APIs, so this patch seems
well past due.]

Acked-by: Zack Weinberg <zackw@panix.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-03-14 17:01:35 +01:00 committed by Michael Kerrisk
parent 71458d681b
commit b0b19983d9
49 changed files with 27 additions and 133 deletions

View File

@ -43,7 +43,6 @@
accept, accept4 \- accept a connection on a socket accept, accept4 \- accept a connection on a socket
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "int accept(int " sockfd ", struct sockaddr *restrict " addr , .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 the socket returned from
.BR accept (). .BR accept ().
.SH NOTES .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 There may not always be a connection waiting after a
.B SIGIO .B SIGIO
is delivered or is delivered or

View File

@ -71,7 +71,6 @@
bind \- bind a name to a socket bind \- bind a name to a socket
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "int bind(int " sockfd ", const struct sockaddr *" addr , .BI "int bind(int " sockfd ", const struct sockaddr *" addr ,
@ -243,12 +242,6 @@ first appeared in 4.2BSD).
.\" .B EISDIR .\" .B EISDIR
.\" UNIX-domain error conditions. .\" UNIX-domain error conditions.
.SH NOTES .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 For background on the
.I socklen_t .I socklen_t
type, see type, see

View File

@ -69,7 +69,6 @@
connect \- initiate a connection on a socket connect \- initiate a connection on a socket
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "int connect(int " sockfd ", const struct sockaddr *" addr , .BI "int connect(int " sockfd ", const struct sockaddr *" addr ,
@ -276,12 +275,6 @@ first appeared in 4.2BSD).
.\" It also .\" It also
.\" documents many additional error conditions not described here. .\" documents many additional error conditions not described here.
.SH NOTES .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 For background on the
.I socklen_t .I socklen_t
type, see type, see

View File

@ -41,7 +41,6 @@
fork \- create a child process fork \- create a child process
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.B pid_t fork(void); .B pid_t fork(void);

View File

@ -33,7 +33,6 @@ get_robust_list, set_robust_list \- get/set list of robust futexes
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <linux/futex.h> .B #include <linux/futex.h>
.B #include <sys/types.h>
.B #include <syscall.h> .B #include <syscall.h>
.PP .PP
.BI "long get_robust_list(int " pid ", struct robust_list_head **" head_ptr , .BI "long get_robust_list(int " pid ", struct robust_list_head **" head_ptr ,

View File

@ -28,7 +28,6 @@ getgid, getegid \- get group identity
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <unistd.h> .B #include <unistd.h>
.B #include <sys/types.h>
.PP .PP
.B gid_t getgid(void); .B gid_t getgid(void);
.B gid_t getegid(void); .B gid_t getegid(void);

View File

@ -34,7 +34,6 @@
getgroups, setgroups \- get/set list of supplementary group IDs getgroups, setgroups \- get/set list of supplementary group IDs
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "int getgroups(int " size ", gid_t " list []); .BI "int getgroups(int " size ", gid_t " list []);

View File

@ -27,7 +27,6 @@
getpid, getppid \- get process identification getpid, getppid \- get process identification
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.B pid_t getpid(void); .B pid_t getpid(void);

View File

@ -29,7 +29,6 @@
getsid \- get session ID getsid \- get session ID
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "pid_t getsid(pid_t" " pid" ); .BI "pid_t getsid(pid_t" " pid" );

View File

@ -46,7 +46,6 @@
getsockopt, setsockopt \- get and set options on sockets getsockopt, setsockopt \- get and set options on sockets
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "int getsockopt(int " sockfd ", int " level ", int " optname , .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 .\" .BR SO_SNDLOWAT ", " SO_RCVLOWAT ", " SO_SNDTIMEO ", " SO_RCVTIMEO
.\" options .\" options
.SH NOTES .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 For background on the
.I socklen_t .I socklen_t
type, see type, see

View File

@ -30,7 +30,6 @@ gettid \- get thread identification
.nf .nf
.B #define _GNU_SOURCE .B #define _GNU_SOURCE
.B #include <unistd.h> .B #include <unistd.h>
.B #include <sys/types.h>
.PP .PP
.B pid_t gettid(void); .B pid_t gettid(void);
.fi .fi

View File

@ -29,7 +29,6 @@ getuid, geteuid \- get user identity
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <unistd.h> .B #include <unistd.h>
.B #include <sys/types.h>
.PP .PP
.B uid_t getuid(void); .B uid_t getuid(void);
.B uid_t geteuid(void); .B uid_t geteuid(void);

View File

@ -28,7 +28,6 @@ getxattr, lgetxattr, fgetxattr \- retrieve an extended attribute value
.SH SYNOPSIS .SH SYNOPSIS
.fam C .fam C
.nf .nf
.B #include <sys/types.h>
.B #include <sys/xattr.h> .B #include <sys/xattr.h>
.PP .PP
.BI "ssize_t getxattr(const char *" path ", const char *" name , .BI "ssize_t getxattr(const char *" path ", const char *" name ,

View File

@ -30,7 +30,6 @@
keyctl \- manipulate the kernel's key management facility keyctl \- manipulate the kernel's key management facility
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <keyutils.h> .B #include <keyutils.h>
.PP .PP
.BI "long keyctl(int " operation ", ...);" .BI "long keyctl(int " operation ", ...);"

View File

@ -46,7 +46,6 @@
kill \- send signal to a process kill \- send signal to a process
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <signal.h> .B #include <signal.h>
.PP .PP
.BI "int kill(pid_t " pid ", int " sig ); .BI "int kill(pid_t " pid ", int " sig );

View File

@ -47,7 +47,6 @@
listen \- listen for connections on a socket listen \- listen for connections on a socket
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "int listen(int " sockfd ", int " backlog ); .BI "int listen(int " sockfd ", int " backlog );
@ -140,12 +139,6 @@ Connections are accepted with
.BR accept (2). .BR accept (2).
.RE .RE
.PP .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 The behavior of the
.I backlog .I backlog
argument on TCP sockets changed with Linux 2.2. argument on TCP sockets changed with Linux 2.2.

View File

@ -29,7 +29,6 @@ listxattr, llistxattr, flistxattr \- list extended attribute names
.SH SYNOPSIS .SH SYNOPSIS
.fam C .fam C
.nf .nf
.B #include <sys/types.h>
.B #include <sys/xattr.h> .B #include <sys/xattr.h>
.PP .PP
.BI "ssize_t listxattr(const char *" path ", char *" list \ .BI "ssize_t listxattr(const char *" path ", char *" list \

View File

@ -31,7 +31,6 @@
_llseek \- reposition read/write file offset _llseek \- reposition read/write file offset
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "int _llseek(unsigned int " fd ", unsigned long " offset_high , .BI "int _llseek(unsigned int " fd ", unsigned long " offset_high ,

View File

@ -48,7 +48,6 @@
lseek \- reposition read/write file offset lseek \- reposition read/write file offset
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "off_t lseek(int " fd ", off_t " offset ", int " whence ); .BI "off_t lseek(int " fd ", off_t " offset ", int " whence );

View File

@ -14,7 +14,6 @@ mkdir, mkdirat \- create a directory
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/stat.h> .B #include <sys/stat.h>
.B #include <sys/types.h>
.\" .B #include <unistd.h> .\" .B #include <unistd.h>
.PP .PP
.BI "int mkdir(const char *" pathname ", mode_t " mode ); .BI "int mkdir(const char *" pathname ", mode_t " mode );

View File

@ -17,7 +17,6 @@
mknod, mknodat \- create a special or ordinary file mknod, mknodat \- create a special or ordinary file
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/stat.h> .B #include <sys/stat.h>
.B #include <fcntl.h> .B #include <fcntl.h>
.B #include <unistd.h> .B #include <unistd.h>

View File

@ -27,8 +27,6 @@
modify_ldt \- get or set a per-process LDT entry modify_ldt \- get or set a per-process LDT entry
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.PP
.BI "int modify_ldt(int " func ", void *" ptr ", unsigned long " bytecount ); .BI "int modify_ldt(int " func ", void *" ptr ", unsigned long " bytecount );
.fi .fi
.PP .PP

View File

@ -27,7 +27,6 @@
mq_getsetattr \- get/set message queue attributes mq_getsetattr \- get/set message queue attributes
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <mqueue.h> .B #include <mqueue.h>
.PP .PP
.BI "int mq_getsetattr(mqd_t " mqdes ", const struct mq_attr *" newattr , .BI "int mq_getsetattr(mqd_t " mqdes ", const struct mq_attr *" newattr ,

View File

@ -40,7 +40,6 @@
msgctl \- System V message control operations msgctl \- System V message control operations
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/ipc.h> .B #include <sys/ipc.h>
.B #include <sys/msg.h> .B #include <sys/msg.h>
.PP .PP
@ -407,17 +406,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4.
.\" SVID does not document the EIDRM error condition. .\" SVID does not document the EIDRM error condition.
.SH NOTES .SH NOTES
The inclusion of The inclusion of
.I <sys/types.h>
and
.I <sys/ipc.h> .I <sys/ipc.h>
isn't required on Linux or by any version of POSIX. isn't required on Linux or by any version of POSIX.
However, However,
some old implementations required the inclusion of these header files, some old implementations required the inclusion of this header file,
and the SVID also documented their inclusion. and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need 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 .\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of these header files. .\" the inclusion of this header file.
.PP .PP
The The
.BR IPC_INFO , .BR IPC_INFO ,

View File

@ -37,7 +37,6 @@
msgget \- get a System V message queue identifier msgget \- get a System V message queue identifier
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/ipc.h> .B #include <sys/ipc.h>
.B #include <sys/msg.h> .B #include <sys/msg.h>
.PP .PP
@ -190,17 +189,15 @@ would be exceeded.
POSIX.1-2001, POSIX.1-2008, SVr4. POSIX.1-2001, POSIX.1-2008, SVr4.
.SH NOTES .SH NOTES
The inclusion of The inclusion of
.I <sys/types.h>
and
.I <sys/ipc.h> .I <sys/ipc.h>
isn't required on Linux or by any version of POSIX. isn't required on Linux or by any version of POSIX.
However, However,
some old implementations required the inclusion of these header files, some old implementations required the inclusion of this header file,
and the SVID also documented their inclusion. and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need 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 .\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of these header files. .\" the inclusion of this header file.
.PP .PP
.B IPC_PRIVATE .B IPC_PRIVATE
isn't a flag field but a isn't a flag field but a

View File

@ -42,7 +42,6 @@
msgrcv, msgsnd \- System V message queue operations msgrcv, msgsnd \- System V message queue operations
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/ipc.h> .B #include <sys/ipc.h>
.B #include <sys/msg.h> .B #include <sys/msg.h>
.PP .PP
@ -482,17 +481,15 @@ their definitions can be obtained by defining the
feature test macro. feature test macro.
.SH NOTES .SH NOTES
The inclusion of The inclusion of
.I <sys/types.h>
and
.I <sys/ipc.h> .I <sys/ipc.h>
isn't required on Linux or by any version of POSIX. isn't required on Linux or by any version of POSIX.
However, However,
some old implementations required the inclusion of these header files, some old implementations required the inclusion of this header file,
and the SVID also documented their inclusion. and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need 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 .\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of these header files. .\" the inclusion of this header file.
.PP .PP
The The
.I msgp .I msgp

View File

@ -53,7 +53,6 @@
open, openat, creat \- open and possibly create a file open, openat, creat \- open and possibly create a file
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/stat.h> .B #include <sys/stat.h>
.B #include <fcntl.h> .B #include <fcntl.h>
.PP .PP

View File

@ -29,7 +29,6 @@ for a pathname and open file via a handle
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
.B #include <sys/types.h>
.B #include <sys/stat.h> .B #include <sys/stat.h>
.B #include <fcntl.h> .B #include <fcntl.h>
.PP .PP

View File

@ -26,7 +26,6 @@
openat2 \- open and possibly create a file (extended) openat2 \- open and possibly create a file (extended)
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/stat.h> .B #include <sys/stat.h>
.B #include <fcntl.h> .B #include <fcntl.h>
.B #include <linux/openat2.h> .B #include <linux/openat2.h>

View File

@ -27,8 +27,6 @@
pidfd_open \- obtain a file descriptor that refers to a process pidfd_open \- obtain a file descriptor that refers to a process
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.PP
.BI "int pidfd_open(pid_t " pid ", unsigned int " flags ); .BI "int pidfd_open(pid_t " pid ", unsigned int " flags );
.fi .fi
.PP .PP

View File

@ -43,7 +43,6 @@
recv, recvfrom, recvmsg \- receive a message from a socket recv, recvfrom, recvmsg \- receive a message from a socket
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags ); .BI "ssize_t recv(int " sockfd ", void *" buf ", size_t " len ", int " flags );

View File

@ -28,7 +28,6 @@ removexattr, lremovexattr, fremovexattr \- remove an extended attribute
.SH SYNOPSIS .SH SYNOPSIS
.fam C .fam C
.nf .nf
.B #include <sys/types.h>
.B #include <sys/xattr.h> .B #include <sys/xattr.h>
.PP .PP
.BI "int removexattr(const char\ *" path ", const char\ *" name ); .BI "int removexattr(const char\ *" path ", const char\ *" name );

View File

@ -14,7 +14,6 @@
request_key \- request a key from the kernel's key management facility request_key \- request a key from the kernel's key management facility
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <keyutils.h> .B #include <keyutils.h>
.PP .PP
.BI "key_serial_t request_key(const char *" type ", const char *" description , .BI "key_serial_t request_key(const char *" type ", const char *" description ,

View File

@ -44,7 +44,6 @@
semctl \- System V semaphore control operations semctl \- System V semaphore control operations
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/ipc.h> .B #include <sys/ipc.h>
.B #include <sys/sem.h> .B #include <sys/sem.h>
.PP .PP
@ -538,15 +537,13 @@ but, since Linux 2.4, the field has the type
.IR "unsigned\ long" . .IR "unsigned\ long" .
.SH NOTES .SH NOTES
The inclusion of The inclusion of
.I <sys/types.h>
and
.I <sys/ipc.h> .I <sys/ipc.h>
isn't required on Linux or by any version of POSIX. isn't required on Linux or by any version of POSIX.
However, However,
some old implementations required the inclusion of these header files, some old implementations required the inclusion of this header file,
and the SVID also documented their inclusion. and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need 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 .\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of these header files. .\" the inclusion of these header files.
.PP .PP

View File

@ -39,7 +39,6 @@
semget \- get a System V semaphore set identifier semget \- get a System V semaphore set identifier
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/ipc.h> .B #include <sys/ipc.h>
.B #include <sys/sem.h> .B #include <sys/sem.h>
.fi .fi
@ -221,17 +220,15 @@ SVr4, POSIX.1-2001.
.\" ERANGE, EFAULT. .\" ERANGE, EFAULT.
.SH NOTES .SH NOTES
The inclusion of The inclusion of
.I <sys/types.h>
and
.I <sys/ipc.h> .I <sys/ipc.h>
isn't required on Linux or by any version of POSIX. isn't required on Linux or by any version of POSIX.
However, However,
some old implementations required the inclusion of these header files, some old implementations required the inclusion of this header file,
and the SVID also documented their inclusion. and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need 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 .\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of these header files. .\" the inclusion of this header file.
.PP .PP
.B IPC_PRIVATE .B IPC_PRIVATE
isn't a flag field but a isn't a flag field but a

View File

@ -37,7 +37,6 @@
semop, semtimedop \- System V semaphore operations semop, semtimedop \- System V semaphore operations
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/ipc.h> .B #include <sys/ipc.h>
.B #include <sys/sem.h> .B #include <sys/sem.h>
.PP .PP
@ -385,17 +384,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4.
.\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC. .\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC.
.SH NOTES .SH NOTES
The inclusion of The inclusion of
.I <sys/types.h>
and
.I <sys/ipc.h> .I <sys/ipc.h>
isn't required on Linux or by any version of POSIX. isn't required on Linux or by any version of POSIX.
However, However,
some old implementations required the inclusion of these header files, some old implementations required the inclusion of this header file,
and the SVID also documented their inclusion. and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need 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 .\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of these header files. .\" the inclusion of this header file.
.PP .PP
The The
.I sem_undo .I sem_undo

View File

@ -42,7 +42,6 @@
send, sendto, sendmsg \- send a message on a socket send, sendto, sendmsg \- send a message on a socket
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \ .BI "ssize_t send(int " sockfd ", const void *" buf ", size_t " len \

View File

@ -31,7 +31,6 @@
seteuid, setegid \- set effective user or group ID seteuid, setegid \- set effective user or group ID
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "int seteuid(uid_t " euid ); .BI "int seteuid(uid_t " euid );

View File

@ -32,7 +32,6 @@
setgid \- set group identity setgid \- set group identity
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "int setgid(gid_t " gid ); .BI "int setgid(gid_t " gid );

View File

@ -50,7 +50,6 @@
setpgid, getpgid, setpgrp, getpgrp \- set/get process group setpgid, getpgid, setpgrp, getpgrp \- set/get process group
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "int setpgid(pid_t " pid ", pid_t " pgid ); .BI "int setpgid(pid_t " pid ", pid_t " pgid );

View File

@ -48,7 +48,6 @@
setreuid, setregid \- set real and/or effective user or group ID setreuid, setregid \- set real and/or effective user or group ID
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "int setreuid(uid_t " ruid ", uid_t " euid ); .BI "int setreuid(uid_t " ruid ", uid_t " euid );

View File

@ -34,7 +34,6 @@ setsid \- creates a session and sets the process group ID
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.ad l .ad l
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.B pid_t setsid(void); .B pid_t setsid(void);

View File

@ -33,7 +33,6 @@
setuid \- set user identity setuid \- set user identity
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.BI "int setuid(uid_t " uid ); .BI "int setuid(uid_t " uid );

View File

@ -28,7 +28,6 @@ setxattr, lsetxattr, fsetxattr \- set an extended attribute value
.SH SYNOPSIS .SH SYNOPSIS
.fam C .fam C
.nf .nf
.B #include <sys/types.h>
.B #include <sys/xattr.h> .B #include <sys/xattr.h>
.PP .PP
.BI "int setxattr(const char\ *" path ", const char\ *" name , .BI "int setxattr(const char\ *" path ", const char\ *" name ,

View File

@ -467,17 +467,15 @@ POSIX.1-2001, POSIX.1-2008, SVr4.
.\" an EIDRM error condition. .\" an EIDRM error condition.
.SH NOTES .SH NOTES
The inclusion of The inclusion of
.I <sys/types.h>
and
.I <sys/ipc.h> .I <sys/ipc.h>
isn't required on Linux or by any version of POSIX. isn't required on Linux or by any version of POSIX.
However, However,
some old implementations required the inclusion of these header files, some old implementations required the inclusion of this header file,
and the SVID also documented their inclusion. and the SVID also documented its inclusion.
Applications intended to be portable to such old systems may need 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 .\" Like Linux, the FreeBSD man pages still document
.\" the inclusion of these header files. .\" the inclusion of this header file.
.PP .PP
The The
.BR IPC_INFO , .BR IPC_INFO ,

View File

@ -44,7 +44,6 @@
socket \- create an endpoint for communication socket \- create an endpoint for communication
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "int socket(int " domain ", int " type ", int " protocol ); .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 non-BSD systems supporting clones of the BSD socket layer (including
System\ V variants). System\ V variants).
.SH NOTES .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 The manifest constants used under 4.x BSD for protocol families
are are
.BR PF_UNIX , .BR PF_UNIX ,

View File

@ -44,7 +44,6 @@
socketpair \- create a pair of connected sockets socketpair \- create a pair of connected sockets
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.BR "#include <sys/types.h>" " /* See NOTES */"
.B #include <sys/socket.h> .B #include <sys/socket.h>
.PP .PP
.BI "int socketpair(int " domain ", int " type ", int " protocol \ .BI "int socketpair(int " domain ", int " type ", int " protocol \
@ -130,12 +129,6 @@ flags in the
.I type .I type
argument, as described in argument, as described in
.BR socket (2). .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 .SH SEE ALSO
.BR pipe (2), .BR pipe (2),
.BR read (2), .BR read (2),

View File

@ -32,7 +32,6 @@
statx \- get file status (extended) statx \- get file status (extended)
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <sys/stat.h> .B #include <sys/stat.h>
.B #include <unistd.h> .B #include <unistd.h>
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */" .BR "#include <fcntl.h> " "/* Definition of AT_* constants */"

View File

@ -31,7 +31,6 @@
vfork \- create a child process and block parent vfork \- create a child process and block parent
.SH SYNOPSIS .SH SYNOPSIS
.nf .nf
.B #include <sys/types.h>
.B #include <unistd.h> .B #include <unistd.h>
.PP .PP
.B pid_t vfork(void); .B pid_t vfork(void);