From: Karel Zak Date: Mon, 27 Aug 2007 21:31:25 +0000 (+0200) Subject: setarch: add --3gb option fot compatibility with Debian linux{32,64} command X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e322675f96b4ff4f198b4ec6673059ceb30fbf1;p=util-linux setarch: add --3gb option fot compatibility with Debian linux{32,64} command Debian had a pre-existing linux{32,64} command which supported only --3gb and --4gb. Adding support for those options allows setarch to replace that package. (Note that long options are expected for all setarch flags in the next release.) Signed-off-by: LaMont Jones Signed-off-by: Karel Zak --- diff --git a/sys-utils/setarch.8 b/sys-utils/setarch.8 index db9b416d..16946cf7 100644 --- a/sys-utils/setarch.8 +++ b/sys-utils/setarch.8 @@ -23,7 +23,7 @@ Be verbose. .I "\-h," "\-\-help" Display help (it is also displayed when setarch takes no arguments). .TP -.I "\-3" +.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 .I "\-B" diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c index e4a204ad..6eba24ae 100644 --- a/sys-utils/setarch.c +++ b/sys-utils/setarch.c @@ -212,6 +212,14 @@ int main(int argc, char *argv[]) if (!strcmp(arg, "--help")) show_help(); + /* compatibitity with an old Debian setarch implementation + * TODO: add long options for all flags + */ + if (!strcmp(arg, "--3gb")) + arg="-3"; + else if (!strcmp(arg, "--4gb")) + continue; /* just ignore this one */ + for (n = 1; arg[n]; n++) { int f;