blob: 3e21d9fbe5f6c93e96a2dc2f76ae8e35f53d2a3f [file] [log] [blame]
Fei Jiea067b8d2016-03-31 16:06:49 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#ifdef __NR_sethostname
5
6# include <errno.h>
7# include <stdio.h>
8# include <unistd.h>
9
10int
11main(void)
12{
Dmitry V. Levin60b91872016-04-21 21:22:50 +000013 long rc = syscall(__NR_sethostname, 0, 63);
14 printf("sethostname(NULL, 63) = %ld %s (%m)\n",
15 rc, errno2name());
Fei Jiea067b8d2016-03-31 16:06:49 +080016
17 puts("+++ exited with 0 +++");
18 return 0;
19}
20
21#else
22
23SKIP_MAIN_UNDEFINED("__NR_sethostname")
24
25#endif