diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | sys-utils/setarch.8 | 3 | ||||
-rw-r--r-- | sys-utils/setarch.c | 18 |
3 files changed, 19 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 0d3b88931..51d06fdd5 100644 --- a/configure.ac +++ b/configure.ac @@ -792,6 +792,7 @@ AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec],,, [#include <sys/stat.h>]) AC_CHECK_DECLS([ + UNAME26, ADDR_NO_RANDOMIZE, FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, diff --git a/sys-utils/setarch.8 b/sys-utils/setarch.8 index 0764a455b..b6f5b776c 100644 --- a/sys-utils/setarch.8 +++ b/sys-utils/setarch.8 @@ -29,6 +29,9 @@ Be verbose. .I "\-h," "\-\-help" Display help (it is also displayed when setarch takes no arguments). .TP +.I "\-\-uname\-2.6" +Causes the program to see a kernel version number beginning with 2.6. +.TP .I "\-3," "\-\-3gb" Specifies that processes should use a maximum of 3GB of address space on systems where it is supported (ADDR_LIMIT_3GB). .TP diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c index 35efca4a9..a33be70d7 100644 --- a/sys-utils/setarch.c +++ b/sys-utils/setarch.c @@ -38,9 +38,11 @@ #define set_pers(pers) ((long)syscall(SYS_personality, pers)) -/* Option --4gb has no equivalent short option, use a non-character as a - pseudo short option. */ -#define OPT_4GB (CHAR_MAX+1) +/* Options without equivalent short options */ +enum { + OPT_4GB = CHAR_MAX + 1, + OPT_UNAME26 +}; #define turn_on(_flag, _opts) \ do { \ @@ -50,6 +52,9 @@ } while(0) +#if !HAVE_DECL_UNAME26 +# define UNAME26 0x0020000 +#endif #if !HAVE_DECL_ADDR_NO_RANDOMIZE # define ADDR_NO_RANDOMIZE 0x0040000 #endif @@ -98,6 +103,7 @@ static const struct option longopts[] = { "sticky-timeouts", 0, 0, 'T' }, { "3gb", 0, 0, '3' }, { "4gb", 0, 0, OPT_4GB }, + { "uname-2.6", 0, 0, OPT_UNAME26 }, { NULL, 0, 0, 0 } }; @@ -127,6 +133,9 @@ show_help(void) " -3, --3gb limits the used address space to a maximum of 3 GB\n" " --4gb ignored (for backward compatibility only)\n")); + printf(_( + " --uname-2.6 turns on UNAME26\n")); + printf(_("\nFor more information see setarch(8).\n")); exit(EXIT_SUCCESS); } @@ -306,6 +315,9 @@ int main(int argc, char *argv[]) break; case OPT_4GB: /* just ignore this one */ break; + case OPT_UNAME26: + turn_on(UNAME26, options); + break; } } |