Various pages: Remove unused <sys/types.h>
commitb0b19983d9a2001ce94b908a99f4c05a50fd47ee
authorAlejandro Colomar <alx.manpages@gmail.com>
Sun, 14 Mar 2021 16:01:35 +0000 (14 17:01 +0100)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Mon, 15 Mar 2021 07:43:12 +0000 (15 08:43 +0100)
treebe23d8c2fabcc7b4e7849f5b882a71c19d66a850
parent71458d681bb4ebd5f9ec15ddea8b856310bc056b
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>
49 files changed:
man2/accept.2
man2/bind.2
man2/connect.2
man2/fork.2
man2/get_robust_list.2
man2/getgid.2
man2/getgroups.2
man2/getpid.2
man2/getsid.2
man2/getsockopt.2
man2/gettid.2
man2/getuid.2
man2/getxattr.2
man2/keyctl.2
man2/kill.2
man2/listen.2
man2/listxattr.2
man2/llseek.2
man2/lseek.2
man2/mkdir.2
man2/mknod.2
man2/modify_ldt.2
man2/mq_getsetattr.2
man2/msgctl.2
man2/msgget.2
man2/msgop.2
man2/open.2
man2/open_by_handle_at.2
man2/openat2.2
man2/pidfd_open.2
man2/recv.2
man2/removexattr.2
man2/request_key.2
man2/semctl.2
man2/semget.2
man2/semop.2
man2/send.2
man2/seteuid.2
man2/setgid.2
man2/setpgid.2
man2/setreuid.2
man2/setsid.2
man2/setuid.2
man2/setxattr.2
man2/shmctl.2
man2/socket.2
man2/socketpair.2
man2/statx.2
man2/vfork.2