X-Git-Url: https://git.saurik.com/apple/shell_cmds.git/blobdiff_plain/41a2c555d8993b200d28bf1fa33eebd8388950f7..ddb4a88b2f582f98073e02a797c5299d71d9527e:/uname/uname.c diff --git a/uname/uname.c b/uname/uname.c index 6c89b81..ddca5fd 100644 --- a/uname/uname.c +++ b/uname/uname.c @@ -43,6 +43,9 @@ __RCSID("$NetBSD: uname.c,v 1.10 1998/11/09 13:24:05 kleink Exp $"); #include #include #include +#ifdef __APPLE__ +#include +#endif /* __APPLE__ */ #include #include @@ -137,7 +140,9 @@ main(argc, argv) &len, NULL, 0) < 0) err(EXIT_FAILURE, "sysctl"); } -#else /* __APPLE__ */ +#endif /* !__APPLE__ */ + +#ifdef __APPLE__ /* * Let's allow the user to override the output of uname via the shell environment. * This is a useful feature for cross-compiling (eg. during an OS bringup). @@ -151,7 +156,7 @@ main(argc, argv) s = getenv ("UNAME_VERSION"); if (s) strncpy (u.version, s, sizeof (u.version)); s = getenv ("UNAME_MACHINE"); if (s) strncpy (u.machine, s, sizeof (u.machine)); } -#endif /* !__APPLE__ */ +#endif /* __APPLE__ */ if (print_mask & PRINT_SYSNAME) { space++; @@ -178,10 +183,12 @@ main(argc, argv) #ifndef __APPLE__ fputs(machine_arch, stdout); #else -#if defined(__ppc__) +#if defined(__ppc__) || defined(__ppc64__) fputs("powerpc", stdout); -#elif defined(__i386__) +#elif defined (__i386__) || defined(__x86_64__) fputs("i386", stdout); +#elif defined(__arm__) + fputs("arm", stdout); #else fputs("unknown", stdout); #endif