blob: 5a9545a0d6f5ca1018dad15eb10497c21e91ae88 [file] [log] [blame]
Fei Jie275d1352016-03-09 14:07:06 +08001#include "tests.h"
2#include <sys/syscall.h>
3
4#ifdef __NR_acct
5
6# include <assert.h>
7# include <errno.h>
8# include <stdio.h>
9# include <unistd.h>
10
11# define TMP_FILE "acct_tmpfile"
12
13int
14main(void)
15{
16 assert(syscall(__NR_acct, TMP_FILE) == -1);
17 const char *errno_text;
18 switch(errno) {
19 case ENOSYS:
20 errno_text = "ENOSYS";
21 break;
22 case EPERM:
23 errno_text = "EPERM";
24 break;
25 default:
26 errno_text = "ENOENT";
27 }
28 printf("acct(\"%s\") = -1 %s (%m)\n",
29 TMP_FILE, errno_text);
30
31 puts("+++ exited with 0 +++");
32 return 0;
33}
34
35#else
36
37SKIP_MAIN_UNDEFINED("__NR__acct")
38
39#endif