unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2)
@ 2021-04-21 22:44 Alejandro Colomar via Libc-alpha
  2021-04-21 22:44 ` [PATCH 2/3] Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>) Alejandro Colomar via Libc-alpha
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Alejandro Colomar via Libc-alpha @ 2021-04-21 22:44 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/alloc_hugepages.2 | 5 +++++
 man2/arch_prctl.2      | 6 ++++++
 man2/capget.2          | 5 +++++
 man2/clone.2           | 6 ++++++
 man2/delete_module.2   | 6 ++++++
 man2/execveat.2        | 6 ++++++
 man2/exit_group.2      | 6 ++++++
 man2/get_robust_list.2 | 5 +++++
 man2/getunwind.2       | 6 ++++++
 man2/init_module.2     | 5 +++++
 10 files changed, 56 insertions(+)

diff --git a/man2/alloc_hugepages.2 b/man2/alloc_hugepages.2
index cc76fc495..47f9da6b0 100644
--- a/man2/alloc_hugepages.2
+++ b/man2/alloc_hugepages.2
@@ -35,6 +35,11 @@ alloc_hugepages, free_hugepages \- allocate or free huge pages
 .BI "int syscall(SYS_free_hugepages, void *" addr );
 .\" asmlinkage int sys_free_hugepages(unsigned long addr);
 .fi
+.PP
+.IR Note :
+glibc provides no wrappers for these system calls,
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 The system calls
 .BR alloc_hugepages ()
diff --git a/man2/arch_prctl.2 b/man2/arch_prctl.2
index 7ae5b350c..982416761 100644
--- a/man2/arch_prctl.2
+++ b/man2/arch_prctl.2
@@ -34,6 +34,12 @@ arch_prctl \- set architecture-specific thread state
 .BI "int syscall(SYS_arch_prctl, int " code ", unsigned long " addr );
 .BI "int syscall(SYS_arch_prctl, int " code ", unsigned long *" addr );
 .fi
+.PP
+.IR Note :
+glibc provides no wrapper for
+.BR arch_prctl (),
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 .BR arch_prctl ()
 sets architecture-specific process or thread state.
diff --git a/man2/capget.2 b/man2/capget.2
index 9dbc0404c..3ac05106f 100644
--- a/man2/capget.2
+++ b/man2/capget.2
@@ -28,6 +28,11 @@ capget, capset \- set/get capabilities of thread(s)
 .BI "int syscall(SYS_capset, cap_user_header_t " hdrp ,
 .BI "            const cap_user_data_t " datap );
 .fi
+.PP
+.IR Note :
+glibc provides no wrappers for these system calls,
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 These two system calls are the raw kernel interface for getting and
 setting thread capabilities.
diff --git a/man2/clone.2 b/man2/clone.2
index f455c97d8..7253091a7 100644
--- a/man2/clone.2
+++ b/man2/clone.2
@@ -63,6 +63,12 @@ clone, __clone2, clone3 \- create a child process
 .PP
 .BI "long syscall(SYS_clone3, struct clone_args *" cl_args ", size_t " size );
 .fi
+.PP
+.IR Note :
+glibc provides no wrapper for
+.BR clone3 (),
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 These system calls
 create a new ("child") process, in a manner similar to
diff --git a/man2/delete_module.2 b/man2/delete_module.2
index 21c9e9d8d..3b14111c5 100644
--- a/man2/delete_module.2
+++ b/man2/delete_module.2
@@ -33,6 +33,12 @@ delete_module \- unload a kernel module
 .PP
 .BI "int syscall(SYS_delete_module, const char *" name ", unsigned int " flags );
 .fi
+.PP
+.IR Note :
+glibc provides no wrapper for
+.BR delete_module (),
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 The
 .BR delete_module ()
diff --git a/man2/execveat.2 b/man2/execveat.2
index c566f53df..0c97a0eb3 100644
--- a/man2/execveat.2
+++ b/man2/execveat.2
@@ -36,6 +36,12 @@ execveat \- execute program relative to a directory file descriptor
 .BI "            const char *const " argv "[], const char *const " envp [],
 .BI "            int " flags );
 .fi
+.PP
+.IR Note :
+glibc provides no wrapper for
+.BR execveat (),
+necessitating the use of
+.BR syscall (2).
 .\" FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=27364
 .SH DESCRIPTION
 .\" commit 51f39a1f0cea1cacf8c787f652f26dfee9611874
diff --git a/man2/exit_group.2 b/man2/exit_group.2
index b512927d4..96715d26a 100644
--- a/man2/exit_group.2
+++ b/man2/exit_group.2
@@ -32,6 +32,12 @@ exit_group \- exit all threads in a process
 .PP
 .BI "noreturn void syscall(SYS_exit_group, int " status );
 .fi
+.PP
+.IR Note :
+glibc provides no wrapper for
+.BR exit_group (),
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 This system call is equivalent to
 .BR _exit (2)
diff --git a/man2/get_robust_list.2 b/man2/get_robust_list.2
index d1b1c59bc..66b27d905 100644
--- a/man2/get_robust_list.2
+++ b/man2/get_robust_list.2
@@ -42,6 +42,11 @@ get_robust_list, set_robust_list \- get/set list of robust futexes
 .BI "long syscall(SYS_set_robust_list,"
 .BI "             struct robust_list_head *" head ", size_t " len );
 .fi
+.PP
+.IR Note :
+glibc provides no wrappers for these system calls,
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 These system calls deal with per-thread robust futex lists.
 These lists are managed in user space:
diff --git a/man2/getunwind.2 b/man2/getunwind.2
index 2c44506c7..bf15a82b6 100644
--- a/man2/getunwind.2
+++ b/man2/getunwind.2
@@ -35,6 +35,12 @@ getunwind \- copy the unwind data to caller's buffer
 .PP
 .BI "long syscall(SYS_getunwind, void " *buf ", size_t " buf_size );
 .fi
+.PP
+.IR Note :
+glibc provides no wrapper for
+.BR getunwind (),
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 .I Note: this system call is obsolete.
 .PP
diff --git a/man2/init_module.2 b/man2/init_module.2
index 13d1b7f0a..aac0c6631 100644
--- a/man2/init_module.2
+++ b/man2/init_module.2
@@ -38,6 +38,11 @@ init_module, finit_module \- load a kernel module
 .BI "int syscall(SYS_finit_module, int " fd ", const char *" param_values ,
 .BI "            int " flags );
 .fi
+.PP
+.IR Note :
+glibc provides no wrappers for these system calls,
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 .BR init_module ()
 loads an ELF image into kernel space,
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>)
  2021-04-21 22:44 [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2) Alejandro Colomar via Libc-alpha
@ 2021-04-21 22:44 ` Alejandro Colomar via Libc-alpha
  2021-05-09 19:54   ` Michael Kerrisk (man-pages) via Libc-alpha
  2021-04-21 22:44 ` [PATCH 3/3] open.2: Remove unused <sys/stat.h> Alejandro Colomar via Libc-alpha
  2021-05-09 19:52 ` [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2) Michael Kerrisk (man-pages) via Libc-alpha
  2 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar via Libc-alpha @ 2021-04-21 22:44 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

In b0b19983d9a2001ce94b908a99f4c05a50fd47ee we removed
<sys/types.h>.  For the same reasons there, remove now <sys/ipc.h>
from many pages.

If someone wonders why <sys/ipc.h> was needed, the reason was to
get all the definitions of IPC_* constants.  However, that header
is now included by <sys/msg.h>, so it's not needed anymore to
explicitly include it.  Quoting POSIX: "In addition, the
<sys/msg.h> header shall include the <sys/ipc.h> header."

There were some remaining cases where I forgot to remove
<sys/types.h>; remove them now too.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/msgctl.2 | 12 ------------
 man2/msgget.2 | 12 ------------
 man2/msgop.2  | 12 ------------
 man2/semctl.2 | 12 ------------
 man2/semget.2 | 12 ------------
 man2/semop.2  | 12 ------------
 man2/shmctl.2 | 12 ------------
 man2/shmget.2 | 14 --------------
 man3/ftok.3   |  1 -
 9 files changed, 99 deletions(-)

diff --git a/man2/msgctl.2 b/man2/msgctl.2
index d42a47d2b..72598dd4c 100644
--- a/man2/msgctl.2
+++ b/man2/msgctl.2
@@ -40,7 +40,6 @@
 msgctl \- System V message control operations
 .SH SYNOPSIS
 .nf
-.B #include <sys/ipc.h>
 .B #include <sys/msg.h>
 .PP
 .BI "int msgctl(int " msqid ", int " cmd ", struct msqid_ds *" buf );
@@ -405,17 +404,6 @@ capability).
 POSIX.1-2001, POSIX.1-2008, SVr4.
 .\" SVID does not document the EIDRM error condition.
 .SH NOTES
-The inclusion of
-.I <sys/ipc.h>
-isn't required on Linux or by any version of POSIX.
-However,
-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 this header file.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of this header file.
-.PP
 The
 .BR IPC_INFO ,
 .BR MSG_STAT ,
diff --git a/man2/msgget.2 b/man2/msgget.2
index edc91467b..fd9cbe0a1 100644
--- a/man2/msgget.2
+++ b/man2/msgget.2
@@ -37,7 +37,6 @@
 msgget \- get a System V message queue identifier
 .SH SYNOPSIS
 .nf
-.B #include <sys/ipc.h>
 .B #include <sys/msg.h>
 .PP
 .BI "int msgget(key_t " key ", int " msgflg );
@@ -188,17 +187,6 @@ would be exceeded.
 .SH CONFORMING TO
 POSIX.1-2001, POSIX.1-2008, SVr4.
 .SH NOTES
-The inclusion of
-.I <sys/ipc.h>
-isn't required on Linux or by any version of POSIX.
-However,
-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 this header file.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of this header file.
-.PP
 .B IPC_PRIVATE
 isn't a flag field but a
 .I key_t
diff --git a/man2/msgop.2 b/man2/msgop.2
index e56176f08..d46e5b1dd 100644
--- a/man2/msgop.2
+++ b/man2/msgop.2
@@ -42,7 +42,6 @@
 msgrcv, msgsnd \- System V message queue operations
 .SH SYNOPSIS
 .nf
-.B #include <sys/ipc.h>
 .B #include <sys/msg.h>
 .PP
 .BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \
@@ -480,17 +479,6 @@ their definitions can be obtained by defining the
 .\" MSG_COPY since glibc 2.18
 feature test macro.
 .SH NOTES
-The inclusion of
-.I <sys/ipc.h>
-isn't required on Linux or by any version of POSIX.
-However,
-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 this header file.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of this header file.
-.PP
 The
 .I msgp
 argument is declared as \fIstruct msgbuf\ *\fP in
diff --git a/man2/semctl.2 b/man2/semctl.2
index 504cdf9da..ac8bd906d 100644
--- a/man2/semctl.2
+++ b/man2/semctl.2
@@ -44,7 +44,6 @@
 semctl \- System V semaphore control operations
 .SH SYNOPSIS
 .nf
-.B #include <sys/ipc.h>
 .B #include <sys/sem.h>
 .PP
 .BI "int semctl(int " semid ", int " semnum ", int " cmd ", ...);"
@@ -536,17 +535,6 @@ It was also so defined on Linux 2.2 and earlier,
 but, since Linux 2.4, the field has the type
 .IR "unsigned\ long" .
 .SH NOTES
-The inclusion of
-.I <sys/ipc.h>
-isn't required on Linux or by any version of POSIX.
-However,
-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 this header file.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of these header files.
-.PP
 The
 .BR IPC_INFO ,
 .BR SEM_STAT ,
diff --git a/man2/semget.2 b/man2/semget.2
index b0914f900..2fce9b1ce 100644
--- a/man2/semget.2
+++ b/man2/semget.2
@@ -39,7 +39,6 @@
 semget \- get a System V semaphore set identifier
 .SH SYNOPSIS
 .nf
-.B #include <sys/ipc.h>
 .B #include <sys/sem.h>
 .fi
 .PP
@@ -219,17 +218,6 @@ SVr4, POSIX.1-2001.
 .\" SVr4 documents additional error conditions EFBIG, E2BIG, EAGAIN,
 .\" ERANGE, EFAULT.
 .SH NOTES
-The inclusion of
-.I <sys/ipc.h>
-isn't required on Linux or by any version of POSIX.
-However,
-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 this header file.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of this header file.
-.PP
 .B IPC_PRIVATE
 isn't a flag field but a
 .I key_t
diff --git a/man2/semop.2 b/man2/semop.2
index 9479f7e4c..f0cd66302 100644
--- a/man2/semop.2
+++ b/man2/semop.2
@@ -37,7 +37,6 @@
 semop, semtimedop \- System V semaphore operations
 .SH SYNOPSIS
 .nf
-.B #include <sys/ipc.h>
 .B #include <sys/sem.h>
 .PP
 .BI "int semop(int " semid ", struct sembuf *" sops ", size_t " nsops );
@@ -383,17 +382,6 @@ first appeared in version 2.3.3.
 POSIX.1-2001, POSIX.1-2008, SVr4.
 .\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC.
 .SH NOTES
-The inclusion of
-.I <sys/ipc.h>
-isn't required on Linux or by any version of POSIX.
-However,
-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 this header file.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of this header file.
-.PP
 The
 .I sem_undo
 structures of a process aren't inherited by the child produced by
diff --git a/man2/shmctl.2 b/man2/shmctl.2
index 31c86af86..5aa74e676 100644
--- a/man2/shmctl.2
+++ b/man2/shmctl.2
@@ -49,7 +49,6 @@ shmctl \- System V shared memory control
 .SH SYNOPSIS
 .nf
 .ad l
-.B #include <sys/ipc.h>
 .B #include <sys/shm.h>
 .PP
 .BI "int shmctl(int " shmid ", int " cmd ", struct shmid_ds *" buf );
@@ -466,17 +465,6 @@ POSIX.1-2001, POSIX.1-2008, SVr4.
 .\" ENOENT, ENOSPC, ENOMEM, EEXIST.  Neither SVr4 nor SVID documents
 .\" an EIDRM error condition.
 .SH NOTES
-The inclusion of
-.I <sys/ipc.h>
-isn't required on Linux or by any version of POSIX.
-However,
-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 this header file.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of this header file.
-.PP
 The
 .BR IPC_INFO ,
 .BR SHM_STAT ,
diff --git a/man2/shmget.2 b/man2/shmget.2
index 1d9e6825c..757b7b7f1 100644
--- a/man2/shmget.2
+++ b/man2/shmget.2
@@ -41,7 +41,6 @@ shmget \- allocates a System V shared memory segment
 .SH SYNOPSIS
 .nf
 .ad l
-.B #include <sys/ipc.h>
 .B #include <sys/shm.h>
 .PP
 .BI "int shmget(key_t " key ", size_t " size ", int " shmflg );
@@ -284,19 +283,6 @@ and
 .B SHM_NORESERVE
 are Linux extensions.
 .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.
-Applications intended to be portable to such old systems may need
-to include these header files.
-.\" Like Linux, the FreeBSD man pages still document
-.\" the inclusion of these header files.
-.PP
 .B IPC_PRIVATE
 isn't a flag field but a
 .I key_t
diff --git a/man3/ftok.3 b/man3/ftok.3
index 5d8907b56..d46481356 100644
--- a/man3/ftok.3
+++ b/man3/ftok.3
@@ -31,7 +31,6 @@
 ftok \- convert a pathname and a project identifier to a System V IPC key
 .SH SYNOPSIS
 .nf
-.B #include <sys/types.h>
 .B #include <sys/ipc.h>
 .fi
 .PP
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] open.2: Remove unused <sys/stat.h>
  2021-04-21 22:44 [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2) Alejandro Colomar via Libc-alpha
  2021-04-21 22:44 ` [PATCH 2/3] Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>) Alejandro Colomar via Libc-alpha
@ 2021-04-21 22:44 ` Alejandro Colomar via Libc-alpha
  2021-05-09 20:02   ` Michael Kerrisk (man-pages) via Libc-alpha
  2021-05-09 19:52 ` [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2) Michael Kerrisk (man-pages) via Libc-alpha
  2 siblings, 1 reply; 7+ messages in thread
From: Alejandro Colomar via Libc-alpha @ 2021-04-21 22:44 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, libc-alpha

I can't see a reason to include it.  <fcntl.h> provides O_*
constants for 'flags', S_* constants for 'mode', and mode_t.

Probably a long time ago, some of those weren't defined in
<fcntl.h>, and both headers needed to be included, or maybe it's
a historical error.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/open.2 | 1 -
 1 file changed, 1 deletion(-)

diff --git a/man2/open.2 b/man2/open.2
index bac1ee806..1bcd995f4 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -53,7 +53,6 @@
 open, openat, creat \- open and possibly create a file
 .SH SYNOPSIS
 .nf
-.B #include <sys/stat.h>
 .B #include <fcntl.h>
 .PP
 .BI "int open(const char *" pathname ", int " flags );
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2)
  2021-04-21 22:44 [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2) Alejandro Colomar via Libc-alpha
  2021-04-21 22:44 ` [PATCH 2/3] Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>) Alejandro Colomar via Libc-alpha
  2021-04-21 22:44 ` [PATCH 3/3] open.2: Remove unused <sys/stat.h> Alejandro Colomar via Libc-alpha
@ 2021-05-09 19:52 ` Michael Kerrisk (man-pages) via Libc-alpha
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Kerrisk (man-pages) via Libc-alpha @ 2021-05-09 19:52 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, libc-alpha, mtk.manpages

Hello Alex,

On 4/22/21 10:44 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/alloc_hugepages.2 | 5 +++++
>  man2/arch_prctl.2      | 6 ++++++
>  man2/capget.2          | 5 +++++
>  man2/clone.2           | 6 ++++++
>  man2/delete_module.2   | 6 ++++++
>  man2/execveat.2        | 6 ++++++
>  man2/exit_group.2      | 6 ++++++
>  man2/get_robust_list.2 | 5 +++++
>  man2/getunwind.2       | 6 ++++++
>  man2/init_module.2     | 5 +++++
>  10 files changed, 56 insertions(+)

Patch applied. Thanks!

Cheers,

Michael


> diff --git a/man2/alloc_hugepages.2 b/man2/alloc_hugepages.2
> index cc76fc495..47f9da6b0 100644
> --- a/man2/alloc_hugepages.2
> +++ b/man2/alloc_hugepages.2
> @@ -35,6 +35,11 @@ alloc_hugepages, free_hugepages \- allocate or free huge pages
>  .BI "int syscall(SYS_free_hugepages, void *" addr );
>  .\" asmlinkage int sys_free_hugepages(unsigned long addr);
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrappers for these system calls,
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  The system calls
>  .BR alloc_hugepages ()
> diff --git a/man2/arch_prctl.2 b/man2/arch_prctl.2
> index 7ae5b350c..982416761 100644
> --- a/man2/arch_prctl.2
> +++ b/man2/arch_prctl.2
> @@ -34,6 +34,12 @@ arch_prctl \- set architecture-specific thread state
>  .BI "int syscall(SYS_arch_prctl, int " code ", unsigned long " addr );
>  .BI "int syscall(SYS_arch_prctl, int " code ", unsigned long *" addr );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrapper for
> +.BR arch_prctl (),
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  .BR arch_prctl ()
>  sets architecture-specific process or thread state.
> diff --git a/man2/capget.2 b/man2/capget.2
> index 9dbc0404c..3ac05106f 100644
> --- a/man2/capget.2
> +++ b/man2/capget.2
> @@ -28,6 +28,11 @@ capget, capset \- set/get capabilities of thread(s)
>  .BI "int syscall(SYS_capset, cap_user_header_t " hdrp ,
>  .BI "            const cap_user_data_t " datap );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrappers for these system calls,
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  These two system calls are the raw kernel interface for getting and
>  setting thread capabilities.
> diff --git a/man2/clone.2 b/man2/clone.2
> index f455c97d8..7253091a7 100644
> --- a/man2/clone.2
> +++ b/man2/clone.2
> @@ -63,6 +63,12 @@ clone, __clone2, clone3 \- create a child process
>  .PP
>  .BI "long syscall(SYS_clone3, struct clone_args *" cl_args ", size_t " size );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrapper for
> +.BR clone3 (),
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  These system calls
>  create a new ("child") process, in a manner similar to
> diff --git a/man2/delete_module.2 b/man2/delete_module.2
> index 21c9e9d8d..3b14111c5 100644
> --- a/man2/delete_module.2
> +++ b/man2/delete_module.2
> @@ -33,6 +33,12 @@ delete_module \- unload a kernel module
>  .PP
>  .BI "int syscall(SYS_delete_module, const char *" name ", unsigned int " flags );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrapper for
> +.BR delete_module (),
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  The
>  .BR delete_module ()
> diff --git a/man2/execveat.2 b/man2/execveat.2
> index c566f53df..0c97a0eb3 100644
> --- a/man2/execveat.2
> +++ b/man2/execveat.2
> @@ -36,6 +36,12 @@ execveat \- execute program relative to a directory file descriptor
>  .BI "            const char *const " argv "[], const char *const " envp [],
>  .BI "            int " flags );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrapper for
> +.BR execveat (),
> +necessitating the use of
> +.BR syscall (2).
>  .\" FIXME . See https://sourceware.org/bugzilla/show_bug.cgi?id=27364
>  .SH DESCRIPTION
>  .\" commit 51f39a1f0cea1cacf8c787f652f26dfee9611874
> diff --git a/man2/exit_group.2 b/man2/exit_group.2
> index b512927d4..96715d26a 100644
> --- a/man2/exit_group.2
> +++ b/man2/exit_group.2
> @@ -32,6 +32,12 @@ exit_group \- exit all threads in a process
>  .PP
>  .BI "noreturn void syscall(SYS_exit_group, int " status );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrapper for
> +.BR exit_group (),
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  This system call is equivalent to
>  .BR _exit (2)
> diff --git a/man2/get_robust_list.2 b/man2/get_robust_list.2
> index d1b1c59bc..66b27d905 100644
> --- a/man2/get_robust_list.2
> +++ b/man2/get_robust_list.2
> @@ -42,6 +42,11 @@ get_robust_list, set_robust_list \- get/set list of robust futexes
>  .BI "long syscall(SYS_set_robust_list,"
>  .BI "             struct robust_list_head *" head ", size_t " len );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrappers for these system calls,
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  These system calls deal with per-thread robust futex lists.
>  These lists are managed in user space:
> diff --git a/man2/getunwind.2 b/man2/getunwind.2
> index 2c44506c7..bf15a82b6 100644
> --- a/man2/getunwind.2
> +++ b/man2/getunwind.2
> @@ -35,6 +35,12 @@ getunwind \- copy the unwind data to caller's buffer
>  .PP
>  .BI "long syscall(SYS_getunwind, void " *buf ", size_t " buf_size );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrapper for
> +.BR getunwind (),
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  .I Note: this system call is obsolete.
>  .PP
> diff --git a/man2/init_module.2 b/man2/init_module.2
> index 13d1b7f0a..aac0c6631 100644
> --- a/man2/init_module.2
> +++ b/man2/init_module.2
> @@ -38,6 +38,11 @@ init_module, finit_module \- load a kernel module
>  .BI "int syscall(SYS_finit_module, int " fd ", const char *" param_values ,
>  .BI "            int " flags );
>  .fi
> +.PP
> +.IR Note :
> +glibc provides no wrappers for these system calls,
> +necessitating the use of
> +.BR syscall (2).
>  .SH DESCRIPTION
>  .BR init_module ()
>  loads an ELF image into kernel space,
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>)
  2021-04-21 22:44 ` [PATCH 2/3] Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>) Alejandro Colomar via Libc-alpha
@ 2021-05-09 19:54   ` Michael Kerrisk (man-pages) via Libc-alpha
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Kerrisk (man-pages) via Libc-alpha @ 2021-05-09 19:54 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, libc-alpha, mtk.manpages

Hello ALex,

On 4/22/21 10:44 AM, Alejandro Colomar wrote:
> In b0b19983d9a2001ce94b908a99f4c05a50fd47ee we removed
> <sys/types.h>.  For the same reasons there, remove now <sys/ipc.h>
> from many pages.
> 
> If someone wonders why <sys/ipc.h> was needed, the reason was to
> get all the definitions of IPC_* constants.  However, that header
> is now included by <sys/msg.h>, so it's not needed anymore to
> explicitly include it.  Quoting POSIX: "In addition, the
> <sys/msg.h> header shall include the <sys/ipc.h> header."
> 
> There were some remaining cases where I forgot to remove
> <sys/types.h>; remove them now too.

Seems reasonable to me. Patch applied.

Thanks,

Michael

> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/msgctl.2 | 12 ------------
>  man2/msgget.2 | 12 ------------
>  man2/msgop.2  | 12 ------------
>  man2/semctl.2 | 12 ------------
>  man2/semget.2 | 12 ------------
>  man2/semop.2  | 12 ------------
>  man2/shmctl.2 | 12 ------------
>  man2/shmget.2 | 14 --------------
>  man3/ftok.3   |  1 -
>  9 files changed, 99 deletions(-)
> 
> diff --git a/man2/msgctl.2 b/man2/msgctl.2
> index d42a47d2b..72598dd4c 100644
> --- a/man2/msgctl.2
> +++ b/man2/msgctl.2
> @@ -40,7 +40,6 @@
>  msgctl \- System V message control operations
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/ipc.h>
>  .B #include <sys/msg.h>
>  .PP
>  .BI "int msgctl(int " msqid ", int " cmd ", struct msqid_ds *" buf );
> @@ -405,17 +404,6 @@ capability).
>  POSIX.1-2001, POSIX.1-2008, SVr4.
>  .\" SVID does not document the EIDRM error condition.
>  .SH NOTES
> -The inclusion of
> -.I <sys/ipc.h>
> -isn't required on Linux or by any version of POSIX.
> -However,
> -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 this header file.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of this header file.
> -.PP
>  The
>  .BR IPC_INFO ,
>  .BR MSG_STAT ,
> diff --git a/man2/msgget.2 b/man2/msgget.2
> index edc91467b..fd9cbe0a1 100644
> --- a/man2/msgget.2
> +++ b/man2/msgget.2
> @@ -37,7 +37,6 @@
>  msgget \- get a System V message queue identifier
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/ipc.h>
>  .B #include <sys/msg.h>
>  .PP
>  .BI "int msgget(key_t " key ", int " msgflg );
> @@ -188,17 +187,6 @@ would be exceeded.
>  .SH CONFORMING TO
>  POSIX.1-2001, POSIX.1-2008, SVr4.
>  .SH NOTES
> -The inclusion of
> -.I <sys/ipc.h>
> -isn't required on Linux or by any version of POSIX.
> -However,
> -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 this header file.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of this header file.
> -.PP
>  .B IPC_PRIVATE
>  isn't a flag field but a
>  .I key_t
> diff --git a/man2/msgop.2 b/man2/msgop.2
> index e56176f08..d46e5b1dd 100644
> --- a/man2/msgop.2
> +++ b/man2/msgop.2
> @@ -42,7 +42,6 @@
>  msgrcv, msgsnd \- System V message queue operations
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/ipc.h>
>  .B #include <sys/msg.h>
>  .PP
>  .BI "int msgsnd(int " msqid ", const void *" msgp ", size_t " msgsz \
> @@ -480,17 +479,6 @@ their definitions can be obtained by defining the
>  .\" MSG_COPY since glibc 2.18
>  feature test macro.
>  .SH NOTES
> -The inclusion of
> -.I <sys/ipc.h>
> -isn't required on Linux or by any version of POSIX.
> -However,
> -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 this header file.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of this header file.
> -.PP
>  The
>  .I msgp
>  argument is declared as \fIstruct msgbuf\ *\fP in
> diff --git a/man2/semctl.2 b/man2/semctl.2
> index 504cdf9da..ac8bd906d 100644
> --- a/man2/semctl.2
> +++ b/man2/semctl.2
> @@ -44,7 +44,6 @@
>  semctl \- System V semaphore control operations
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/ipc.h>
>  .B #include <sys/sem.h>
>  .PP
>  .BI "int semctl(int " semid ", int " semnum ", int " cmd ", ...);"
> @@ -536,17 +535,6 @@ It was also so defined on Linux 2.2 and earlier,
>  but, since Linux 2.4, the field has the type
>  .IR "unsigned\ long" .
>  .SH NOTES
> -The inclusion of
> -.I <sys/ipc.h>
> -isn't required on Linux or by any version of POSIX.
> -However,
> -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 this header file.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of these header files.
> -.PP
>  The
>  .BR IPC_INFO ,
>  .BR SEM_STAT ,
> diff --git a/man2/semget.2 b/man2/semget.2
> index b0914f900..2fce9b1ce 100644
> --- a/man2/semget.2
> +++ b/man2/semget.2
> @@ -39,7 +39,6 @@
>  semget \- get a System V semaphore set identifier
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/ipc.h>
>  .B #include <sys/sem.h>
>  .fi
>  .PP
> @@ -219,17 +218,6 @@ SVr4, POSIX.1-2001.
>  .\" SVr4 documents additional error conditions EFBIG, E2BIG, EAGAIN,
>  .\" ERANGE, EFAULT.
>  .SH NOTES
> -The inclusion of
> -.I <sys/ipc.h>
> -isn't required on Linux or by any version of POSIX.
> -However,
> -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 this header file.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of this header file.
> -.PP
>  .B IPC_PRIVATE
>  isn't a flag field but a
>  .I key_t
> diff --git a/man2/semop.2 b/man2/semop.2
> index 9479f7e4c..f0cd66302 100644
> --- a/man2/semop.2
> +++ b/man2/semop.2
> @@ -37,7 +37,6 @@
>  semop, semtimedop \- System V semaphore operations
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/ipc.h>
>  .B #include <sys/sem.h>
>  .PP
>  .BI "int semop(int " semid ", struct sembuf *" sops ", size_t " nsops );
> @@ -383,17 +382,6 @@ first appeared in version 2.3.3.
>  POSIX.1-2001, POSIX.1-2008, SVr4.
>  .\" SVr4 documents additional error conditions EINVAL, EFBIG, ENOSPC.
>  .SH NOTES
> -The inclusion of
> -.I <sys/ipc.h>
> -isn't required on Linux or by any version of POSIX.
> -However,
> -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 this header file.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of this header file.
> -.PP
>  The
>  .I sem_undo
>  structures of a process aren't inherited by the child produced by
> diff --git a/man2/shmctl.2 b/man2/shmctl.2
> index 31c86af86..5aa74e676 100644
> --- a/man2/shmctl.2
> +++ b/man2/shmctl.2
> @@ -49,7 +49,6 @@ shmctl \- System V shared memory control
>  .SH SYNOPSIS
>  .nf
>  .ad l
> -.B #include <sys/ipc.h>
>  .B #include <sys/shm.h>
>  .PP
>  .BI "int shmctl(int " shmid ", int " cmd ", struct shmid_ds *" buf );
> @@ -466,17 +465,6 @@ POSIX.1-2001, POSIX.1-2008, SVr4.
>  .\" ENOENT, ENOSPC, ENOMEM, EEXIST.  Neither SVr4 nor SVID documents
>  .\" an EIDRM error condition.
>  .SH NOTES
> -The inclusion of
> -.I <sys/ipc.h>
> -isn't required on Linux or by any version of POSIX.
> -However,
> -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 this header file.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of this header file.
> -.PP
>  The
>  .BR IPC_INFO ,
>  .BR SHM_STAT ,
> diff --git a/man2/shmget.2 b/man2/shmget.2
> index 1d9e6825c..757b7b7f1 100644
> --- a/man2/shmget.2
> +++ b/man2/shmget.2
> @@ -41,7 +41,6 @@ shmget \- allocates a System V shared memory segment
>  .SH SYNOPSIS
>  .nf
>  .ad l
> -.B #include <sys/ipc.h>
>  .B #include <sys/shm.h>
>  .PP
>  .BI "int shmget(key_t " key ", size_t " size ", int " shmflg );
> @@ -284,19 +283,6 @@ and
>  .B SHM_NORESERVE
>  are Linux extensions.
>  .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.
> -Applications intended to be portable to such old systems may need
> -to include these header files.
> -.\" Like Linux, the FreeBSD man pages still document
> -.\" the inclusion of these header files.
> -.PP
>  .B IPC_PRIVATE
>  isn't a flag field but a
>  .I key_t
> diff --git a/man3/ftok.3 b/man3/ftok.3
> index 5d8907b56..d46481356 100644
> --- a/man3/ftok.3
> +++ b/man3/ftok.3
> @@ -31,7 +31,6 @@
>  ftok \- convert a pathname and a project identifier to a System V IPC key
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/types.h>
>  .B #include <sys/ipc.h>
>  .fi
>  .PP
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] open.2: Remove unused <sys/stat.h>
  2021-04-21 22:44 ` [PATCH 3/3] open.2: Remove unused <sys/stat.h> Alejandro Colomar via Libc-alpha
@ 2021-05-09 20:02   ` Michael Kerrisk (man-pages) via Libc-alpha
  2021-05-09 20:09     ` Alejandro Colomar (man-pages) via Libc-alpha
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Kerrisk (man-pages) via Libc-alpha @ 2021-05-09 20:02 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, libc-alpha, mtk.manpages

Hello Alex,

On 4/22/21 10:44 AM, Alejandro Colomar wrote:
> I can't see a reason to include it.  <fcntl.h> provides O_*
> constants for 'flags', S_* constants for 'mode', and mode_t.
> 
> Probably a long time ago, some of those weren't defined in
> <fcntl.h>, and both headers needed to be included, or maybe it's
> a historical error.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

So, I am uncertain what to do about this patch. I agree
that we don't need the <sys/stat.h> on Linux.

But, look at open(3p):

    SYNOPSIS
       #include <sys/stat.h>
       #include <fcntl.h>

       int open(const char *path, int oflag, ...);

       O_CREAT       [...] and the access permission bits  (see
                     <sys/stat.h>)  of  the file mode shall be set to the
                     value of the argument following the  oflag  argument
                     taken  as type mode_t modified as follows...

But, seemingly in contradiction, fcntl.h(0p) says:

       The <fcntl.h> header shall define the symbolic constants for  file
       modes for use as values of mode_t as described in <sys/stat.h>.

It almost seems like a small bug in POSIX.

I see also that open(2) on FreeBSD mentions only the need to 
include <fcntl.h>.

What are your thoughts on the above. I'm willing to apply your 
patch if you still think we should apply it.

Thanks,

Michael

> ---
>  man2/open.2 | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/man2/open.2 b/man2/open.2
> index bac1ee806..1bcd995f4 100644
> --- a/man2/open.2
> +++ b/man2/open.2
> @@ -53,7 +53,6 @@
>  open, openat, creat \- open and possibly create a file
>  .SH SYNOPSIS
>  .nf
> -.B #include <sys/stat.h>
>  .B #include <fcntl.h>
>  .PP
>  .BI "int open(const char *" pathname ", int " flags );
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] open.2: Remove unused <sys/stat.h>
  2021-05-09 20:02   ` Michael Kerrisk (man-pages) via Libc-alpha
@ 2021-05-09 20:09     ` Alejandro Colomar (man-pages) via Libc-alpha
  0 siblings, 0 replies; 7+ messages in thread
From: Alejandro Colomar (man-pages) via Libc-alpha @ 2021-05-09 20:09 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man, libc-alpha

Hi Michael!

On 5/9/21 10:02 PM, Michael Kerrisk (man-pages) wrote:
> It almost seems like a small bug in POSIX.

Yes, it seems so.

> 
> I see also that open(2) on FreeBSD mentions only the need to 
> include <fcntl.h>.
> 
> What are your thoughts on the above. I'm willing to apply your 
> patch if you still think we should apply it.

We could file a bug to the Open Group.  Could you do that?  I don't know
how to do it.  Let's wait and see.

I don't have any patches that depend on this one, so we can hold on.
I'll ping you in a month or so if needed.  I guess that POSIX will
confirm that we can remove it, but let's wait.

Thanks,

Alex


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-09 20:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21 22:44 [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2) Alejandro Colomar via Libc-alpha
2021-04-21 22:44 ` [PATCH 2/3] Various pages: Remove unused <sys/ipc.h> (and <sys/types.h>) Alejandro Colomar via Libc-alpha
2021-05-09 19:54   ` Michael Kerrisk (man-pages) via Libc-alpha
2021-04-21 22:44 ` [PATCH 3/3] open.2: Remove unused <sys/stat.h> Alejandro Colomar via Libc-alpha
2021-05-09 20:02   ` Michael Kerrisk (man-pages) via Libc-alpha
2021-05-09 20:09     ` Alejandro Colomar (man-pages) via Libc-alpha
2021-05-09 19:52 ` [PATCH 1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2) Michael Kerrisk (man-pages) via Libc-alpha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).