[v5,21/35] getdents.2: Use syscall(SYS_...); for system calls without a wrapper

Message ID 20210404115847.78166-22-alx.manpages@gmail.com
State New
Headers show
Series
  • Untitled series #36404
Related show

Commit Message

Wilco Dijkstra via Libc-alpha April 4, 2021, 11:58 a.m.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

---
 man2/getdents.2 | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

-- 
2.31.0

Comments

Wilco Dijkstra via Libc-alpha April 5, 2021, 11:37 a.m. | #1
Hi Alex,

On 4/4/21 1:58 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

> ---

>  man2/getdents.2 | 12 ++++++++----

>  1 file changed, 8 insertions(+), 4 deletions(-)


Patch applied.

Thanks,

Michael


> diff --git a/man2/getdents.2 b/man2/getdents.2

> index ec00a73ba..6a9f4e04c 100644

> --- a/man2/getdents.2

> +++ b/man2/getdents.2

> @@ -33,7 +33,11 @@

>  getdents, getdents64 \- get directory entries

>  .SH SYNOPSIS

>  .nf

> -.BI "long getdents(unsigned int " fd ", struct linux_dirent *" dirp ,

> +.BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"

> +.B #include <unistd.h>

> +.PP

> +.BI "long syscall(SYS_getdents, unsigned int " fd \

> +", struct linux_dirent *" dirp ,

>  .BI "             unsigned int " count );

>  .PP

>  .BR "#define _GNU_SOURCE" "        /* See feature_test_macros(7) */"

> @@ -43,9 +47,9 @@ getdents, getdents64 \- get directory entries

>  .fi

>  .PP

>  .IR Note :

> -There is no glibc wrapper for

> -.BR getdents ();

> -see NOTES.

> +There is no definition of

> +.B struct linux_dirent

> +in glibc; see NOTES.

>  .SH DESCRIPTION

>  These are not the interfaces you are interested in.

>  Look at

> 



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

Patch

diff --git a/man2/getdents.2 b/man2/getdents.2
index ec00a73ba..6a9f4e04c 100644
--- a/man2/getdents.2
+++ b/man2/getdents.2
@@ -33,7 +33,11 @@ 
 getdents, getdents64 \- get directory entries
 .SH SYNOPSIS
 .nf
-.BI "long getdents(unsigned int " fd ", struct linux_dirent *" dirp ,
+.BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
+.B #include <unistd.h>
+.PP
+.BI "long syscall(SYS_getdents, unsigned int " fd \
+", struct linux_dirent *" dirp ,
 .BI "             unsigned int " count );
 .PP
 .BR "#define _GNU_SOURCE" "        /* See feature_test_macros(7) */"
@@ -43,9 +47,9 @@  getdents, getdents64 \- get directory entries
 .fi
 .PP
 .IR Note :
-There is no glibc wrapper for
-.BR getdents ();
-see NOTES.
+There is no definition of
+.B struct linux_dirent
+in glibc; see NOTES.
 .SH DESCRIPTION
 These are not the interfaces you are interested in.
 Look at