-static void print_element(unsigned int mask, char *element);
-
-/* Values that are bitwise or'd into `toprint'. */
-/* Operating system name. */
-static const int PRINT_SYSNAME = 1;
-
-/* Node name on a communications network. */
-static const int PRINT_NODENAME = 2;
-
-/* Operating system release. */
-static const int PRINT_RELEASE = 4;
-
-/* Operating system version. */
-static const int PRINT_VERSION = 8;
-
-/* Machine hardware name. */
-static const int PRINT_MACHINE = 16;
-
- /* Host processor type. */
-static const int PRINT_PROCESSOR = 32;
-
-/* Mask indicating which elements of the name to print. */
-static unsigned char toprint;
-
+typedef struct {
+ struct utsname name;
+ char processor[8]; /* for "unknown" */
+} uname_info_t;
+
+static const char options[] = "snrvmpa";
+static const char flags[] = "\x01\x02\x04\x08\x10\x20\x3f";
+static const unsigned short int utsname_offset[] = {
+ offsetof(uname_info_t,name.sysname),
+ offsetof(uname_info_t,name.nodename),
+ offsetof(uname_info_t,name.release),
+ offsetof(uname_info_t,name.version),
+ offsetof(uname_info_t,name.machine),
+ offsetof(uname_info_t,processor)
+};