blob: b79789bb801a1be73690f4391b4e9d85c80379a0 [file] [log] [blame]
Fei Jie9a883712016-03-25 17:46:19 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#ifdef __NR_syslog
5
6# include <errno.h>
7# include <stdio.h>
8# include <unistd.h>
9
10# define SYSLOG_ACTION_READ 2
11
12int
13main(void)
14{
Dmitry V. Levin86a09012016-04-21 21:26:52 +000015 const long addr = (long) 0xfacefeeddeadbeef;
16 int rc = syscall(__NR_syslog, SYSLOG_ACTION_READ, addr, -1);
17 printf("syslog(SYSLOG_ACTION_READ, %#lx, -1) = %d %s (%m)\n",
18 addr, rc, errno2name());
Fei Jie9a883712016-03-25 17:46:19 +080019
20 puts("+++ exited with 0 +++");
21 return 0;
22}
23
24#else
25
26SKIP_MAIN_UNDEFINED("__NR_syslog")
27
28#endif