blob: dfa9d1a685629fefbadf62c1fbaff8019394dcca [file] [log] [blame]
Fei Jiea067b8d2016-03-31 16:06:49 +08001#include "tests.h"
Dmitry V. Levin6a2f43c2016-08-09 14:38:29 +00002#include <asm/unistd.h>
Fei Jiea067b8d2016-03-31 16:06:49 +08003
4#ifdef __NR_sethostname
5
Fei Jiea067b8d2016-03-31 16:06:49 +08006# include <stdio.h>
7# include <unistd.h>
8
9int
10main(void)
11{
Dmitry V. Levin60b91872016-04-21 21:22:50 +000012 long rc = syscall(__NR_sethostname, 0, 63);
13 printf("sethostname(NULL, 63) = %ld %s (%m)\n",
14 rc, errno2name());
Fei Jiea067b8d2016-03-31 16:06:49 +080015
16 puts("+++ exited with 0 +++");
17 return 0;
18}
19
20#else
21
22SKIP_MAIN_UNDEFINED("__NR_sethostname")
23
24#endif