[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

r1280 - trunk/glibc-2.3-head/sysdeps/kfreebsd



Author: rmh
Date: 2006-03-01 15:01:01 +0000 (Wed, 01 Mar 2006)
New Revision: 1280

Modified:
   trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c
Log:
Always return "x86_64" for name->machine on amd64 platform.

Modified: trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c
===================================================================
--- trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c	2006-02-28 20:53:00 UTC (rev 1279)
+++ trunk/glibc-2.3-head/sysdeps/kfreebsd/uname.c	2006-03-01 15:01:01 UTC (rev 1280)
@@ -84,6 +84,14 @@
       }
   }
 
+#ifdef __x86_64__
+  /* Check for bounds in pre-processor */
+# if 7 > _UTSNAME_MACHINE_LENGTH
+#  error
+# endif
+  /* Pristine FreeBSD kernel would return "amd64".  Avoid that.  */
+  strcpy (name->machine, "x86_64");
+#else
   /* Fill machine: "uname -m".  Fetch sysctl "hw.machine".  */
   request[0] = CTL_HW;
   request[1] = HW_MACHINE;
@@ -93,6 +101,7 @@
       if (len < sizeof (name->machine))
         name->machine[len] = '\0';
     }
+#endif
 
   return 0;
 }



Reply to: