https://lkml.org/lkml/2011/8/23/21 https://lkml.org/lkml/diff/2011/8/23/21/1 diff -Naurp util-linux-2.19/config.h.in util-linux-2.19.oden/config.h.in --- util-linux-2.19/config.h.in 2011-02-10 08:30:17.000000000 +0000 +++ util-linux-2.19.oden/config.h.in 2012-01-11 16:02:54.000000000 +0000 @@ -66,6 +66,10 @@ you don't. */ #undef HAVE_DECL_STICKY_TIMEOUTS +/* Define to 1 if you have the declaration of `UNAME26', and to 0 if you + don't. */ +#undef HAVE_DECL_UNAME26 + /* Define to 1 if you have the declaration of `WHOLE_SECONDS', and to 0 if you don't. */ #undef HAVE_DECL_WHOLE_SECONDS diff -Naurp util-linux-2.19/configure.ac util-linux-2.19.oden/configure.ac --- util-linux-2.19/configure.ac 2011-02-10 08:28:20.000000000 +0000 +++ util-linux-2.19.oden/configure.ac 2012-01-11 16:02:58.000000000 +0000 @@ -785,6 +785,7 @@ AC_CHECK_MEMBERS([struct stat.st_mtim.tv [#include <sys/stat.h>]) AC_CHECK_DECLS([ + UNAME26, ADDR_NO_RANDOMIZE, FDPIC_FUNCPTRS, MMAP_PAGE_ZERO, diff -Naurp util-linux-2.19/sys-utils/setarch.8 util-linux-2.19.oden/sys-utils/setarch.8 --- util-linux-2.19/sys-utils/setarch.8 2010-11-30 10:26:32.000000000 +0000 +++ util-linux-2.19.oden/sys-utils/setarch.8 2012-01-11 16:03:04.000000000 +0000 @@ -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 -Naurp util-linux-2.19/sys-utils/setarch.c util-linux-2.19.oden/sys-utils/setarch.c --- util-linux-2.19/sys-utils/setarch.c 2010-11-30 10:26:32.000000000 +0000 +++ util-linux-2.19.oden/sys-utils/setarch.c 2012-01-11 16:04:39.000000000 +0000 @@ -39,9 +39,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 { \ @@ -51,6 +53,9 @@ } while(0) +#if !HAVE_DECL_UNAME26 +# define UNAME26 0x0020000 +#endif #if !HAVE_DECL_ADDR_NO_RANDOMIZE # define ADDR_NO_RANDOMIZE 0x0040000 #endif @@ -99,6 +104,7 @@ 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 } }; @@ -128,6 +134,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); } @@ -308,6 +317,9 @@ int main(int argc, char *argv[]) break; case OPT_4GB: /* just ignore this one */ break; + case OPT_UNAME26: + turn_on(UNAME26, options); + break; } }