[02/39] getdents.2: Use syscall(SYS_...); for system calls without a wrapper

Message ID 20210510175546.28445-3-alx.manpages@gmail.com
State New
Headers show
Series
  • man2: SYNOPSIS: Fix headers, use syscall(), and other fixes
Related show

Commit Message

Mark Brown via Libc-alpha May 10, 2021, 5:55 p.m.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

---
 man2/getdents.2 | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

-- 
2.31.1

Comments

Mark Brown via Libc-alpha May 11, 2021, 5:21 a.m. | #1
Hi Alex,

See below.

On 5/11/21 5:55 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

> ---

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

>  1 file changed, 15 insertions(+), 5 deletions(-)

> 

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

> index ec00a73ba..df766b066 100644

> --- a/man2/getdents.2

> +++ b/man2/getdents.2

> @@ -33,19 +33,29 @@

>  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) */"

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

>  .BR "#include <dirent.h>"

>  .PP

>  .BI "ssize_t getdents64(int " fd ", void *" dirp ", size_t " count );

>  .fi

>  .PP

>  .IR Note :

> -There is no glibc wrapper for

> -.BR getdents ();

> -see NOTES.

> +glibc provides no wrapper for

> +.BR getdents (),

> +necessitating the use of

> +.BR syscall (2).

> +.PP

> +.IR Note :

> +There is no definition of

> +.B struct linux_dirent


.I ...
(Fixed)

> +in glibc; see NOTES.

>  .SH DESCRIPTION

>  These are not the interfaces you are interested in.

>  Look at

> 


Cheers,

Michael

-- 
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..df766b066 100644
--- a/man2/getdents.2
+++ b/man2/getdents.2
@@ -33,19 +33,29 @@ 
 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) */"
+.BR "#define _GNU_SOURCE" "           /* See feature_test_macros(7) */"
 .BR "#include <dirent.h>"
 .PP
 .BI "ssize_t getdents64(int " fd ", void *" dirp ", size_t " count );
 .fi
 .PP
 .IR Note :
-There is no glibc wrapper for
-.BR getdents ();
-see NOTES.
+glibc provides no wrapper for
+.BR getdents (),
+necessitating the use of
+.BR syscall (2).
+.PP
+.IR Note :
+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