summaryrefslogtreecommitdiffstats
path: root/sys-utils/setarch.c
Commit message (Collapse)AuthorAgeFilesLines
* textual: add a docstring to most of the utilitiesBenno Schulenberg2015-01-061-0/+4
| | | | | | | | | This adds a concise description of a tool to its usage text. A first form of this patch was proposed by Steven Honeyman (see http://www.spinics.net/lists/util-linux-ng/msg09994.html). Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* setarch: use personality() system call when it is availableSami Kerola2014-09-191-4/+6
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: reindent codeSami Kerola2014-09-191-259/+248Star
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: add generic support for setarch $(uname -m) ...Ruediger Meier2014-05-291-0/+16
| | | | | Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add shortcut binary uname26Ruediger Meier2014-05-221-0/+1
| | | | | | | | | | There are some uname26 binaries flying around. Let's make it available everywhere. Internal SUSE references: fate313476, sr226509 CC: Stanislav Brabec <sbrabec@suse.cz> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* setarch: flush output streams before execRuediger Meier2014-05-221-0/+3
| | | | | | | | | | | | | | | | | | | This fixes the following (non-deterministic) discrepancy: $ setarch x86_64 -RFZLvXBIST3 --uname-2.6 echo success Switching on READ_IMPLIES_EXEC. Switching on ADDR_LIMIT_32BIT. Switching on SHORT_INODE. Switching on WHOLE_SECONDS. Switching on STICKY_TIMEOUTS. Switching on ADDR_LIMIT_3GB. Switching on UNAME26. success $ setarch x86_64 -RFZLvXBIST3 --uname-2.6 echo success &> /tmp/bla; cat /tmp/bla success Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* setarch: Fix ppc64le architecturesAnton Blanchard2014-04-071-0/+6
| | | | | | | setarch currently fails on ppc64le because it tries to use big endian architecture names. Fix it. Signed-off-by: Anton Blanchard <anton@samba.org>
* setarch: prefer preprocessor rather than autotools checkSami Kerola2013-08-011-11/+11
| | | | | | | It seems to be pointless to spend time in ./configure phase when preprocessor has to perform #ifndef check anyway. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: clean up usage()Sami Kerola2013-04-091-23/+21Star
| | | | | | Requested-by: Karel Zak <kzak@redhat.com> References: http://marc.info/?l=util-linux-ng&m=136516351523680&w=2 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: add option to list settable architecturesSami Kerola2013-04-051-3/+15
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* translation: unify exec error messagesSami Kerola2013-02-061-2/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: fix compiler warning [-Wmissing-prototypes]Karel Zak2012-07-161-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: disallow unknown command line optionsSami Kerola2012-06-171-1/+6
| | | | | | | | | | Exit with instruction to run --help if unknown option is encountered. Before the following example printed error, but resulted to an attempt to run argument. $ x86_64 -x ls Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: do not use -1 as array index [cppcheck]Sami Kerola2012-06-091-3/+3
| | | | | | | | | Negative array index does technically work, but looks awkward and can confuse static analyser such as cppcheck. [sys-utils/setarch.c:267]: (error) Array index -1 is out of bounds Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* sys-utils: verify writing to streams was successfulSami Kerola2012-04-041-0/+2
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: minor changes to usage()Karel Zak2011-09-271-6/+9
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add version printingSami Kerola2011-09-101-2/+15
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: use program_invocation_short_nameSami Kerola2011-09-101-13/+2Star
| | | | | | Trust that the c.h is setting program name correctly. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: move options struct to function scopeSami Kerola2011-09-101-21/+21
| | | | Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* setarch: add --uname-2.6 option for personality flag UNAME26Ben Hutchings2011-08-291-3/+15
| | | | | | | [kzak@redhat.com: - minor change in usage()] Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: fix compiler warnings [-Wsign-compare]Karel Zak2011-08-011-3/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fstrim, setarch: replace error() with err()Francesco Cosoleto2011-06-081-9/+8Star
| | | | | | | | | | This should improve a bit the portability as error() is a GNU extension and util-linux provides fallbacks for err.h functions. Fix compilation with icc, broken due to a reference to `__builtin_va_arg_pack' in error.h using the -gcc default option. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* move struct option to .rodataKarel Zak2011-03-031-1/+1
| | | | | | | It does not make sense to have writable large arrays of "struct option" on the stack. Signed-off-by: Karel Zak <kzak@redhat.com>
* rename util-linux-ng back to util-linuxKarel Zak2010-11-301-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add fallback for linux/personalityKarel Zak2008-05-131-0/+32
| | | | | | | | | | | | | | setarch.c:248: error: 'ADDR_NO_RANDOMIZE' undeclared (first use in this function) setarch.c:248: error: (Each undeclared identifier is reported only once setarch.c:248: error: for each function it appears in.) setarch.c:251: error: 'FDPIC_FUNCPTRS' undeclared (first use in this function) setarch.c:257: error: 'ADDR_COMPAT_LAYOUT' undeclared (first use in this function) setarch.c:260: error: 'READ_IMPLIES_EXEC' undeclared (first use in this function) Linux gzp1 2.4.36.1-gzp1 #1 SMP Tue Feb 19 10:23:48 CET 2008 i686 GNU/Linux Reported-By: Gabor Z. Papp <gzp@papp.hu> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: provide backwards compatibilityDmitry V. Levin2008-04-161-1/+1
| | | | | | | | | | | | | | | | | | | | | The getopt_long(3) use introduced by commit 8df90dec2bfd8c876ddd4cea010f40550d4e24aa broke backwards compatibility. Old behavior: $ i386 uname -m i686 New behavior: $ i386 uname -m i386: invalid option -- m Linux Traditional method to fix it is to disable program arguments reordering by prefixing getopt_long's optstring with '+' character. Signed-off-by: Dmitry V. Levin <ldv@altlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add missing alpha subarchsOliver Falk2007-12-031-0/+4
| | | | | Signed-off-by: Oliver Falk <oliver@linux-kernel.at> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: tweak the help text, and gettextize a forgotten messageBenno Schulenberg2007-11-061-6/+6
| | | | Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
* setarch: fix compiler warningLaMont Jones2007-09-231-1/+1
| | | | | | | NULL is not 0L. It's (void*)0. Passing that as a parameter to a function that takes an unsigned long results in a warning about the lack of a cast. Signed-off-by: LaMont Jones <lamont@debian.org>
* build-sys: remove hardcoded _GNU_SOURCEKarel Zak2007-09-201-4/+0Star
| | | | | | We have AC_GNU_SOURCE, so we needn't any extra hardcoded _GNU_SOURCE. Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add long options to setarch and update manpageKarel Zak2007-09-051-53/+90
| | | | | | Co-Author: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add --3gb option fot compatibility with Debian linux{32,64} commandKarel Zak2007-08-271-0/+8
| | | | | | | | | | | | 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 <lamont@mmjgroup.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: finish adding parisc supportKarel Zak2007-08-271-1/+2
| | | | | Signed-off-by: LaMont Jones <lamont@mmjgroup.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add parisc/parisc64 supportLaMont Jones2007-08-271-0/+4
| | | | Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
* setarch: cleanup licensing noteKarel Zak2007-08-211-2/+15
| | | | | Signed-off-by: Jindrich Novy <jnovy@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add __alpha__ supportBalint Cristian2007-08-211-0/+3
| | | | | Signed-off-by: Balint Cristian <cbalint@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add sparc32bash alias to keep compatibility with sparc32Dennis Gilmore2007-08-211-0/+9
| | | | | Signed-off-by: Dennis Gilmore <dennis@ausil.us> Signed-off-by: Karel Zak <kzak@redhat.com>
* setarch: add NLS supportKarel Zak2007-07-031-11/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* sys-utils: added setarch commandKarel Zak2007-07-021-0/+216
This patch merges setarch command to util-linux-ng code. Signed-off-by: Karel Zak <kzak@redhat.com>