Skip to contentSkip to conversation

open.2, prctl.2: SYNOPSIS: Document these as variadic functions

PATCH New Alejandro Colomar 1 participant 1 message May 19, 2023 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 open.2, prctl.2: SYNOPSIS: Document these as variadic functions

I remember I discussed this with Michael Kerrisk a long ago and we agreed to apply this fix, as I felt that using overload syntax was confusing (especially since C doesn't allow overloads), but then I didn't feel urged to write a patch. Florian confirmed recently that this is confusing to more programmers, so let's do it.

---
 man2/open.2  | 11 +++++------
 man2/prctl.2 |  5 +++--
 2 files changed, 8 insertions(+), 8 deletions(-)
man2/open.2 +5 -6
index f79330a17..70b2519d8 100644
@@ -38,18 +38,17 @@ Standard C library
 .nf
 .B #include <fcntl.h>
 .PP
-.BI "int open(const char *" pathname ", int " flags );
-.BI "int open(const char *" pathname ", int " flags ", mode_t " mode );
+.BI "int open(const char *" pathname ", int " flags ", ..."
+.BI "           \fR/*\fP mode_t " mode " \fR*/\fP );"
 .PP
 .BI "int creat(const char *" pathname ", mode_t " mode );
 .PP
-.BI "int openat(int " dirfd ", const char *" pathname ", int " flags );
-.BI "int openat(int " dirfd ", const char *" pathname ", int " flags \
-", mode_t " mode );
+.BI "int openat(int " dirfd ", const char *" pathname ", int " flags ", ..."
+.BI "           \fR/*\fP mode_t " mode " \fR*/\fP );"
 .PP
 /* Documented separately, in \fBopenat2\fP(2): */
 .BI "int openat2(int " dirfd ", const char *" pathname ,
-.BI "            const struct open_how *" how ", size_t " size ");"
+.BI "           const struct open_how *" how ", size_t " size ");"
 .fi
 .PP
 .RS -4
man2/prctl.2 +3 -2
index 88d94b7e8..09e9072fa 100644
@@ -46,8 +46,9 @@ Standard C library
 .nf
 .B #include <sys/prctl.h>
 .PP
-.BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 ,
-.BI "          unsigned long " arg4 ", unsigned long " arg5 );
+.BI "int prctl(int " option ", ..."
+.BI "          \fR/*\fP unsigned long " arg2 ", unsigned long " arg3 ,
+.BI "          unsigned long " arg4 ", unsigned long " arg5 " \fR*/\fP );"
 .fi
 .SH DESCRIPTION
 .BR prctl ()
Signature · 1 line
2.40.1