public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: Mark Harris <mark.hsj@gmail.com>
Cc: vursc <vursc@vursc.org>, linux-man@vger.kernel.org
Subject: Re: [PATCH] man/man2/getdents.2: Fix incorrect argument type
Date: Mon, 6 Apr 2026 00:04:46 +0200	[thread overview]
Message-ID: <adLcKauddujSMHyZ@debian> (raw)
In-Reply-To: <CAMdZqKGyG3vksBugjZ+WOt6xV7dqtc40L-vESmoAB9HZHfV7FQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2088 bytes --]

Hi Mark, vursc,

On Sat, Apr 04, 2026 at 02:53:07PM -0700, Mark Harris wrote:
> vursc wrote:
> >
> > The count argument of getdents64 is an unsigned int; see
> > SYSCALL_DEFINE3(getdents64, ...) in linux/fs/readdir.c.
> >
> > Signed-off-by: vursc <vursc@vursc.org>
> > ---
> >  man/man2/getdents.2 | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/man/man2/getdents.2 b/man/man2/getdents.2
> > index 8c5bbebbc..3890943ee 100644
> > --- a/man/man2/getdents.2
> > +++ b/man/man2/getdents.2
> > @@ -23,7 +23,7 @@ Standard C library
> >  .B #include <dirent.h>
> >  .P
> >  .BR "ssize_t getdents64(" "size_t count;"
> > -.BI "                   int " fd ", void " dirp [ count "], size_t " count );
> > +.BI "                   int " fd ", void " dirp [ count "], unsigned int " count );
> 
> The third argument of the function has type size_t in glibc
> (https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/getdents64.c;hb=HEAD)
> and musl (https://git.musl-libc.org/cgit/musl/tree/src/linux/getdents.c).
> According to intro(2): "the manual pages in Section 2 generally try to
> note the details of both the (usually GNU) C library API interface and
> the raw system call.  Most commonly, the main DESCRIPTION will focus
> on the C library interface, and differences for the system call are
> covered in the NOTES section."  So rather than changing the function
> prototype, adding a note to the NOTES section may be more appropriate.
> 
> That said, the DESCRIPTION section claims, "This page documents the
> bare kernel system call interfaces", so that should be corrected as
> well.  It appears that that was written before the glibc function
> existed and is outdated.

Thanks!  That seems the appropriate solution.  vursc, would you mind
sending an updated patch set doing that?  Or should I?


Have a lovely night!
Alex

>  - Mark
> 
> 
> >  .fi
> >  .P
> >  .IR Note :
> > --
> > 2.53.0
> >
> >
> 

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-04-05 22:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04  7:49 [PATCH] man/man2/getdents.2: Fix incorrect argument type vursc
2026-04-04 21:53 ` Mark Harris
2026-04-05 22:04   ` Alejandro Colomar [this message]
2026-04-06  5:37   ` vursc
2026-04-06  8:28     ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=adLcKauddujSMHyZ@debian \
    --to=alx@kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mark.hsj@gmail.com \
    --cc=vursc@vursc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox