Kirkina A. wrote:
>> Compile with
>>
1 | >> -D_XOPEN_SOURCE=500
|
2 | >>
|
>>
>> man 2 stat
>>
>> should have shown you that.
>
> man 2 stat did not show it.
Seems this has been moved to a separate man page lately. On my linux
system, this is mentioned in man 2 stat, but the latest version of the
linux man page project
(http://man7.org/linux/man-pages/man2/stat.2.html) just says:
1 | st_mode
|
2 | This field contains the file type and mode. See inode(7) for
|
3 | further information.
|
and the inode man page says:
1 | The definitions of most of the above file type test macros are
|
2 | provided if any of the following feature test macros is defined:
|
3 | _BSD_SOURCE (in glibc 2.19 and earlier), _SVID_SOURCE (in glibc 2.19
|
4 | and earlier), or _DEFAULT_SOURCE (in glibc 2.20 and later). In
|
5 | addition, definitions of all of the above macros except S_IFSOCK and
|
6 | S_ISSOCK() are provided if _XOPEN_SOURCE is defined. The definition
|
7 | of S_IFSOCK can also be exposed by defining _XOPEN_SOURCE with a
|
8 | value of 500 or greater.
|