source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/misc/getdomainname.c@ 352

Last change on this file since 352 was 352, checked in by coas-nagasima, 6 years ago

arm向けASP3版ECNLを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc;charset=UTF-8
File size: 312 bytes
Line 
1#define _GNU_SOURCE
2#include <unistd.h>
3#include <sys/utsname.h>
4#include <string.h>
5#include <errno.h>
6
7int getdomainname(char *name, size_t len)
8{
9 struct utsname temp;
10 uname(&temp);
11 if (!len || strlen(temp.domainname) >= len) {
12 errno = EINVAL;
13 return -1;
14 }
15 strcpy(name, temp.domainname);
16 return 0;
17}
Note: See TracBrowser for help on using the repository browser.