Hi Dirk, On 2026-04-15T22:00:52+0200, Dirk Müller wrote: > Hi Branden, > > On Wed, Apr 15, 2026 at 8:24 PM G. Branden Robinson > wrote: > > > > ssize_t readlink(size_t bufsiz; > > > const char *restrict path, > > > char buf[restrict bufsiz], size_t bufsiz); > > > > > > I believe this is a typo and it should be: > > > > > > ssize_t readlink(const char *restrict path, > > > char buf[restrict bufsiz], size_t bufsiz); > > This is something of a FAQ on this mailing list. > > https://lore.kernel.org/linux-man/adupQhfJQ7kws17U@debian/ > > It's a GCC syntax extension. > > > > https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html Look at the very bottom of that page. > > Oh, I understand that part. I believe you didn't. > let me try again. The Synpsis shows 4 > parameters to the readlink() call: > > ssize_t readlink(size_t, const char*, char buf[], size_t); That's not what readlink(2) documents. readlink(2) has a semicolon (;) after the fisrt 'size_t bufsiz'. That means it's a forward declaration of a function parameter, and not a real parameter declaration. > > I believe it should actually be 3 parameters instead: > > ssize_t readlink(const char*, char buf[], size_t); > > with other words, the first argument is a pointer to the source link, > not a repetition of bufsiz (which is at the end). > > This page has the, what I consider correct synposis: > > https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html > > ssize_t readlink(const char *restrict path, char *restrict buf, > size_t bufsize); This synopsis is compatible with the one from readlink(2). See by yourself: alx@devuan:~/tmp$ cat rl.c #include ssize_t readlink( const char *path, char *buf, size_t bufsiz); ssize_t readlink(size_t bufsiz; const char *path, char buf[bufsiz], size_t bufsiz); alx@devuan:~/tmp$ gcc -Wall -Wextra -Wno-vla-parameter -S rl.c alx@devuan:~/tmp$ > Again, I'm only commenting on the number of parameters, not the > variadic length expression on parameter two (three in the original). Both prototypes have 3 parameters. Have a lovely night! Alex > > Thanks, > Dirk > --