URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [sysdeps/] [getdnnm.c] - Rev 1780
Go to most recent revision | Compare with Previous | Blame | View Log
#include <string.h> #include <unistd.h> #include <sys/utsname.h> #include <errno.h> int getdomainname(char *name, size_t len) { struct utsname uts; if (name == NULL) { errno = EINVAL; return -1; } if (uname(&uts) == -1) return -1; if (strlen(uts.domainname)+1 > len) { errno = EINVAL; return -1; } strcpy(name, uts.domainname); return 0; }
Go to most recent revision | Compare with Previous | Blame | View Log