Ticket #1250: uname.c.diff
File uname.c.diff, 1010 bytes (added by , 17 years ago) |
---|
-
src/system/libroot/posix/sys/uname.c
10 10 #include <errno.h> 11 11 #include <stdio.h> 12 12 #include <string.h> 13 #include <unistd.h> 13 14 14 15 15 // Haiku SVN revision. Will be set when copying libroot.so to the image. 16 16 // Lives in a separate section so that it can easily be found. 17 17 static uint32 sHaikuRevision __attribute__((section("_haiku_revision"))); … … 23 23 { 24 24 system_info systemInfo; 25 25 const char *platform; 26 char hostname[_SYS_NAMELEN]; 26 27 27 28 if (!info) { 28 29 errno = B_BAD_VALUE; … … 61 62 } 62 63 strlcpy(info->machine, platform, sizeof(info->machine)); 63 64 64 // TODO fill nodename field when we have hostname info65 strlcpy(info->nodename, "unknown", sizeof(info->nodename));66 65 gethostname(hostname, _SYS_NAMELEN); 66 strlcpy(info->nodename, hostname, sizeof(info->nodename)); 67 67 68 return 0; 68 69 } 69 70