Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/coreutils/uname.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/coreutils/uname.c
r821 r1770 1 1 /* vi: set sw=4 ts=4: */ 2 2 /* uname -- print system information 3 Copyright (C) 1989-1999 Free Software Foundation, Inc. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program; if not, write to the Free Software Foundation, 17 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 3 * Copyright (C) 1989-1999 Free Software Foundation, Inc. 4 * 5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 6 */ 18 7 19 8 /* BB_AUDIT SUSv3 compliant */ … … 42 31 */ 43 32 44 #include <stdio.h>45 #include <stdlib.h>46 #include <stddef.h>47 #include <string.h>48 #include <unistd.h>49 #include <sys/types.h>50 33 #include <sys/utsname.h> 51 #include " busybox.h"34 #include "libbb.h" 52 35 53 36 typedef struct { … … 56 39 } uname_info_t; 57 40 58 static const char options[] = "snrvmpa";59 static const unsigned short int utsname_offset[]= {41 static const char options[] ALIGN1 = "snrvmpa"; 42 static const unsigned short utsname_offset[] ALIGN2 = { 60 43 offsetof(uname_info_t,name.sysname), 61 44 offsetof(uname_info_t,name.nodename), … … 66 49 }; 67 50 51 int uname_main(int argc, char **argv); 68 52 int uname_main(int argc, char **argv) 69 53 { … … 75 59 char toprint; 76 60 77 toprint = bb_getopt_ulflags(argc,argv, options);61 toprint = getopt32(argv, options); 78 62 79 63 if (argc != optind) { … … 103 87 strcpy(uname_info.processor, "unknown"); 104 88 105 delta =utsname_offset;89 delta = utsname_offset; 106 90 do { 107 91 if (toprint & 1) { 108 bb_printf(((char *)(&uname_info)) + *delta);92 printf(((char *)(&uname_info)) + *delta); 109 93 if (toprint > 1) { 110 94 putchar(' '); … … 115 99 putchar('\n'); 116 100 117 bb_fflush_stdout_and_exit(EXIT_SUCCESS);101 fflush_stdout_and_exit(EXIT_SUCCESS); 118 102 }
Note:
See TracChangeset
for help on using the changeset viewer.