Subject: manpages-dev: fstatat: #include <sys/stat.h> does not define
AT_SYMLINK_NOFOLLOW
Date: Fri, 05 Oct 2007 22:15:21 +0300
Package: manpages-dev
Version: 2.63-1
Severity: wishlist
Steps to reproduce:
1) cat >testcase.c <<EOF
#define _ATFILE_SOURCE
#include <sys/stat.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("%d\n", AT_SYMLINK_NOFOLLOW);
return 0;
}
EOF
2) gcc -c testcase.c
Expected results:
2) gcc compiles code into testcase.o
Actual results:
2) compilation fails with the error messages
a.c: In function 'main':
a.c:6: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function)
a.c:6: error: (Each undeclared identifier is reported only once
a.c:6: error: for each function it appears in.)
even though ma fstatat mentions that
#define _ATFILE_SOURCE
#include <sys/stat.h>
should be enough to get AT_SYMLINK_NOFOLLOW defined.
More info:
1) It seems that
#include <fcntl.h>
defines AT_SYMLINK_NOFOLLOW -- maybe this should be documented?
Subject: Re: Bug#445436: manpages-dev: fstatat: #include <sys/stat.h> does
not define AT_SYMLINK_NOFOLLOW
Date: Mon, 08 Oct 2007 21:52:00 +0200
tags 445436 fixed-upstream
thanks
Hi Timo,
Timo Juhani Lindfors wrote:
> Package: manpages-dev
> Version: 2.63-1
> Severity: wishlist
>
> Steps to reproduce:
> 1) cat >testcase.c <<EOF
> #define _ATFILE_SOURCE
> #include <sys/stat.h>
> #include <stdio.h>
>
> int main(int argc, char *argv[]) {
> printf("%d\n", AT_SYMLINK_NOFOLLOW);
> return 0;
> }
> EOF
> 2) gcc -c testcase.c
>
> Expected results:
> 2) gcc compiles code into testcase.o
>
> Actual results:
> 2) compilation fails with the error messages
>
> a.c: In function 'main':
> a.c:6: error: 'AT_SYMLINK_NOFOLLOW' undeclared (first use in this function)
> a.c:6: error: (Each undeclared identifier is reported only once
> a.c:6: error: for each function it appears in.)
>
> even though ma fstatat mentions that
>
> #define _ATFILE_SOURCE
> #include <sys/stat.h>
>
> should be enough to get AT_SYMLINK_NOFOLLOW defined.
>
> More info:
> 1) It seems that
>
> #include <fcntl.h>
>
> defines AT_SYMLINK_NOFOLLOW -- maybe this should be documented?
You are of course quite right, and the fault applies to many other related
pages as well. This the fix for upstream 2.68:
faccessat.2
fchmodat.2
fchownat.2
fstatat.2
futimesat.2
linkat.2
mkdirat.2
mknodat.2
readlinkat.2
renameat.2
symlinkat.2
mkfifoat.3
mtk, after Debian bug 445436 by Timo Juhani Lindfors
Added <fcntl.h> to SYNOPSIS.
Thanks for your report.
Michael
--
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7
Want to help with man page maintenance? Grab the latest tarball at
http://www.kernel.org/pub/linux/docs/manpages/
read the HOWTOHELP file and grep the source files for 'FIXME'.
Acknowledgement sent
to Michael Kerrisk <[email protected]>:
Extra info received and forwarded to list. Copy sent to Martin Schulze <[email protected]>.
(Tue, 28 Oct 2008 14:24:02 GMT) (full text, mbox, link).