source: trunk/src/emx/src/lib/misc/uname.c@ 18

Last change on this file since 18 was 18, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 824 bytes
Line 
1/* uname.c (emx+gcc) -- Copyright (c) 1993 by Kai Uwe Rommel */
2/* Copyright (c) 1993-1995 by Eberhard Mattes */
3
4#include <stdlib.h>
5#include <string.h>
6#include <sys/utsname.h>
7
8#define SET(dst,src) _strncpy (name->dst, (src), sizeof (name->dst))
9#define CHR(x) (char)((x)+'0')
10
11int _uname (struct utsname *name)
12{
13 char *host;
14 int dos;
15
16 dos = (_osmode == DOS_MODE && _osmajor < 10);
17 host = getenv ("HOSTNAME");
18 if (host == NULL)
19 host = "standalone";
20
21 SET (sysname, (dos ? "MS-DOS" : "OS/2"));
22 SET (nodename, host);
23 SET (release, "1");
24 name->version[0] = (dos ? CHR (_osmajor) : CHR (_osmajor / 10));
25 name->version[1] = '.';
26 name->version[2] = CHR (_osminor / 10);
27 name->version[3] = CHR (_osminor % 10);
28 name->version[4] = 0;
29 SET (machine, "i386");
30 return 0;
31}
Note: See TracBrowser for help on using the repository browser.