openat2.2: Use syscall(SYS_...); for system calls without a wrapper; fix includes too

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-05-10 19:55:36 +02:00 committed by Michael Kerrisk
parent bc2813df5e
commit 10f4414ccb
1 changed files with 11 additions and 9 deletions

View File

@ -26,16 +26,21 @@
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/stat.h> .BR "#include <fcntl.h>" \
.B #include <fcntl.h> " /* Definition of " O_* " and " S_* " constants */"
.B #include <linux/openat2.h> .BR "#include <linux/openat2.h>" " /* Definition of " RESOLVE_* " constants */"
.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
.B #include <unistd.h>
.PP .PP
.BI "long openat2(int " dirfd ", const char *" pathname , .BI "long syscall(SYS_openat2, int " dirfd ", const char *" pathname ,
.BI " struct open_how *" how ", size_t " size ); .BI " struct open_how *" how ", size_t " size );
.fi .fi
.PP .PP
.IR Note : .IR Note :
There is no glibc wrapper for this system call; see NOTES. glibc provides no wrapper for
.BR openat2 (),
necessitating the use of
.BR syscall (2).
.SH DESCRIPTION .SH DESCRIPTION
The The
.BR openat2 () .BR openat2 ()
@ -494,9 +499,6 @@ The semantics of
were modeled after FreeBSD's were modeled after FreeBSD's
.BR O_BENEATH . .BR O_BENEATH .
.SH NOTES .SH NOTES
Glibc does not provide a wrapper for this system call; call it using
.BR syscall (2).
.\"
.SS Extensibility .SS Extensibility
In order to allow for future extensibility, In order to allow for future extensibility,
.BR openat2 () .BR openat2 ()