--- coreutils-8.25.old/lib/dirchownmod.c +++ coreutils-8.25/lib/dirchownmod.c @@ -34,6 +34,10 @@ # define fchmod(fd, mode) (-1) #endif +#ifndef S_IXUGO +#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) +#endif + /* Change the ownership and mode bits of a directory. If FD is nonnegative, it should be a file descriptor associated with the directory; close it before returning. DIR is the name of the --- coreutils-8.25.old/lib/file-type.c +++ coreutils-8.25/lib/file-type.c @@ -57,8 +57,10 @@ if (S_TYPEISSHM (st)) return _("shared memory object"); +#ifdef S_TYPEISTMO if (S_TYPEISTMO (st)) return _("typed memory object"); +#endif // Endif defined S_TYPEISTMO /* The remaining are in alphabetical order. */ @@ -107,5 +109,5 @@ if (S_ISWHT (st->st_mode)) return _("whiteout"); - return _("weird file"); + return _("unknown object"); } --- coreutils-8.25.old/lib/filemode.c +++ coreutils-8.25/lib/filemode.c @@ -73,6 +73,7 @@ if (S_ISSOCK (bits)) return 's'; +#ifdef S_ISCTG /* Nonstandard file types. */ if (S_ISCTG (bits)) return 'C'; @@ -86,6 +87,7 @@ return 'P'; if (S_ISWHT (bits)) return 'w'; +#endif // Endif defined S_ISCTG return '?'; } @@ -175,6 +177,9 @@ str[0] = 'Q'; else if (S_TYPEISSHM (statp)) str[0] = 'S'; + +#ifdef S_TYPEISTMO else if (S_TYPEISTMO (statp)) str[0] = 'T'; +#endif } --- coreutils-8.25.old/lib/modechange.c +++ coreutils-8.25/lib/modechange.c @@ -33,6 +33,10 @@ #include "xalloc.h" #include +#ifndef S_IRWXUGO +#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) +#endif + /* The traditional octal values corresponding to each mode bit. */ #define SUID 04000 #define SGID 02000 --- coreutils-8.25.old/src/dd.c +++ coreutils-8.25/src/dd.c @@ -366,7 +366,11 @@ {"nocache", O_NOCACHE}, /* Discard cache. */ {"noctty", O_NOCTTY}, {"nofollow", HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0}, - {"nolinks", O_NOLINKS}, + +#if defined (O_NOLINKS) && (O_NOLINKS != 0) + {"nolinks", O_NOLINKS}, +#endif + {"nonblock", O_NONBLOCK}, {"sync", O_SYNC}, {"text", O_TEXT}, --- coreutils-8.25.old/src/ls.c +++ coreutils-8.25/src/ls.c @@ -4335,8 +4335,10 @@ c = '|'; else if (stat_ok ? S_ISSOCK (mode) : type == sock) c = '='; +#ifdef S_ISDOOR else if (stat_ok && S_ISDOOR (mode)) c = '>'; +#endif else c = 0; } @@ -4424,8 +4426,10 @@ type = C_BLK; else if (S_ISCHR (mode)) type = C_CHR; +#ifdef S_ISDOOR else if (S_ISDOOR (mode)) type = C_DOOR; +#endif else { /* Classify a file of some other type as C_ORPHAN. */ --- coreutils-8.25.old/src/system.h +++ coreutils-8.25/src/system.h @@ -261,6 +261,30 @@ #include "dirname.h" #include "openat.h" +//-------------------------------------------------------------------- + +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +#ifndef O_NOLINKS +#define O_NOLINKS 0 +#endif + +#ifndef O_TEXT +#define O_TEXT 0 +#endif + +#ifndef S_IRWXUGO +#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) +#endif + +#ifndef S_IXUGO +#define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) +#endif + +//-------------------------------------------------------------------- + static inline bool dot_or_dotdot (char const *file_name) {