[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#42867: sys/stat.h> sometimes doesn't define S_IFLNK



On Wed, Aug 11, 1999 at 06:44:49PM -0700, Paul Vojta wrote:
> 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().


Right, I'd wondered why S_ISLNK was conditionalized on -D_BSD_SOURCE or
-D_GNU_SOURCE.  Is there any reason for it to be?


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/


Reply to: