summaryrefslogtreecommitdiffstats
path: root/linux/what-architecture-am-i-using
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-12-07 20:35:16 +0100
committerMattias Andrée <maandree@kth.se>2023-12-07 20:35:16 +0100
commit225f1408e03f2e66198f3da20c42a746e2729ab0 (patch)
treeebd6bd4b576c85159e852103ce21d4515484d853 /linux/what-architecture-am-i-using
parentThird commit (diff)
downloadlibsyscalls-225f1408e03f2e66198f3da20c42a746e2729ab0.tar.gz
libsyscalls-225f1408e03f2e66198f3da20c42a746e2729ab0.tar.bz2
libsyscalls-225f1408e03f2e66198f3da20c42a746e2729ab0.tar.xz
Fourth commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'linux/what-architecture-am-i-using')
-rwxr-xr-xlinux/what-architecture-am-i-using7
1 files changed, 7 insertions, 0 deletions
diff --git a/linux/what-architecture-am-i-using b/linux/what-architecture-am-i-using
index 1c7a9ba..646c9e7 100755
--- a/linux/what-architecture-am-i-using
+++ b/linux/what-architecture-am-i-using
@@ -9,6 +9,13 @@ if uname -s | grep -i linux > /dev/null; then
if test "$arch" = x86_64; then
printf '%s\n' AMD64
if test $# = 0 || "$@"; then
+ if test ! -f /proc/config.gz; then
+ printf '%s\n' '/proc/config.gz is missing' >&2
+ exit 1
+ elif test ! -r /proc/config.gz; then
+ printf '%s\n' '/proc/config.gz is not readable' >&2
+ exit 1
+ fi
if test $# = 0 || gunzip < /proc/config.gz | grep '^CONFIG_X86_X32_ABI=y$' > /dev/null; then
printf '%s\n' AMD64_X32
fi