Feature test macros overhaul: sparc64

sparc64 has a number of its own headers which override the generic ones.
These too need to use feature test macros properly.

These changes correspond to the generic fcntl.h and sys/stat.h changes
in commit d2df6d381b and
commit 069e400c91.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
This commit is contained in:
Yaakov Selkowitz 2016-03-18 14:08:07 -05:00
parent 19879c03c5
commit f049607eb0
2 changed files with 16 additions and 15 deletions

View File

@ -12,6 +12,7 @@ extern "C" {
#endif #endif
#include <_ansi.h> #include <_ansi.h>
#include <sys/cdefs.h>
#define _FOPEN (-1) /* from sys/file.h, kernel use only */ #define _FOPEN (-1) /* from sys/file.h, kernel use only */
#define _FREAD 0x0001 /* read enabled */ #define _FREAD 0x0001 /* read enabled */
@ -58,11 +59,10 @@ extern "C" {
/* O_NDELAY _FNBIO set in 5include/fcntl.h */ /* O_NDELAY _FNBIO set in 5include/fcntl.h */
#define O_NONBLOCK _FNONBLOCK #define O_NONBLOCK _FNONBLOCK
#define O_NOCTTY _FNOCTTY #define O_NOCTTY _FNOCTTY
#ifndef _POSIX_SOURCE
#define O_SYNC _FSYNC #define O_SYNC _FSYNC
#if __MISC_VISIBLE
/* /*
* Flags that work for fcntl(fd, F_SETFL, FXXXX) * Flags that work for fcntl(fd, F_SETFL, FXXXX)
*/ */
@ -93,7 +93,7 @@ extern "C" {
#define FEXCL _FEXCL #define FEXCL _FEXCL
#define FNOCTTY _FNOCTTY #define FNOCTTY _FNOCTTY
#endif !_POSIX_SOURCE #endif /* __MISC_VISIBLE */
/* XXX close on exec request; must match UF_EXCLOSE in user.h */ /* XXX close on exec request; must match UF_EXCLOSE in user.h */
#define FD_CLOEXEC 1 /* posix */ #define FD_CLOEXEC 1 /* posix */
@ -104,7 +104,7 @@ extern "C" {
#define F_SETFD 2 /* Set fildes flags (close on exec) */ #define F_SETFD 2 /* Set fildes flags (close on exec) */
#define F_GETFL 3 /* Get file flags */ #define F_GETFL 3 /* Get file flags */
#define F_SETFL 4 /* Set file flags */ #define F_SETFL 4 /* Set file flags */
#ifndef _POSIX_SOURCE #if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112
#ifdef __svr4__ #ifdef __svr4__
#define F_GETOWN 23 /* Get owner - for ASYNC */ #define F_GETOWN 23 /* Get owner - for ASYNC */
#define F_SETOWN 24 /* Set owner - for ASYNC */ #define F_SETOWN 24 /* Set owner - for ASYNC */
@ -112,7 +112,7 @@ extern "C" {
#define F_GETOWN 5 /* Get owner - for ASYNC */ #define F_GETOWN 5 /* Get owner - for ASYNC */
#define F_SETOWN 6 /* Set owner - for ASYNC */ #define F_SETOWN 6 /* Set owner - for ASYNC */
#endif #endif
#endif /* !_POSIX_SOURCE */ #endif /* __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 */
#ifdef __svr4__ #ifdef __svr4__
#define F_GETLK 14 /* Get record-locking information */ #define F_GETLK 14 /* Get record-locking information */
#define F_SETLK 6 /* Set or Clear a record-lock (Non-Blocking) */ #define F_SETLK 6 /* Set or Clear a record-lock (Non-Blocking) */
@ -122,20 +122,20 @@ extern "C" {
#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ #define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */
#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ #define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */
#endif #endif
#ifndef _POSIX_SOURCE #if __MISC_VISIBLE
#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ #define F_RGETLK 10 /* Test a remote lock to see if it is blocked */
#define F_RSETLK 11 /* Set or unlock a remote lock */ #define F_RSETLK 11 /* Set or unlock a remote lock */
#define F_CNVT 12 /* Convert a fhandle to an open fd */ #define F_CNVT 12 /* Convert a fhandle to an open fd */
#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */ #define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */
#endif /* !_POSIX_SOURCE */ #endif /* __MISC_VISIBLE */
/* fcntl(2) flags (l_type field of flock structure) */ /* fcntl(2) flags (l_type field of flock structure) */
#define F_RDLCK 1 /* read lock */ #define F_RDLCK 1 /* read lock */
#define F_WRLCK 2 /* write lock */ #define F_WRLCK 2 /* write lock */
#define F_UNLCK 3 /* remove lock(s) */ #define F_UNLCK 3 /* remove lock(s) */
#ifndef _POSIX_SOURCE #if __MISC_VISIBLE
#define F_UNLKSYS 4 /* remove remote locks for a given system */ #define F_UNLKSYS 4 /* remove remote locks for a given system */
#endif /* !_POSIX_SOURCE */ #endif /* __MISC_VISIBLE */
/*#include <sys/stdtypes.h>*/ /*#include <sys/stdtypes.h>*/
@ -149,7 +149,7 @@ struct flock {
short l_xxx; /* reserved for future use */ short l_xxx; /* reserved for future use */
}; };
#ifndef _POSIX_SOURCE #if __MISC_VISIBLE
/* extended file segment locking set data type */ /* extended file segment locking set data type */
struct eflock { struct eflock {
short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */
@ -161,7 +161,7 @@ struct eflock {
long l_rpid; /* Remote process id wanting this lock */ long l_rpid; /* Remote process id wanting this lock */
long l_rsys; /* Remote system id wanting this lock */ long l_rsys; /* Remote system id wanting this lock */
}; };
#endif /* !_POSIX_SOURCE */ #endif /* __MISC_VISIBLE */
#include <sys/types.h> #include <sys/types.h>

View File

@ -78,14 +78,15 @@ struct stat
#define S_ISUID 0004000 /* set user id on execution */ #define S_ISUID 0004000 /* set user id on execution */
#define S_ISGID 0002000 /* set group id on execution */ #define S_ISGID 0002000 /* set group id on execution */
#ifndef _POSIX_SOURCE
#define S_ISVTX 0001000 /* save swapped text even after use */ #define S_ISVTX 0001000 /* save swapped text even after use */
#if __BSD_VISIBLE
#define S_IREAD 0000400 /* read permission, owner */ #define S_IREAD 0000400 /* read permission, owner */
#define S_IWRITE 0000200 /* write permission, owner */ #define S_IWRITE 0000200 /* write permission, owner */
#define S_IEXEC 0000100 /* execute/search permission, owner */ #define S_IEXEC 0000100 /* execute/search permission, owner */
#define S_ENFMT 0002000 /* enforcement-mode locking */ #define S_ENFMT 0002000 /* enforcement-mode locking */
#endif /* __BSD_VISIBLE */
#if __POSIX_VISIBLE >= 200112
#define S_IFMT _IFMT #define S_IFMT _IFMT
#define S_IFDIR _IFDIR #define S_IFDIR _IFDIR
#define S_IFCHR _IFCHR #define S_IFCHR _IFCHR
@ -94,7 +95,7 @@ struct stat
#define S_IFLNK _IFLNK #define S_IFLNK _IFLNK
#define S_IFSOCK _IFSOCK #define S_IFSOCK _IFSOCK
#define S_IFIFO _IFIFO #define S_IFIFO _IFIFO
#endif /* !_POSIX_SOURCE */ #endif /* __POSIX_VISIBLE >= 200112 */
#define S_IRWXU 0000700 /* rwx, owner */ #define S_IRWXU 0000700 /* rwx, owner */