Bug#42867: <sys/stat.h> sometimes doesn't define S_IFLNK
Package: libc6-dev
Version: 2.1.1-13
The header file <sys/stat.h> sometimes fails to define S_IFLNK:
_tashkent% cat foo.c
#include <sys/stat.h>
#include <unistd.h>
int foo(int m)
{
return (m & S_IFMT) == S_IFLNK;
}
_tashkent% gcc -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED -c foo.c
foo.c: In function `foo':
foo.c:6: `S_IFLNK' undeclared (first use in this function)
foo.c:6: (Each undeclared identifier is reported only once
foo.c:6: for each function it appears in.)
According to Stevens, S_IFLNK is defined in SVR4; also, the X/Open on-line
documentation for the Unix98 spec states that sys/stat.h defines S_IFLNK
and S_ISLNK().
--Paul Vojta, vojta@math.berkeley.edu
Reply to: