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

Bug#728240: libc6: S_IFMT constants not included when _POSIX_C_SOURCE is defined as 200112L



Package: libc6
Version: 2.17-93
Severity: normal

The man page for stat states

POSIX.1-1990 did not describe the S_IFMT, S_IFSOCK, S_IFLNK, S_IFREG, S_IFBLK, S_IFDIR, S_IFCHR, S_IFIFO, S_ISVTX constants, but instead demanded the use of the macros S_ISDIR(), etc. The S_IF* constants are present in POSIX.1-2001 and later.

However, when I write the following program:

#define _POSIX_C_SOURCE 200112L

#include <sys/stat.h>
#include <stdio.h>

int main(void)
{
printf("%d\n", S_IFMT);
return 0;
}

and compile

[camomile:~]% gcc -o foo foo.c
foo.c: In function ‘main’:
foo.c:9:17: error: ‘S_IFMT’ undeclared (first use in this function)
printf("%d\n", S_IFMT);
^
foo.c:9:17: note: each undeclared identifier is reported only once for each function it appears in


-- System Information:
Debian Release: jessie/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.11-1-686-pae (SMP w/1 CPU core)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libc6 depends on:
ii libgcc1 1:4.8.2-1

Versions of packages libc6 recommends:
ii libc6-i686 2.17-93

Versions of packages libc6 suggests:
ii debconf [debconf-2.0] 1.5.51
pn glibc-doc <none>
ii locales 2.17-93

-- debconf information:
glibc/disable-screensaver:
glibc/upgrade: true
glibc/restart-failed:
* libraries/restart-without-asking: true
glibc/restart-services:


Reply to: