Browse Source

Declare syscall parsers using SYS_FUNC macro

Introduce SYS_FUNC macro to declare and define all syscall parsers.

* Makefile.am (BUILT_SOURCES, CLEANFILES): Add sys_func.h.
(sys_func.h): New rule.
* defs.h (SYS_FUNC_NAME, SYS_FUNC): New macros.
* linux/syscall.h: Include "sys_func.h".
[NEED_UID16_PARSERS]: Use SYS_FUNC to declare uid16 syscall parsers.
Remove other declarations.
* linux/alpha/syscallent.h (160, 161): Add sys_ prefix to osf_statfs
and osf_fstatfs syscall parsers.
* *.c: Use SYS_FUNC to define syscall parsers.
Dmitry V. Levin 4 years ago
parent
commit
a0bd3749fc
78 changed files with 335 additions and 938 deletions
  1. 9
    2
      Makefile.am
  2. 2
    4
      access.c
  3. 2
    4
      affinity.c
  4. 5
    10
      aio.c
  5. 5
    10
      bjm.c
  6. 3
    6
      cacheflush.c
  7. 2
    4
      capability.c
  8. 1
    2
      chdir.c
  9. 3
    6
      chmod.c
  10. 4
    8
      clone.c
  11. 6
    0
      defs.h
  12. 19
    38
      desc.c
  13. 3
    6
      dirent.c
  14. 2
    4
      execve.c
  15. 1
    2
      exit.c
  16. 2
    4
      fadvise.c
  17. 1
    2
      fallocate.c
  18. 2
    4
      fanotify.c
  19. 1
    2
      fchownat.c
  20. 11
    22
      file.c
  21. 1
    2
      futex.c
  22. 1
    2
      get_robust_list.c
  23. 1
    2
      getcpu.c
  24. 1
    2
      getcwd.c
  25. 1
    2
      getrandom.c
  26. 2
    4
      hostname.c
  27. 3
    6
      inotify.c
  28. 14
    28
      io.c
  29. 2
    4
      ioprio.c
  30. 18
    24
      ipc.c
  31. 1
    2
      kexec.c
  32. 3
    6
      keyctl.c
  33. 5
    10
      ldt.c
  34. 4
    8
      link.c
  35. 2
    2
      linux/alpha/syscallent.h
  36. 11
    335
      linux/syscall.h
  37. 3
    6
      lseek.c
  38. 21
    42
      mem.c
  39. 3
    6
      mknod.c
  40. 1
    2
      mount.c
  41. 21
    42
      net.c
  42. 3
    6
      open.c
  43. 1
    1
      or1k_atomic.c
  44. 1
    2
      personality.c
  45. 2
    4
      prctl.c
  46. 1
    2
      process.c
  47. 2
    4
      process_vm.c
  48. 1
    2
      quota.c
  49. 1
    2
      readahead.c
  50. 2
    4
      readlink.c
  51. 1
    2
      reboot.c
  52. 2
    4
      renameat.c
  53. 8
    16
      resource.c
  54. 6
    12
      sched.c
  55. 1
    2
      seccomp.c
  56. 1
    2
      sigaltstack.c
  57. 19
    37
      signal.c
  58. 1
    2
      sigreturn.c
  59. 1
    2
      sock.c
  60. 1
    2
      sram_alloc.c
  61. 6
    12
      statfs.c
  62. 7
    14
      stream.c
  63. 1
    2
      swapon.c
  64. 2
    4
      sync_file_range.c
  65. 1
    2
      sysctl.c
  66. 1
    2
      sysinfo.c
  67. 1
    2
      syslog.c
  68. 1
    1
      sysmips.c
  69. 23
    46
      time.c
  70. 4
    8
      truncate.c
  71. 10
    20
      uid.c
  72. 1
    2
      umask.c
  73. 1
    2
      umount.c
  74. 1
    2
      uname.c
  75. 1
    2
      utime.c
  76. 4
    8
      utimes.c
  77. 4
    8
      wait.c
  78. 8
    16
      xattr.c

+ 9
- 2
Makefile.am View File

@@ -555,11 +555,18 @@ EXTRA_DIST =				\
555 555
 srpm: dist-xz
556 556
 	rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
557 557
 
558
-BUILT_SOURCES = .version
558
+BUILT_SOURCES = .version sys_func.h
559 559
 
560 560
 $(srcdir)/.version:
561 561
 	$(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
562 562
 
563
+strace_SOURCES_c = $(filter %.c,$(strace_SOURCES))
564
+
565
+sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
566
+	for f in $^; do \
567
+		sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
568
+	done | sort -u > $@
569
+
563 570
 dist-hook:
564 571
 	$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
565 572
 
@@ -586,7 +593,7 @@ ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
586 593
 ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
587 594
 ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
588 595
 BUILT_SOURCES += $(ioctlent_h)
589
-CLEANFILES = $(ioctlent_h)
596
+CLEANFILES = sys_func.h $(ioctlent_h)
590 597
 
591 598
 ioctlent%.h: ioctlsort%
592 599
 	./$< > $@

+ 2
- 4
access.c View File

@@ -15,14 +15,12 @@ decode_access(struct tcb *tcp, int offset)
15 15
 	return 0;
16 16
 }
17 17
 
18
-int
19
-sys_access(struct tcb *tcp)
18
+SYS_FUNC(access)
20 19
 {
21 20
 	return decode_access(tcp, 0);
22 21
 }
23 22
 
24
-int
25
-sys_faccessat(struct tcb *tcp)
23
+SYS_FUNC(faccessat)
26 24
 {
27 25
 	if (entering(tcp))
28 26
 		print_dirfd(tcp, tcp->u_arg[0]);

+ 2
- 4
affinity.c View File

@@ -32,8 +32,7 @@ print_affinitylist(struct tcb *tcp, long list, unsigned int len)
32 32
 	}
33 33
 }
34 34
 
35
-int
36
-sys_sched_setaffinity(struct tcb *tcp)
35
+SYS_FUNC(sched_setaffinity)
37 36
 {
38 37
 	if (entering(tcp)) {
39 38
 		tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
@@ -42,8 +41,7 @@ sys_sched_setaffinity(struct tcb *tcp)
42 41
 	return 0;
43 42
 }
44 43
 
45
-int
46
-sys_sched_getaffinity(struct tcb *tcp)
44
+SYS_FUNC(sched_getaffinity)
47 45
 {
48 46
 	if (entering(tcp)) {
49 47
 		tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);

+ 5
- 10
aio.c View File

@@ -38,8 +38,7 @@
38 38
 # define IOCB_RESFD (1 << 0)
39 39
 #endif
40 40
 
41
-int
42
-sys_io_setup(struct tcb *tcp)
41
+SYS_FUNC(io_setup)
43 42
 {
44 43
 	if (entering(tcp))
45 44
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -57,8 +56,7 @@ sys_io_setup(struct tcb *tcp)
57 56
 	return 0;
58 57
 }
59 58
 
60
-int
61
-sys_io_destroy(struct tcb *tcp)
59
+SYS_FUNC(io_destroy)
62 60
 {
63 61
 	if (entering(tcp))
64 62
 		tprintf("%lu", tcp->u_arg[0]);
@@ -112,8 +110,7 @@ print_common_flags(struct iocb *iocb)
112 110
 
113 111
 #endif /* HAVE_LIBAIO_H */
114 112
 
115
-int
116
-sys_io_submit(struct tcb *tcp)
113
+SYS_FUNC(io_submit)
117 114
 {
118 115
 	if (entering(tcp)) {
119 116
 #ifdef HAVE_LIBAIO_H
@@ -197,8 +194,7 @@ sys_io_submit(struct tcb *tcp)
197 194
 	return 0;
198 195
 }
199 196
 
200
-int
201
-sys_io_cancel(struct tcb *tcp)
197
+SYS_FUNC(io_cancel)
202 198
 {
203 199
 	if (entering(tcp)) {
204 200
 #ifdef HAVE_LIBAIO_H
@@ -232,8 +228,7 @@ sys_io_cancel(struct tcb *tcp)
232 228
 	return 0;
233 229
 }
234 230
 
235
-int
236
-sys_io_getevents(struct tcb *tcp)
231
+SYS_FUNC(io_getevents)
237 232
 {
238 233
 	if (entering(tcp)) {
239 234
 		tprintf("%ld, %ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1],

+ 5
- 10
bjm.c View File

@@ -72,8 +72,7 @@ struct module_info
72 72
 #include "xlat/modflags.h"
73 73
 #include "xlat/delete_module_flags.h"
74 74
 
75
-int
76
-sys_query_module(struct tcb *tcp)
75
+SYS_FUNC(query_module)
77 76
 {
78 77
 	if (entering(tcp)) {
79 78
 		printstr(tcp, tcp->u_arg[0], -1);
@@ -163,8 +162,7 @@ sys_query_module(struct tcb *tcp)
163 162
 	return 0;
164 163
 }
165 164
 
166
-int
167
-sys_create_module(struct tcb *tcp)
165
+SYS_FUNC(create_module)
168 166
 {
169 167
 	if (entering(tcp)) {
170 168
 		printpath(tcp, tcp->u_arg[0]);
@@ -173,8 +171,7 @@ sys_create_module(struct tcb *tcp)
173 171
 	return RVAL_HEX;
174 172
 }
175 173
 
176
-int
177
-sys_delete_module(struct tcb *tcp)
174
+SYS_FUNC(delete_module)
178 175
 {
179 176
 	if (entering(tcp)) {
180 177
 		printstr(tcp, tcp->u_arg[0], -1);
@@ -184,8 +181,7 @@ sys_delete_module(struct tcb *tcp)
184 181
 	return 0;
185 182
 }
186 183
 
187
-int
188
-sys_init_module(struct tcb *tcp)
184
+SYS_FUNC(init_module)
189 185
 {
190 186
 	if (entering(tcp)) {
191 187
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
@@ -199,8 +195,7 @@ sys_init_module(struct tcb *tcp)
199 195
 
200 196
 #include "xlat/module_init_flags.h"
201 197
 
202
-int
203
-sys_finit_module(struct tcb *tcp)
198
+SYS_FUNC(finit_module)
204 199
 {
205 200
 	if (exiting(tcp))
206 201
 		return 0;

+ 3
- 6
cacheflush.c View File

@@ -20,8 +20,7 @@ static const struct xlat cacheflush_flags[] = {
20 20
 	XLAT_END
21 21
 };
22 22
 
23
-int
24
-sys_cacheflush(struct tcb *tcp)
23
+SYS_FUNC(cacheflush)
25 24
 {
26 25
 	if (entering(tcp)) {
27 26
 		/* addr */
@@ -46,8 +45,7 @@ static const struct xlat cacheflush_flags[] = {
46 45
 	XLAT_END
47 46
 };
48 47
 
49
-int
50
-sys_cacheflush(struct tcb *tcp)
48
+SYS_FUNC(cacheflush)
51 49
 {
52 50
 	if (entering(tcp)) {
53 51
 		/* start addr */
@@ -78,8 +76,7 @@ static const struct xlat cacheflush_flags[] = {
78 76
 	XLAT_END
79 77
 };
80 78
 
81
-int
82
-sys_cacheflush(struct tcb *tcp)
79
+SYS_FUNC(cacheflush)
83 80
 {
84 81
 	if (entering(tcp)) {
85 82
 		/* addr */

+ 2
- 4
capability.c View File

@@ -117,8 +117,7 @@ print_cap_data(struct tcb *tcp, unsigned long addr, const cap_user_header_t h)
117 117
 	tprints("}");
118 118
 }
119 119
 
120
-int
121
-sys_capget(struct tcb *tcp)
120
+SYS_FUNC(capget)
122 121
 {
123 122
 	cap_user_header_t h;
124 123
 
@@ -133,8 +132,7 @@ sys_capget(struct tcb *tcp)
133 132
 	return 0;
134 133
 }
135 134
 
136
-int
137
-sys_capset(struct tcb *tcp)
135
+SYS_FUNC(capset)
138 136
 {
139 137
 	if (entering(tcp)) {
140 138
 		cap_user_header_t h = get_cap_header(tcp, tcp->u_arg[0]);

+ 1
- 2
chdir.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_chdir(struct tcb *tcp)
3
+SYS_FUNC(chdir)
5 4
 {
6 5
 	if (entering(tcp)) {
7 6
 		printpath(tcp, tcp->u_arg[0]);

+ 3
- 6
chmod.c View File

@@ -10,22 +10,19 @@ decode_chmod(struct tcb *tcp, int offset)
10 10
 	return 0;
11 11
 }
12 12
 
13
-int
14
-sys_chmod(struct tcb *tcp)
13
+SYS_FUNC(chmod)
15 14
 {
16 15
 	return decode_chmod(tcp, 0);
17 16
 }
18 17
 
19
-int
20
-sys_fchmodat(struct tcb *tcp)
18
+SYS_FUNC(fchmodat)
21 19
 {
22 20
 	if (entering(tcp))
23 21
 		print_dirfd(tcp, tcp->u_arg[0]);
24 22
 	return decode_chmod(tcp, 1);
25 23
 }
26 24
 
27
-int
28
-sys_fchmod(struct tcb *tcp)
25
+SYS_FUNC(fchmod)
29 26
 {
30 27
 	if (entering(tcp)) {
31 28
 		printfd(tcp, tcp->u_arg[0]);

+ 4
- 8
clone.c View File

@@ -68,8 +68,7 @@
68 68
 extern void print_user_desc(struct tcb *, long);
69 69
 #endif /* I386 || X86_64 || X32 */
70 70
 
71
-int
72
-sys_clone(struct tcb *tcp)
71
+SYS_FUNC(clone)
73 72
 {
74 73
 	if (exiting(tcp)) {
75 74
 		const char *sep = "|";
@@ -123,8 +122,7 @@ sys_clone(struct tcb *tcp)
123 122
 	return 0;
124 123
 }
125 124
 
126
-int
127
-sys_setns(struct tcb *tcp)
125
+SYS_FUNC(setns)
128 126
 {
129 127
 	if (entering(tcp)) {
130 128
 		printfd(tcp, tcp->u_arg[0]);
@@ -134,16 +132,14 @@ sys_setns(struct tcb *tcp)
134 132
 	return 0;
135 133
 }
136 134
 
137
-int
138
-sys_unshare(struct tcb *tcp)
135
+SYS_FUNC(unshare)
139 136
 {
140 137
 	if (entering(tcp))
141 138
 		printflags(clone_flags, tcp->u_arg[0], "CLONE_???");
142 139
 	return 0;
143 140
 }
144 141
 
145
-int
146
-sys_fork(struct tcb *tcp)
142
+SYS_FUNC(fork)
147 143
 {
148 144
 	if (exiting(tcp))
149 145
 		return RVAL_UDECIMAL;

+ 6
- 0
defs.h View File

@@ -673,3 +673,9 @@ extern unsigned num_quals;
673 673
 /* Only ensures that sysent[scno] isn't out of range */
674 674
 #define SCNO_IN_RANGE(scno) \
675 675
 	((unsigned long)(scno) < nsyscalls)
676
+
677
+#ifndef SYS_FUNC_NAME
678
+# define SYS_FUNC_NAME(syscall_name) sys_ ## syscall_name
679
+#endif
680
+
681
+#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(syscall_name)(struct tcb *tcp)

+ 19
- 38
desc.c View File

@@ -145,8 +145,7 @@ printflock(struct tcb *tcp, long addr, int getlk)
145 145
 		tprints("}");
146 146
 }
147 147
 
148
-int
149
-sys_fcntl(struct tcb *tcp)
148
+SYS_FUNC(fcntl)
150 149
 {
151 150
 	if (entering(tcp)) {
152 151
 		printfd(tcp, tcp->u_arg[0]);
@@ -244,8 +243,7 @@ sys_fcntl(struct tcb *tcp)
244 243
 
245 244
 #ifdef LOCK_SH
246 245
 
247
-int
248
-sys_flock(struct tcb *tcp)
246
+SYS_FUNC(flock)
249 247
 {
250 248
 	if (entering(tcp)) {
251 249
 		printfd(tcp, tcp->u_arg[0]);
@@ -256,8 +254,7 @@ sys_flock(struct tcb *tcp)
256 254
 }
257 255
 #endif /* LOCK_SH */
258 256
 
259
-int
260
-sys_close(struct tcb *tcp)
257
+SYS_FUNC(close)
261 258
 {
262 259
 	if (entering(tcp)) {
263 260
 		printfd(tcp, tcp->u_arg[0]);
@@ -265,8 +262,7 @@ sys_close(struct tcb *tcp)
265 262
 	return 0;
266 263
 }
267 264
 
268
-int
269
-sys_dup(struct tcb *tcp)
265
+SYS_FUNC(dup)
270 266
 {
271 267
 	if (entering(tcp)) {
272 268
 		printfd(tcp, tcp->u_arg[0]);
@@ -289,21 +285,18 @@ do_dup2(struct tcb *tcp, int flags_arg)
289 285
 	return RVAL_FD;
290 286
 }
291 287
 
292
-int
293
-sys_dup2(struct tcb *tcp)
288
+SYS_FUNC(dup2)
294 289
 {
295 290
 	return do_dup2(tcp, -1);
296 291
 }
297 292
 
298
-int
299
-sys_dup3(struct tcb *tcp)
293
+SYS_FUNC(dup3)
300 294
 {
301 295
 	return do_dup2(tcp, 2);
302 296
 }
303 297
 
304 298
 #if defined(ALPHA)
305
-int
306
-sys_getdtablesize(struct tcb *tcp)
299
+SYS_FUNC(getdtablesize)
307 300
 {
308 301
 	return 0;
309 302
 }
@@ -440,8 +433,7 @@ decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
440 433
 	return 0;
441 434
 }
442 435
 
443
-int
444
-sys_oldselect(struct tcb *tcp)
436
+SYS_FUNC(oldselect)
445 437
 {
446 438
 	long args[5];
447 439
 
@@ -453,8 +445,7 @@ sys_oldselect(struct tcb *tcp)
453 445
 }
454 446
 
455 447
 #ifdef ALPHA
456
-int
457
-sys_osf_select(struct tcb *tcp)
448
+SYS_FUNC(osf_select)
458 449
 {
459 450
 	long *args = tcp->u_arg;
460 451
 	return decode_select(tcp, args, BITNESS_32);
@@ -466,14 +457,12 @@ sys_osf_select(struct tcb *tcp)
466 457
 #include "xlat/epollflags.h"
467 458
 
468 459
 /* Not aliased to printargs_ld: we want it to have a distinct address */
469
-int
470
-sys_epoll_create(struct tcb *tcp)
460
+SYS_FUNC(epoll_create)
471 461
 {
472 462
 	return printargs_ld(tcp);
473 463
 }
474 464
 
475
-int
476
-sys_epoll_create1(struct tcb *tcp)
465
+SYS_FUNC(epoll_create1)
477 466
 {
478 467
 	if (entering(tcp))
479 468
 		printflags(epollflags, tcp->u_arg[0], "EPOLL_???");
@@ -493,8 +482,7 @@ print_epoll_event(struct epoll_event *ev)
493 482
 }
494 483
 #endif
495 484
 
496
-int
497
-sys_epoll_ctl(struct tcb *tcp)
485
+SYS_FUNC(epoll_ctl)
498 486
 {
499 487
 	if (entering(tcp)) {
500 488
 		printfd(tcp, tcp->u_arg[0]);
@@ -563,15 +551,13 @@ epoll_wait_common(struct tcb *tcp)
563 551
 	}
564 552
 }
565 553
 
566
-int
567
-sys_epoll_wait(struct tcb *tcp)
554
+SYS_FUNC(epoll_wait)
568 555
 {
569 556
 	epoll_wait_common(tcp);
570 557
 	return 0;
571 558
 }
572 559
 
573
-int
574
-sys_epoll_pwait(struct tcb *tcp)
560
+SYS_FUNC(epoll_pwait)
575 561
 {
576 562
 	epoll_wait_common(tcp);
577 563
 	if (exiting(tcp)) {
@@ -583,14 +569,12 @@ sys_epoll_pwait(struct tcb *tcp)
583 569
 	return 0;
584 570
 }
585 571
 
586
-int
587
-sys_select(struct tcb *tcp)
572
+SYS_FUNC(select)
588 573
 {
589 574
 	return decode_select(tcp, tcp->u_arg, BITNESS_CURRENT);
590 575
 }
591 576
 
592
-int
593
-sys_pselect6(struct tcb *tcp)
577
+SYS_FUNC(pselect6)
594 578
 {
595 579
 	int rc = decode_select(tcp, tcp->u_arg, BITNESS_CURRENT);
596 580
 	if (entering(tcp)) {
@@ -636,20 +620,17 @@ do_eventfd(struct tcb *tcp, int flags_arg)
636 620
 	return 0;
637 621
 }
638 622
 
639
-int
640
-sys_eventfd(struct tcb *tcp)
623
+SYS_FUNC(eventfd)
641 624
 {
642 625
 	return do_eventfd(tcp, -1);
643 626
 }
644 627
 
645
-int
646
-sys_eventfd2(struct tcb *tcp)
628
+SYS_FUNC(eventfd2)
647 629
 {
648 630
 	return do_eventfd(tcp, 1);
649 631
 }
650 632
 
651
-int
652
-sys_perf_event_open(struct tcb *tcp)
633
+SYS_FUNC(perf_event_open)
653 634
 {
654 635
 	if (entering(tcp)) {
655 636
 		tprintf("%#lx, %d, %d, %d, ",

+ 3
- 6
dirent.c View File

@@ -38,8 +38,7 @@ print_old_dirent(struct tcb *tcp, long addr)
38 38
 	tprints("}");
39 39
 }
40 40
 
41
-int
42
-sys_readdir(struct tcb *tcp)
41
+SYS_FUNC(readdir)
43 42
 {
44 43
 	if (entering(tcp)) {
45 44
 		printfd(tcp, tcp->u_arg[0]);
@@ -58,8 +57,7 @@ sys_readdir(struct tcb *tcp)
58 57
 
59 58
 #include "xlat/direnttypes.h"
60 59
 
61
-int
62
-sys_getdents(struct tcb *tcp)
60
+SYS_FUNC(getdents)
63 61
 {
64 62
 	unsigned int i, len, dents = 0;
65 63
 	char *buf;
@@ -139,8 +137,7 @@ sys_getdents(struct tcb *tcp)
139 137
 	return 0;
140 138
 }
141 139
 
142
-int
143
-sys_getdents64(struct tcb *tcp)
140
+SYS_FUNC(getdents64)
144 141
 {
145 142
 	/* the minimum size of a valid dirent64 structure */
146 143
 	const unsigned int d_name_offset = offsetof(struct dirent64, d_name);

+ 2
- 4
execve.c View File

@@ -42,8 +42,7 @@ printargc(const char *fmt, struct tcb *tcp, long addr)
42 42
 	tprintf(fmt, count, count == 1 ? "" : "s");
43 43
 }
44 44
 
45
-int
46
-sys_execve(struct tcb *tcp)
45
+SYS_FUNC(execve)
47 46
 {
48 47
 	if (entering(tcp)) {
49 48
 		printpath(tcp, tcp->u_arg[0]);
@@ -68,8 +67,7 @@ sys_execve(struct tcb *tcp)
68 67
 }
69 68
 
70 69
 #if defined(SPARC) || defined(SPARC64)
71
-int
72
-sys_execv(struct tcb *tcp)
70
+SYS_FUNC(execv)
73 71
 {
74 72
 	if (entering(tcp)) {
75 73
 		printpath(tcp, tcp->u_arg[0]);

+ 1
- 2
exit.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_exit(struct tcb *tcp)
3
+SYS_FUNC(exit)
5 4
 {
6 5
 	if (exiting(tcp)) {
7 6
 		fprintf(stderr, "_exit returned!\n");

+ 2
- 4
fadvise.c View File

@@ -4,8 +4,7 @@
4 4
 
5 5
 #include "xlat/advise.h"
6 6
 
7
-int
8
-sys_fadvise64(struct tcb *tcp)
7
+SYS_FUNC(fadvise64)
9 8
 {
10 9
 	if (entering(tcp)) {
11 10
 		int argn;
@@ -17,8 +16,7 @@ sys_fadvise64(struct tcb *tcp)
17 16
 	return 0;
18 17
 }
19 18
 
20
-int
21
-sys_fadvise64_64(struct tcb *tcp)
19
+SYS_FUNC(fadvise64_64)
22 20
 {
23 21
 	if (entering(tcp)) {
24 22
 		int argn;

+ 1
- 2
fallocate.c View File

@@ -6,8 +6,7 @@
6 6
 
7 7
 #include "xlat/falloc_flags.h"
8 8
 
9
-int
10
-sys_fallocate(struct tcb *tcp)
9
+SYS_FUNC(fallocate)
11 10
 {
12 11
 	if (entering(tcp)) {
13 12
 		int argn;

+ 2
- 4
fanotify.c View File

@@ -10,8 +10,7 @@
10 10
 # define FAN_NOFD -1
11 11
 #endif
12 12
 
13
-int
14
-sys_fanotify_init(struct tcb *tcp)
13
+SYS_FUNC(fanotify_init)
15 14
 {
16 15
 	unsigned flags;
17 16
 
@@ -34,8 +33,7 @@ sys_fanotify_init(struct tcb *tcp)
34 33
 #include "xlat/fan_mark_flags.h"
35 34
 #include "xlat/fan_event_flags.h"
36 35
 
37
-int
38
-sys_fanotify_mark(struct tcb *tcp)
36
+SYS_FUNC(fanotify_mark)
39 37
 {
40 38
 	unsigned long long mask = 0;
41 39
 	int argn;

+ 1
- 2
fchownat.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_fchownat(struct tcb *tcp)
3
+SYS_FUNC(fchownat)
5 4
 {
6 5
 	if (entering(tcp)) {
7 6
 		print_dirfd(tcp, tcp->u_arg[0]);

+ 11
- 22
file.c View File

@@ -275,8 +275,7 @@ printstat(struct tcb *tcp, long addr)
275 275
 	do_printstat(tcp, &statbuf);
276 276
 }
277 277
 
278
-int
279
-sys_stat(struct tcb *tcp)
278
+SYS_FUNC(stat)
280 279
 {
281 280
 	if (entering(tcp)) {
282 281
 		printpath(tcp, tcp->u_arg[0]);
@@ -287,8 +286,7 @@ sys_stat(struct tcb *tcp)
287 286
 	return 0;
288 287
 }
289 288
 
290
-int
291
-sys_fstat(struct tcb *tcp)
289
+SYS_FUNC(fstat)
292 290
 {
293 291
 	if (entering(tcp)) {
294 292
 		printfd(tcp, tcp->u_arg[0]);
@@ -385,8 +383,7 @@ printstat64(struct tcb *tcp, long addr)
385 383
 	do_printstat64(tcp, &statbuf);
386 384
 }
387 385
 
388
-int
389
-sys_stat64(struct tcb *tcp)
386
+SYS_FUNC(stat64)
390 387
 {
391 388
 	if (entering(tcp)) {
392 389
 		printpath(tcp, tcp->u_arg[0]);
@@ -397,8 +394,7 @@ sys_stat64(struct tcb *tcp)
397 394
 	return 0;
398 395
 }
399 396
 
400
-int
401
-sys_fstat64(struct tcb *tcp)
397
+SYS_FUNC(fstat64)
402 398
 {
403 399
 	if (entering(tcp)) {
404 400
 		printfd(tcp, tcp->u_arg[0]);
@@ -411,22 +407,19 @@ sys_fstat64(struct tcb *tcp)
411 407
 
412 408
 #else
413 409
 
414
-int
415
-sys_stat64(struct tcb *tcp)
410
+SYS_FUNC(stat64)
416 411
 {
417 412
 	return sys_stat(tcp);
418 413
 }
419 414
 
420
-int
421
-sys_fstat64(struct tcb *tcp)
415
+SYS_FUNC(fstat64)
422 416
 {
423 417
 	return sys_fstat(tcp);
424 418
 }
425 419
 
426 420
 #endif /* HAVE_STRUCT_STAT64 */
427 421
 
428
-int
429
-sys_newfstatat(struct tcb *tcp)
422
+SYS_FUNC(newfstatat)
430 423
 {
431 424
 	if (entering(tcp)) {
432 425
 		print_dirfd(tcp, tcp->u_arg[0]);
@@ -499,8 +492,7 @@ printoldstat(struct tcb *tcp, long addr)
499 492
 	do_printstat(tcp, &newstatbuf);
500 493
 }
501 494
 
502
-int
503
-sys_oldstat(struct tcb *tcp)
495
+SYS_FUNC(oldstat)
504 496
 {
505 497
 	if (entering(tcp)) {
506 498
 		printpath(tcp, tcp->u_arg[0]);
@@ -511,8 +503,7 @@ sys_oldstat(struct tcb *tcp)
511 503
 	return 0;
512 504
 }
513 505
 
514
-int
515
-sys_oldfstat(struct tcb *tcp)
506
+SYS_FUNC(oldfstat)
516 507
 {
517 508
 	if (entering(tcp)) {
518 509
 		printfd(tcp, tcp->u_arg[0]);
@@ -527,8 +518,7 @@ sys_oldfstat(struct tcb *tcp)
527 518
 
528 519
 #if defined(SPARC) || defined(SPARC64)
529 520
 
530
-int
531
-sys_xstat(struct tcb *tcp)
521
+SYS_FUNC(xstat)
532 522
 {
533 523
 	if (entering(tcp)) {
534 524
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -540,8 +530,7 @@ sys_xstat(struct tcb *tcp)
540 530
 	return 0;
541 531
 }
542 532
 
543
-int
544
-sys_fxstat(struct tcb *tcp)
533
+SYS_FUNC(fxstat)
545 534
 {
546 535
 	if (entering(tcp)) {
547 536
 		tprintf("%ld, ", tcp->u_arg[0]);

+ 1
- 2
futex.c View File

@@ -98,8 +98,7 @@
98 98
 #include "xlat/futexwakeops.h"
99 99
 #include "xlat/futexwakecmps.h"
100 100
 
101
-int
102
-sys_futex(struct tcb *tcp)
101
+SYS_FUNC(futex)
103 102
 {
104 103
 	if (entering(tcp)) {
105 104
 		long int cmd = tcp->u_arg[1] & 127;

+ 1
- 2
get_robust_list.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_get_robust_list(struct tcb *tcp)
3
+SYS_FUNC(get_robust_list)
5 4
 {
6 5
 	if (entering(tcp)) {
7 6
 		tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]);

+ 1
- 2
getcpu.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_getcpu(struct tcb *tcp)
3
+SYS_FUNC(getcpu)
5 4
 {
6 5
 	if (exiting(tcp)) {
7 6
 		unsigned u;

+ 1
- 2
getcwd.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_getcwd(struct tcb *tcp)
3
+SYS_FUNC(getcwd)
5 4
 {
6 5
 	if (exiting(tcp)) {
7 6
 		if (syserror(tcp))

+ 1
- 2
getrandom.c View File

@@ -1,8 +1,7 @@
1 1
 #include "defs.h"
2 2
 #include "xlat/getrandom_flags.h"
3 3
 
4
-int
5
-sys_getrandom(struct tcb *tcp)
4
+SYS_FUNC(getrandom)
6 5
 {
7 6
 	if (exiting(tcp)) {
8 7
 		if (syserror(tcp))

+ 2
- 4
hostname.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_sethostname(struct tcb *tcp)
3
+SYS_FUNC(sethostname)
5 4
 {
6 5
 	if (entering(tcp)) {
7 6
 		printstr(tcp, tcp->u_arg[0], tcp->u_arg[1]);
@@ -11,8 +10,7 @@ sys_sethostname(struct tcb *tcp)
11 10
 }
12 11
 
13 12
 #if defined(ALPHA)
14
-int
15
-sys_gethostname(struct tcb *tcp)
13
+SYS_FUNC(gethostname)
16 14
 {
17 15
 	if (exiting(tcp)) {
18 16
 		if (syserror(tcp))

+ 3
- 6
inotify.c View File

@@ -4,8 +4,7 @@
4 4
 #include "xlat/inotify_flags.h"
5 5
 #include "xlat/inotify_init_flags.h"
6 6
 
7
-int
8
-sys_inotify_add_watch(struct tcb *tcp)
7
+SYS_FUNC(inotify_add_watch)
9 8
 {
10 9
 	if (entering(tcp)) {
11 10
 		/* file descriptor */
@@ -20,8 +19,7 @@ sys_inotify_add_watch(struct tcb *tcp)
20 19
 	return 0;
21 20
 }
22 21
 
23
-int
24
-sys_inotify_rm_watch(struct tcb *tcp)
22
+SYS_FUNC(inotify_rm_watch)
25 23
 {
26 24
 	if (entering(tcp)) {
27 25
 		/* file descriptor */
@@ -32,8 +30,7 @@ sys_inotify_rm_watch(struct tcb *tcp)
32 30
 	return 0;
33 31
 }
34 32
 
35
-int
36
-sys_inotify_init1(struct tcb *tcp)
33
+SYS_FUNC(inotify_init1)
37 34
 {
38 35
 	if (entering(tcp))
39 36
 		printflags(inotify_init_flags, tcp->u_arg[0], "IN_???");

+ 14
- 28
io.c View File

@@ -32,8 +32,7 @@
32 32
 #include <fcntl.h>
33 33
 #include <sys/uio.h>
34 34
 
35
-int
36
-sys_read(struct tcb *tcp)
35
+SYS_FUNC(read)
37 36
 {
38 37
 	if (entering(tcp)) {
39 38
 		printfd(tcp, tcp->u_arg[0]);
@@ -48,8 +47,7 @@ sys_read(struct tcb *tcp)
48 47
 	return 0;
49 48
 }
50 49
 
51
-int
52
-sys_write(struct tcb *tcp)
50
+SYS_FUNC(write)
53 51
 {
54 52
 	if (entering(tcp)) {
55 53
 		printfd(tcp, tcp->u_arg[0]);
@@ -142,8 +140,7 @@ tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_io
142 140
 	tprint_iov_upto(tcp, len, addr, decode_iov, (unsigned long) -1L);
143 141
 }
144 142
 
145
-int
146
-sys_readv(struct tcb *tcp)
143
+SYS_FUNC(readv)
147 144
 {
148 145
 	if (entering(tcp)) {
149 146
 		printfd(tcp, tcp->u_arg[0]);
@@ -160,8 +157,7 @@ sys_readv(struct tcb *tcp)
160 157
 	return 0;
161 158
 }
162 159
 
163
-int
164
-sys_writev(struct tcb *tcp)
160
+SYS_FUNC(writev)
165 161
 {
166 162
 	if (entering(tcp)) {
167 163
 		printfd(tcp, tcp->u_arg[0]);
@@ -183,8 +179,7 @@ sys_writev(struct tcb *tcp)
183 179
 #define PREAD_OFFSET_ARG 3
184 180
 #endif
185 181
 
186
-int
187
-sys_pread(struct tcb *tcp)
182
+SYS_FUNC(pread)
188 183
 {
189 184
 	if (entering(tcp)) {
190 185
 		printfd(tcp, tcp->u_arg[0]);
@@ -200,8 +195,7 @@ sys_pread(struct tcb *tcp)
200 195
 	return 0;
201 196
 }
202 197
 
203
-int
204
-sys_pwrite(struct tcb *tcp)
198
+SYS_FUNC(pwrite)
205 199
 {
206 200
 	if (entering(tcp)) {
207 201
 		printfd(tcp, tcp->u_arg[0]);
@@ -239,8 +233,7 @@ print_llu_from_low_high_val(struct tcb *tcp, int arg)
239 233
 #endif
240 234
 }
241 235
 
242
-int
243
-sys_preadv(struct tcb *tcp)
236
+SYS_FUNC(preadv)
244 237
 {
245 238
 	if (entering(tcp)) {
246 239
 		printfd(tcp, tcp->u_arg[0]);
@@ -257,8 +250,7 @@ sys_preadv(struct tcb *tcp)
257 250
 	return 0;
258 251
 }
259 252
 
260
-int
261
-sys_pwritev(struct tcb *tcp)
253
+SYS_FUNC(pwritev)
262 254
 {
263 255
 	if (entering(tcp)) {
264 256
 		printfd(tcp, tcp->u_arg[0]);
@@ -296,8 +288,7 @@ print_off_t(struct tcb *tcp, long addr)
296 288
 		tprintf("[%lu]", offset);
297 289
 }
298 290
 
299
-int
300
-sys_sendfile(struct tcb *tcp)
291
+SYS_FUNC(sendfile)
301 292
 {
302 293
 	if (entering(tcp)) {
303 294
 		printfd(tcp, tcp->u_arg[0]);
@@ -323,8 +314,7 @@ print_loff_t(struct tcb *tcp, long addr)
323 314
 		tprintf("[%llu]", (unsigned long long int) offset);
324 315
 }
325 316
 
326
-int
327
-sys_sendfile64(struct tcb *tcp)
317
+SYS_FUNC(sendfile64)
328 318
 {
329 319
 	if (entering(tcp)) {
330 320
 		printfd(tcp, tcp->u_arg[0]);
@@ -339,8 +329,7 @@ sys_sendfile64(struct tcb *tcp)
339 329
 
340 330
 #include "xlat/splice_flags.h"
341 331
 
342
-int
343
-sys_tee(struct tcb *tcp)
332
+SYS_FUNC(tee)
344 333
 {
345 334
 	if (entering(tcp)) {
346 335
 		/* int fd_in */
@@ -357,8 +346,7 @@ sys_tee(struct tcb *tcp)
357 346
 	return 0;
358 347
 }
359 348
 
360
-int
361
-sys_splice(struct tcb *tcp)
349
+SYS_FUNC(splice)
362 350
 {
363 351
 	if (entering(tcp)) {
364 352
 		/* int fd_in */
@@ -381,8 +369,7 @@ sys_splice(struct tcb *tcp)
381 369
 	return 0;
382 370
 }
383 371
 
384
-int
385
-sys_vmsplice(struct tcb *tcp)
372
+SYS_FUNC(vmsplice)
386 373
 {
387 374
 	if (entering(tcp)) {
388 375
 		/* int fd */
@@ -397,8 +384,7 @@ sys_vmsplice(struct tcb *tcp)
397 384
 	return 0;
398 385
 }
399 386
 
400
-int
401
-sys_ioctl(struct tcb *tcp)
387
+SYS_FUNC(ioctl)
402 388
 {
403 389
 	const struct_ioctlent *iop;
404 390
 

+ 2
- 4
ioprio.c View File

@@ -42,8 +42,7 @@ sprint_ioprio(int ioprio)
42 42
 	return outstr;
43 43
 }
44 44
 
45
-int
46
-sys_ioprio_get(struct tcb *tcp)
45
+SYS_FUNC(ioprio_get)
47 46
 {
48 47
 	if (entering(tcp)) {
49 48
 		/* int which */
@@ -60,8 +59,7 @@ sys_ioprio_get(struct tcb *tcp)
60 59
 	}
61 60
 }
62 61
 
63
-int
64
-sys_ioprio_set(struct tcb *tcp)
62
+SYS_FUNC(ioprio_set)
65 63
 {
66 64
 	if (entering(tcp)) {
67 65
 		/* int which */

+ 18
- 24
ipc.c View File

@@ -72,7 +72,7 @@ extern void printsigevent(struct tcb *tcp, long arg);
72 72
 #include "xlat/ipc_msg_flags.h"
73 73
 #include "xlat/semop_flags.h"
74 74
 
75
-int sys_msgget(struct tcb *tcp)
75
+SYS_FUNC(msgget)
76 76
 {
77 77
 	if (entering(tcp)) {
78 78
 		if (tcp->u_arg[0])
@@ -100,7 +100,7 @@ indirect_ipccall(struct tcb *tcp)
100 100
 	return tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL;
101 101
 }
102 102
 
103
-int sys_msgctl(struct tcb *tcp)
103
+SYS_FUNC(msgctl)
104 104
 {
105 105
 	if (entering(tcp)) {
106 106
 		tprintf("%lu, ", tcp->u_arg[0]);
@@ -127,7 +127,7 @@ tprint_msgsnd(struct tcb *tcp, long addr, unsigned long count,
127 127
 	printflags(ipc_msg_flags, flags, "MSG_???");
128 128
 }
129 129
 
130
-int sys_msgsnd(struct tcb *tcp)
130
+SYS_FUNC(msgsnd)
131 131
 {
132 132
 	if (entering(tcp)) {
133 133
 		tprintf("%d, ", (int) tcp->u_arg[0]);
@@ -157,7 +157,7 @@ tprint_msgrcv(struct tcb *tcp, long addr, unsigned long count, long msgtyp)
157 157
 	tprintf(", %lu, %ld, ", count, msgtyp);
158 158
 }
159 159
 
160
-int sys_msgrcv(struct tcb *tcp)
160
+SYS_FUNC(msgrcv)
161 161
 {
162 162
 	if (entering(tcp)) {
163 163
 		tprintf("%d, ", (int) tcp->u_arg[0]);
@@ -227,7 +227,7 @@ tprint_sembuf(struct tcb *tcp, long addr, unsigned long count)
227 227
 	tprintf("}, %lu", count);
228 228
 }
229 229
 
230
-int sys_semop(struct tcb *tcp)
230
+SYS_FUNC(semop)
231 231
 {
232 232
 	if (entering(tcp)) {
233 233
 		tprintf("%lu, ", tcp->u_arg[0]);
@@ -240,7 +240,7 @@ int sys_semop(struct tcb *tcp)
240 240
 	return 0;
241 241
 }
242 242
 
243
-int sys_semtimedop(struct tcb *tcp)
243
+SYS_FUNC(semtimedop)
244 244
 {
245 245
 	if (entering(tcp)) {
246 246
 		tprintf("%lu, ", tcp->u_arg[0]);
@@ -261,7 +261,7 @@ int sys_semtimedop(struct tcb *tcp)
261 261
 	return 0;
262 262
 }
263 263
 
264
-int sys_semget(struct tcb *tcp)
264
+SYS_FUNC(semget)
265 265
 {
266 266
 	if (entering(tcp)) {
267 267
 		if (tcp->u_arg[0])
@@ -276,7 +276,7 @@ int sys_semget(struct tcb *tcp)
276 276
 	return 0;
277 277
 }
278 278
 
279
-int sys_semctl(struct tcb *tcp)
279
+SYS_FUNC(semctl)
280 280
 {
281 281
 	if (entering(tcp)) {
282 282
 		tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
@@ -295,7 +295,7 @@ int sys_semctl(struct tcb *tcp)
295 295
 	return 0;
296 296
 }
297 297
 
298
-int sys_shmget(struct tcb *tcp)
298
+SYS_FUNC(shmget)
299 299
 {
300 300
 	if (entering(tcp)) {
301 301
 		if (tcp->u_arg[0])
@@ -310,7 +310,7 @@ int sys_shmget(struct tcb *tcp)
310 310
 	return 0;
311 311
 }
312 312
 
313
-int sys_shmctl(struct tcb *tcp)
313
+SYS_FUNC(shmctl)
314 314
 {
315 315
 	if (entering(tcp)) {
316 316
 		tprintf("%lu, ", tcp->u_arg[0]);
@@ -324,7 +324,7 @@ int sys_shmctl(struct tcb *tcp)
324 324
 	return 0;
325 325
 }
326 326
 
327
-int sys_shmat(struct tcb *tcp)
327
+SYS_FUNC(shmat)
328 328
 {
329 329
 	if (exiting(tcp)) {
330 330
 		tprintf("%lu", tcp->u_arg[0]);
@@ -348,7 +348,7 @@ int sys_shmat(struct tcb *tcp)
348 348
 	return 0;
349 349
 }
350 350
 
351
-int sys_shmdt(struct tcb *tcp)
351
+SYS_FUNC(shmdt)
352 352
 {
353 353
 	if (entering(tcp)) {
354 354
 		if (indirect_ipccall(tcp)) {
@@ -360,8 +360,7 @@ int sys_shmdt(struct tcb *tcp)
360 360
 	return 0;
361 361
 }
362 362
 
363
-int
364
-sys_mq_open(struct tcb *tcp)
363
+SYS_FUNC(mq_open)
365 364
 {
366 365
 	if (entering(tcp)) {
367 366
 		printpath(tcp, tcp->u_arg[0]);
@@ -387,8 +386,7 @@ sys_mq_open(struct tcb *tcp)
387 386
 	return 0;
388 387
 }
389 388
 
390
-int
391
-sys_mq_timedsend(struct tcb *tcp)
389
+SYS_FUNC(mq_timedsend)
392 390
 {
393 391
 	if (entering(tcp)) {
394 392
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -399,8 +397,7 @@ sys_mq_timedsend(struct tcb *tcp)
399 397
 	return 0;
400 398
 }
401 399
 
402
-int
403
-sys_mq_timedreceive(struct tcb *tcp)
400
+SYS_FUNC(mq_timedreceive)
404 401
 {
405 402
 	if (entering(tcp))
406 403
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -412,8 +409,7 @@ sys_mq_timedreceive(struct tcb *tcp)
412 409
 	return 0;
413 410
 }
414 411
 
415
-int
416
-sys_mq_notify(struct tcb *tcp)
412
+SYS_FUNC(mq_notify)
417 413
 {
418 414
 	if (entering(tcp)) {
419 415
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -445,8 +441,7 @@ printmqattr(struct tcb *tcp, long addr)
445 441
 	}
446 442
 }
447 443
 
448
-int
449
-sys_mq_getsetattr(struct tcb *tcp)
444
+SYS_FUNC(mq_getsetattr)
450 445
 {
451 446
 	if (entering(tcp)) {
452 447
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -457,8 +452,7 @@ sys_mq_getsetattr(struct tcb *tcp)
457 452
 	return 0;
458 453
 }
459 454
 
460
-int
461
-sys_ipc(struct tcb *tcp)
455
+SYS_FUNC(ipc)
462 456
 {
463 457
 	return printargs(tcp);
464 458
 }

+ 1
- 2
kexec.c View File

@@ -72,8 +72,7 @@ print_kexec_segments(struct tcb *tcp, unsigned long addr, unsigned long len)
72 72
 		tprintf(" %#lx", addr);
73 73
 }
74 74
 
75
-int
76
-sys_kexec_load(struct tcb *tcp)
75
+SYS_FUNC(kexec_load)
77 76
 {
78 77
 	unsigned long n;
79 78
 

+ 3
- 6
keyctl.c View File

@@ -15,8 +15,7 @@ print_keyring_serial_number(key_serial_t id)
15 15
 		tprintf("%d", id);
16 16
 }
17 17
 
18
-int
19
-sys_add_key(struct tcb *tcp)
18
+SYS_FUNC(add_key)
20 19
 {
21 20
 	if (entering(tcp)) {
22 21
 		/* type */
@@ -35,8 +34,7 @@ sys_add_key(struct tcb *tcp)
35 34
 	return 0;
36 35
 }
37 36
 
38
-int
39
-sys_request_key(struct tcb *tcp)
37
+SYS_FUNC(request_key)
40 38
 {
41 39
 	if (entering(tcp)) {
42 40
 		/* type */
@@ -263,8 +261,7 @@ keyctl_set_reqkey_keyring(struct tcb *tcp, int reqkey)
263 261
 
264 262
 #include "xlat/keyctl_commands.h"
265 263
 
266
-int
267
-sys_keyctl(struct tcb *tcp)
264
+SYS_FUNC(keyctl)
268 265
 {
269 266
 	int cmd = tcp->u_arg[0];
270 267
 

+ 5
- 10
ldt.c View File

@@ -39,8 +39,7 @@ print_user_desc(struct tcb *tcp, long addr)
39 39
 		desc.useable);
40 40
 }
41 41
 
42
-int
43
-sys_modify_ldt(struct tcb *tcp)
42
+SYS_FUNC(modify_ldt)
44 43
 {
45 44
 	if (entering(tcp)) {
46 45
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -55,8 +54,7 @@ sys_modify_ldt(struct tcb *tcp)
55 54
 	return 0;
56 55
 }
57 56
 
58
-int
59
-sys_set_thread_area(struct tcb *tcp)
57
+SYS_FUNC(set_thread_area)
60 58
 {
61 59
 	if (entering(tcp)) {
62 60
 		print_user_desc(tcp, tcp->u_arg[0]);
@@ -76,8 +74,7 @@ sys_set_thread_area(struct tcb *tcp)
76 74
 	return 0;
77 75
 }
78 76
 
79
-int
80
-sys_get_thread_area(struct tcb *tcp)
77
+SYS_FUNC(get_thread_area)
81 78
 {
82 79
 	if (exiting(tcp)) {
83 80
 		if (syserror(tcp))
@@ -91,8 +88,7 @@ sys_get_thread_area(struct tcb *tcp)
91 88
 #endif /* I386 || X86_64 || X32 */
92 89
 
93 90
 #if defined(M68K) || defined(MIPS)
94
-int
95
-sys_set_thread_area(struct tcb *tcp)
91
+SYS_FUNC(set_thread_area)
96 92
 {
97 93
 	if (entering(tcp))
98 94
 		tprintf("%#lx", tcp->u_arg[0]);
@@ -102,8 +98,7 @@ sys_set_thread_area(struct tcb *tcp)
102 98
 #endif
103 99
 
104 100
 #if defined(M68K)
105
-int
106
-sys_get_thread_area(struct tcb *tcp)
101
+SYS_FUNC(get_thread_area)
107 102
 {
108 103
 	return RVAL_HEX;
109 104
 }

+ 4
- 8
link.c View File

@@ -20,8 +20,7 @@
20 20
 
21 21
 #include "xlat/at_flags.h"
22 22
 
23
-int
24
-sys_link(struct tcb *tcp)
23
+SYS_FUNC(link)
25 24
 {
26 25
 	if (entering(tcp)) {
27 26
 		printpath(tcp, tcp->u_arg[0]);
@@ -31,8 +30,7 @@ sys_link(struct tcb *tcp)
31 30
 	return 0;
32 31
 }
33 32
 
34
-int
35
-sys_linkat(struct tcb *tcp)
33
+SYS_FUNC(linkat)
36 34
 {
37 35
 	if (entering(tcp)) {
38 36
 		print_dirfd(tcp, tcp->u_arg[0]);
@@ -46,8 +44,7 @@ sys_linkat(struct tcb *tcp)
46 44
 	return 0;
47 45
 }
48 46
 
49
-int
50
-sys_unlinkat(struct tcb *tcp)
47
+SYS_FUNC(unlinkat)
51 48
 {
52 49
 	if (entering(tcp)) {
53 50
 		print_dirfd(tcp, tcp->u_arg[0]);
@@ -58,8 +55,7 @@ sys_unlinkat(struct tcb *tcp)
58 55
 	return 0;
59 56
 }
60 57
 
61
-int
62
-sys_symlinkat(struct tcb *tcp)
58
+SYS_FUNC(symlinkat)
63 59
 {
64 60
 	if (entering(tcp)) {
65 61
 		printpath(tcp, tcp->u_arg[0]);

+ 2
- 2
linux/alpha/syscallent.h View File

@@ -185,8 +185,8 @@
185 185
 [157] = { 5,	0,		printargs,			"osf_sigwaitprim"	}, /*not implemented */
186 186
 [158] = { 5,	0,		printargs,			"osf_nfssvc"		}, /*not implemented */
187 187
 [159] = { 4,	0,		printargs,			"osf_getdirentries"	},
188
-[160] = { 3,	0,		osf_statfs,		"osf_statfs"			},
189
-[161] = { 3,	0,		osf_fstatfs,		"osf_fstatfs"			},
188
+[160] = { 3,	0,		sys_osf_statfs,			"osf_statfs"		},
189
+[161] = { 3,	0,		sys_osf_fstatfs,		"osf_fstatfs"		},
190 190
 [162] = { },
191 191
 [163] = { 5,	0,		printargs,			"osf_asynch_daemon"	}, /*not implemented */
192 192
 [164] = { 5,	0,		printargs,			"osf_getfh"		}, /*not implemented */

+ 11
- 335
linux/syscall.h View File

@@ -27,341 +27,17 @@
27 27
  */
28 28
 
29 29
 #include "dummy.h"
30
-
31
-/* common syscalls */
32
-
33
-int sys_accept();
34
-int sys_accept4();
35
-int sys_access();
36
-int sys_add_key();
37
-int sys_adjtimex();
38
-int sys_arch_prctl();
39
-int sys_bind();
40
-int sys_brk();
41
-int sys_capget();
42
-int sys_capset();
43
-int sys_chdir();
44
-int sys_chmod();
45
-int sys_chown();
46
-int sys_clock_adjtime();
47
-int sys_clock_gettime();
48
-int sys_clock_nanosleep();
49
-int sys_clock_settime();
50
-int sys_clone();
51
-int sys_close();
52
-int sys_connect();
53
-int sys_creat();
54
-int sys_create_module();
55
-int sys_delete_module();
56
-int sys_dup();
57
-int sys_dup2();
58
-int sys_dup3();
59
-int sys_epoll_create();
60
-int sys_epoll_create1();
61
-int sys_epoll_ctl();
62
-int sys_epoll_pwait();
63
-int sys_epoll_wait();
64
-int sys_eventfd();
65
-int sys_eventfd2();
66
-int sys_execve();
67
-int sys_exit();
68
-int sys_faccessat();
69
-int sys_fadvise64();
70
-int sys_fadvise64_64();
71
-int sys_fallocate();
72
-int sys_fanotify_init();
73
-int sys_fanotify_mark();
74
-int sys_fchmod();
75
-int sys_fchmodat();
76
-int sys_fchown();
77
-int sys_fchownat();
78
-int sys_fcntl();
79
-int sys_fgetxattr();
80
-int sys_finit_module();
81
-int sys_flistxattr();
82
-int sys_flock();
83
-int sys_fork();
84
-int sys_fremovexattr();
85
-int sys_fsetxattr();
86
-int sys_fstat();
87
-int sys_fstat64();
88
-int sys_fstatfs();
89
-int sys_fstatfs64();
90
-int sys_ftruncate();
91
-int sys_ftruncate64();
92
-int sys_futex();
93
-int sys_futimesat();
94
-int sys_get_mempolicy();
95
-int sys_get_robust_list();
96
-int sys_get_thread_area();
97
-int sys_getcpu();
98
-int sys_getcwd();
99
-int sys_getdents();
100
-int sys_getdents64();
101
-int sys_getdtablesize();
102
-int sys_getgroups();
103
-int sys_gethostname();
104
-int sys_getitimer();
105
-int sys_getpmsg(); /* TODO: non-Linux, remove? */
106
-int sys_getpriority();
107
-int sys_getrandom();
108
-int sys_getresuid();
109
-int sys_getrlimit();
110
-int sys_getrusage();
111
-int sys_getsockname();
112
-int sys_getsockopt();
113
-int sys_gettimeofday();
114
-int sys_getuid();
115
-int sys_getxattr();
116
-int sys_init_module();
117
-int sys_inotify_add_watch();
118
-int sys_inotify_init1();
119
-int sys_inotify_rm_watch();
120
-int sys_io_cancel();
121
-int sys_io_destroy();
122
-int sys_io_getevents();
123
-int sys_io_setup();
124
-int sys_io_submit();
125
-int sys_ioctl();
126
-int sys_ioprio_get();
127
-int sys_ioprio_set();
128
-int sys_ipc();
129
-int sys_keyctl();
130
-int sys_kexec_load();
131
-int sys_kill();
132
-int sys_link();
133
-int sys_linkat();
134
-int sys_listen();
135
-int sys_listxattr();
136
-int sys_llseek();
137
-int sys_lseek();
138
-int sys_madvise();
139
-int sys_mbind();
140
-int sys_migrate_pages();
141
-int sys_mincore();
142
-int sys_mknod();
143
-int sys_mknodat();
144
-int sys_mlockall();
145
-int sys_mmap();
146
-int sys_mmap_pgoff();
147
-int sys_mmap_4koff();
148
-int sys_modify_ldt();
149
-int sys_mount();
150
-int sys_move_pages();
151
-int sys_mprotect();
152
-int sys_mq_getsetattr();
153
-int sys_mq_notify();
154
-int sys_mq_open();
155
-int sys_mq_timedreceive();
156
-int sys_mq_timedsend();
157
-int sys_mremap();
158
-int sys_msgctl();
159
-int sys_msgget();
160
-int sys_msgrcv();
161
-int sys_msgsnd();
162
-int sys_msync();
163
-int sys_munmap();
164
-int sys_nanosleep();
165
-int sys_newfstatat();
166
-int sys_old_mmap();
167
-int sys_old_mmap_pgoff();
168
-int sys_oldfstat();
169
-int sys_oldselect();
170
-int sys_oldstat();
171
-int sys_open();
172
-int sys_openat();
173
-int sys_perf_event_open();
174
-int sys_personality();
175
-int sys_pipe();
176
-int sys_pipe2();
177
-int sys_poll();
178
-int sys_poll();
179
-int sys_ppoll();
180
-int sys_prctl();
181
-int sys_pread();
182
-int sys_preadv();
183
-int sys_prlimit64();
184
-int sys_process_vm_readv();
185
-int sys_process_vm_writev();
186
-int sys_pselect6();
187
-int sys_ptrace();
188
-int sys_putpmsg(); /* TODO: non-Linux, remove? */
189
-int sys_pwrite();
190
-int sys_pwritev();
191
-int sys_query_module();
192
-int sys_quotactl();
193
-int sys_read();
194
-int sys_readahead();
195
-int sys_readdir();
196
-int sys_readlink();
197
-int sys_readlinkat();
198
-int sys_readv();
199
-int sys_reboot();
200
-int sys_recv();
201
-int sys_recvfrom();
202
-int sys_recvmmsg();
203
-int sys_recvmsg();
204
-int sys_remap_file_pages();
205
-int sys_removexattr();
206
-int sys_renameat();
207
-int sys_renameat2();
208
-int sys_request_key();
209
-int sys_restart_syscall();
210
-int sys_rt_sigaction();
211
-int sys_rt_sigpending();
212
-int sys_rt_sigprocmask();
213
-int sys_rt_sigqueueinfo();
214
-int sys_rt_sigsuspend();
215
-int sys_rt_sigtimedwait();
216
-int sys_rt_tgsigqueueinfo();
217
-int sys_sched_get_priority_min();
218
-int sys_sched_getaffinity();
219
-int sys_sched_getparam();
220
-int sys_sched_getscheduler();
221
-int sys_sched_rr_get_interval();
222
-int sys_sched_setaffinity();
223
-int sys_sched_setparam();
224
-int sys_sched_setscheduler();
225
-int sys_seccomp();
226
-int sys_select();
227
-int sys_semctl();
228
-int sys_semget();
229
-int sys_semop();
230
-int sys_semtimedop();
231
-int sys_send();
232
-int sys_sendfile();
233
-int sys_sendfile64();
234
-int sys_sendmmsg();
235
-int sys_sendmsg();
236
-int sys_sendto();
237
-int sys_set_mempolicy();
238
-int sys_set_thread_area();
239
-int sys_setfsuid();
240
-int sys_setgroups();
241
-int sys_sethostname();
242
-int sys_setitimer();
243
-int sys_setns();
244
-int sys_setpriority();
245
-int sys_setresuid();
246
-int sys_setreuid();
247
-int sys_setrlimit();
248
-int sys_setsockopt();
249
-int sys_settimeofday();
250
-int sys_setuid();
251
-int sys_setxattr();
252
-int sys_shmat();
253
-int sys_shmctl();
254
-int sys_shmdt();
255
-int sys_shmget();
256
-int sys_shutdown();
257
-int sys_sigaction();
258
-int sys_sigaltstack();
259
-int sys_siggetmask();
260
-int sys_signal();
261
-int sys_signalfd();
262
-int sys_signalfd4();
263
-int sys_sigpending();
264
-int sys_sigprocmask();
265
-int sys_sigreturn();
266
-int sys_sigsetmask();
267
-int sys_sigsuspend();
268
-int sys_socket();
269
-int sys_socketcall();
270
-int sys_socketpair();
271
-int sys_splice();
272
-int sys_stat();
273
-int sys_stat64();
274
-int sys_statfs();
275
-int sys_statfs64();
276
-int sys_swapon();
277
-int sys_symlinkat();
278
-int sys_sync_file_range();
279
-int sys_sync_file_range2();
280
-int sys_sysctl();
281
-int sys_sysinfo();
282
-int sys_syslog();
283
-int sys_tee();
284
-int sys_tgkill();
285
-int sys_time();
286
-int sys_timer_create();
287
-int sys_timer_gettime();
288
-int sys_timer_settime();
289
-int sys_timerfd();
290
-int sys_timerfd_create();
291
-int sys_timerfd_gettime();
292
-int sys_timerfd_settime();
293
-int sys_times();
294
-int sys_truncate();
295
-int sys_truncate64();
296
-int sys_umask();
297
-int sys_umount2();
298
-int sys_uname();
299
-int sys_unlinkat();
300
-int sys_unshare();
301
-int sys_utime();
302
-int sys_utimensat();
303
-int sys_utimes();
304
-int sys_vmsplice();
305
-int sys_wait4();
306
-int sys_waitid();
307
-int sys_waitpid();
308
-int sys_write();
309
-int sys_writev();
310
-
311
-/* architecture-specific calls */
312
-#ifdef ALPHA
313
-int osf_statfs();
314
-int osf_fstatfs();
315
-int sys_osf_getitimer();
316
-int sys_osf_getrusage();
317
-int sys_osf_gettimeofday();
318
-int sys_osf_select();
319
-int sys_osf_setitimer();
320
-int sys_osf_settimeofday();
321
-int sys_osf_utimes();
322
-int sys_osf_wait4();
323
-#endif
324
-
325
-#if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64)
326
-int sys_getpagesize();
327
-#endif
328
-
329
-#ifdef MIPS
330
-int sys_sysmips();
331
-#endif
332
-
333
-#if defined M68K || defined SH
334
-int sys_cacheflush();
335
-#endif
336
-
337
-#if defined OR1K
338
-int sys_or1k_atomic();
339
-#endif
340
-
341
-#ifdef POWERPC
342
-int sys_subpage_prot();
343
-#endif
344
-
345
-#ifdef BFIN
346
-int sys_cacheflush();
347
-int sys_sram_alloc();
348
-#endif
349
-
350
-#if defined SPARC || defined SPARC64
351
-int sys_execv();
352
-int sys_getmsg();
353
-int sys_putmsg();
354
-#endif
30
+#include "sys_func.h"
355 31
 
356 32
 #if NEED_UID16_PARSERS
357
-int sys_chown16();
358
-int sys_fchown16();
359
-int sys_getgroups16();
360
-int sys_getresuid16();
361
-int sys_getuid16();
362
-int sys_setfsuid16();
363
-int sys_setgroups16();
364
-int sys_setresuid16();
365
-int sys_setreuid16();
366
-int sys_setuid16();
33
+extern SYS_FUNC(chown16);
34
+extern SYS_FUNC(fchown16);
35
+extern SYS_FUNC(getgroups16);
36
+extern SYS_FUNC(getresuid16);
37
+extern SYS_FUNC(getuid16);
38
+extern SYS_FUNC(setfsuid16);
39
+extern SYS_FUNC(setgroups16);
40
+extern SYS_FUNC(setresuid16);
41
+extern SYS_FUNC(setreuid16);
42
+extern SYS_FUNC(setuid16);
367 43
 #endif

+ 3
- 6
lseek.c View File

@@ -10,8 +10,7 @@
10 10
  * Use test/x32_lseek.c to test lseek decoding.
11 11
  */
12 12
 #if defined(LINUX_MIPSN32) || defined(X32)
13
-int
14
-sys_lseek(struct tcb *tcp)
13
+SYS_FUNC(lseek)
15 14
 {
16 15
 	long long offset;
17 16
 	int whence;
@@ -29,8 +28,7 @@ sys_lseek(struct tcb *tcp)
29 28
 	return RVAL_LUDECIMAL;
30 29
 }
31 30
 #else
32
-int
33
-sys_lseek(struct tcb *tcp)
31
+SYS_FUNC(lseek)
34 32
 {
35 33
 	long offset;
36 34
 	int whence;
@@ -62,8 +60,7 @@ sys_lseek(struct tcb *tcp)
62 60
  * for hi and lo. We would need to use tcp->ext_arg[N] on x32...
63 61
  * ...however, x32 (and x86_64) does not _have_ llseek syscall as such.
64 62
  */
65
-int
66
-sys_llseek(struct tcb *tcp)
63
+SYS_FUNC(llseek)
67 64
 {
68 65
 	if (entering(tcp)) {
69 66
 		printfd(tcp, tcp->u_arg[0]);

+ 21
- 42
mem.c View File

@@ -44,8 +44,7 @@ get_pagesize(void)
44 44
 	return pagesize;
45 45
 }
46 46
 
47
-int
48
-sys_brk(struct tcb *tcp)
47
+SYS_FUNC(brk)
49 48
 {
50 49
 	if (entering(tcp)) {
51 50
 		tprintf("%#lx", tcp->u_arg[0]);
@@ -95,8 +94,7 @@ print_mmap(struct tcb *tcp, long *u_arg, unsigned long long offset)
95 94
  */
96 95
 
97 96
 /* Params are pointed to by u_arg[0], offset is in bytes */
98
-int
99
-sys_old_mmap(struct tcb *tcp)
97
+SYS_FUNC(old_mmap)
100 98
 {
101 99
 	long u_arg[6];
102 100
 #if defined(IA64)
@@ -127,8 +125,7 @@ sys_old_mmap(struct tcb *tcp)
127 125
 
128 126
 #if defined(S390)
129 127
 /* Params are pointed to by u_arg[0], offset is in pages */
130
-int
131
-sys_old_mmap_pgoff(struct tcb *tcp)
128
+SYS_FUNC(old_mmap_pgoff)
132 129
 {
133 130
 	long u_arg[5];
134 131
 	int i;
@@ -145,8 +142,7 @@ sys_old_mmap_pgoff(struct tcb *tcp)
145 142
 #endif
146 143
 
147 144
 /* Params are passed directly, offset is in bytes */
148
-int
149
-sys_mmap(struct tcb *tcp)
145
+SYS_FUNC(mmap)
150 146
 {
151 147
 	unsigned long long offset = (unsigned long) tcp->u_arg[5];
152 148
 #if defined(LINUX_MIPSN32) || defined(X32)
@@ -162,8 +158,7 @@ sys_mmap(struct tcb *tcp)
162 158
 }
163 159
 
164 160
 /* Params are passed directly, offset is in pages */
165
-int
166
-sys_mmap_pgoff(struct tcb *tcp)
161
+SYS_FUNC(mmap_pgoff)
167 162
 {
168 163
 	/* Try test/mmap_offset_decode.c */
169 164
 	unsigned long long offset;
@@ -173,8 +168,7 @@ sys_mmap_pgoff(struct tcb *tcp)
173 168
 }
174 169
 
175 170
 /* Params are passed directly, offset is in 4k units */
176
-int
177
-sys_mmap_4koff(struct tcb *tcp)
171
+SYS_FUNC(mmap_4koff)
178 172
 {
179 173
 	unsigned long long offset;
180 174
 	offset = (unsigned long) tcp->u_arg[5];
@@ -182,8 +176,7 @@ sys_mmap_4koff(struct tcb *tcp)
182 176
 	return print_mmap(tcp, tcp->u_arg, offset);
183 177
 }
184 178
 
185
-int
186
-sys_munmap(struct tcb *tcp)
179
+SYS_FUNC(munmap)
187 180
 {
188 181
 	if (entering(tcp)) {
189 182
 		tprintf("%#lx, %lu",
@@ -192,8 +185,7 @@ sys_munmap(struct tcb *tcp)
192 185
 	return 0;
193 186
 }
194 187
 
195
-int
196
-sys_mprotect(struct tcb *tcp)
188
+SYS_FUNC(mprotect)
197 189
 {
198 190
 	if (entering(tcp)) {
199 191
 		tprintf("%#lx, %lu, ",
@@ -205,8 +197,7 @@ sys_mprotect(struct tcb *tcp)
205 197
 
206 198
 #include "xlat/mremap_flags.h"
207 199
 
208
-int
209
-sys_mremap(struct tcb *tcp)
200
+SYS_FUNC(mremap)
210 201
 {
211 202
 	if (entering(tcp)) {
212 203
 		tprintf("%#lx, %lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1],
@@ -223,8 +214,7 @@ sys_mremap(struct tcb *tcp)
223 214
 
224 215
 #include "xlat/madvise_cmds.h"
225 216
 
226
-int
227
-sys_madvise(struct tcb *tcp)
217
+SYS_FUNC(madvise)
228 218
 {
229 219
 	if (entering(tcp)) {
230 220
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
@@ -235,8 +225,7 @@ sys_madvise(struct tcb *tcp)
235 225
 
236 226
 #include "xlat/mlockall_flags.h"
237 227
 
238
-int
239
-sys_mlockall(struct tcb *tcp)
228
+SYS_FUNC(mlockall)
240 229
 {
241 230
 	if (entering(tcp)) {
242 231
 		printflags(mlockall_flags, tcp->u_arg[0], "MCL_???");
@@ -246,8 +235,7 @@ sys_mlockall(struct tcb *tcp)
246 235
 
247 236
 #include "xlat/mctl_sync.h"
248 237
 
249
-int
250
-sys_msync(struct tcb *tcp)
238
+SYS_FUNC(msync)
251 239
 {
252 240
 	if (entering(tcp)) {
253 241
 		/* addr */
@@ -260,8 +248,7 @@ sys_msync(struct tcb *tcp)
260 248
 	return 0;
261 249
 }
262 250
 
263
-int
264
-sys_mincore(struct tcb *tcp)
251
+SYS_FUNC(mincore)
265 252
 {
266 253
 	if (entering(tcp)) {
267 254
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
@@ -291,8 +278,7 @@ sys_mincore(struct tcb *tcp)
291 278
 }
292 279
 
293 280
 #if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64)
294
-int
295
-sys_getpagesize(struct tcb *tcp)
281
+SYS_FUNC(getpagesize)
296 282
 {
297 283
 	if (exiting(tcp))
298 284
 		return RVAL_HEX;
@@ -300,8 +286,7 @@ sys_getpagesize(struct tcb *tcp)
300 286
 }
301 287
 #endif
302 288
 
303
-int
304
-sys_remap_file_pages(struct tcb *tcp)
289
+SYS_FUNC(remap_file_pages)
305 290
 {
306 291
 	if (entering(tcp)) {
307 292
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
@@ -377,8 +362,7 @@ get_nodes(struct tcb *tcp, unsigned long ptr, unsigned long maxnodes, int err)
377 362
 	tprintf(", %lu", maxnodes);
378 363
 }
379 364
 
380
-int
381
-sys_mbind(struct tcb *tcp)
365
+SYS_FUNC(mbind)
382 366
 {
383 367
 	if (entering(tcp)) {
384 368
 		tprintf("%#lx, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
@@ -390,8 +374,7 @@ sys_mbind(struct tcb *tcp)
390 374
 	return 0;
391 375
 }
392 376
 
393
-int
394
-sys_set_mempolicy(struct tcb *tcp)
377
+SYS_FUNC(set_mempolicy)
395 378
 {
396 379
 	if (entering(tcp)) {
397 380
 		printxval(policies, tcp->u_arg[0], "MPOL_???");
@@ -400,8 +383,7 @@ sys_set_mempolicy(struct tcb *tcp)
400 383
 	return 0;
401 384
 }
402 385
 
403
-int
404
-sys_get_mempolicy(struct tcb *tcp)
386
+SYS_FUNC(get_mempolicy)
405 387
 {
406 388
 	if (exiting(tcp)) {
407 389
 		int pol;
@@ -418,8 +400,7 @@ sys_get_mempolicy(struct tcb *tcp)
418 400
 	return 0;
419 401
 }
420 402
 
421
-int
422
-sys_migrate_pages(struct tcb *tcp)
403
+SYS_FUNC(migrate_pages)
423 404
 {
424 405
 	if (entering(tcp)) {
425 406
 		tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]);
@@ -430,8 +411,7 @@ sys_migrate_pages(struct tcb *tcp)
430 411
 	return 0;
431 412
 }
432 413
 
433
-int
434
-sys_move_pages(struct tcb *tcp)
414
+SYS_FUNC(move_pages)
435 415
 {
436 416
 	if (entering(tcp)) {
437 417
 		unsigned long npages = tcp->u_arg[1];
@@ -502,8 +482,7 @@ sys_move_pages(struct tcb *tcp)
502 482
 }
503 483
 
504 484
 #if defined(POWERPC)
505
-int
506
-sys_subpage_prot(struct tcb *tcp)
485
+SYS_FUNC(subpage_prot)
507 486
 {
508 487
 	if (entering(tcp)) {
509 488
 		unsigned long cur, end, abbrev_end, entries;

+ 3
- 6
mknod.c View File

@@ -40,14 +40,12 @@ decode_mknod(struct tcb *tcp, int offset)
40 40
 	return 0;
41 41
 }
42 42
 
43
-int
44
-sys_mknod(struct tcb *tcp)
43
+SYS_FUNC(mknod)
45 44
 {
46 45
 	return decode_mknod(tcp, 0);
47 46
 }
48 47
 
49
-int
50
-sys_mknodat(struct tcb *tcp)
48
+SYS_FUNC(mknodat)
51 49
 {
52 50
 	if (entering(tcp))
53 51
 		print_dirfd(tcp, tcp->u_arg[0]);
@@ -55,8 +53,7 @@ sys_mknodat(struct tcb *tcp)
55 53
 }
56 54
 
57 55
 #if defined(SPARC) || defined(SPARC64)
58
-int
59
-sys_xmknod(struct tcb *tcp)
56
+SYS_FUNC(xmknod)
60 57
 {
61 58
 	int mode = tcp->u_arg[2];
62 59
 

+ 1
- 2
mount.c View File

@@ -32,8 +32,7 @@
32 32
 
33 33
 #include "xlat/mount_flags.h"
34 34
 
35
-int
36
-sys_mount(struct tcb *tcp)
35
+SYS_FUNC(mount)
37 36
 {
38 37
 	if (entering(tcp)) {
39 38
 		int ignore_type = 0, ignore_data = 0;

+ 21
- 42
net.c View File

@@ -729,8 +729,7 @@ tprint_sock_type(int flags)
729 729
 	printflags(sock_type_flags, flags, "SOCK_???");
730 730
 }
731 731
 
732
-int
733
-sys_socket(struct tcb *tcp)
732
+SYS_FUNC(socket)
734 733
 {
735 734
 	if (entering(tcp)) {
736 735
 		printxval(domains, tcp->u_arg[0], "PF_???");
@@ -770,8 +769,7 @@ sys_socket(struct tcb *tcp)
770 769
 	return 0;
771 770
 }
772 771
 
773
-int
774
-sys_bind(struct tcb *tcp)
772
+SYS_FUNC(bind)
775 773
 {
776 774
 	if (entering(tcp)) {
777 775
 		printfd(tcp, tcp->u_arg[0]);
@@ -782,14 +780,12 @@ sys_bind(struct tcb *tcp)
782 780
 	return 0;
783 781
 }
784 782
 
785
-int
786
-sys_connect(struct tcb *tcp)
783
+SYS_FUNC(connect)
787 784
 {
788 785
 	return sys_bind(tcp);
789 786
 }
790 787
 
791
-int
792
-sys_listen(struct tcb *tcp)
788
+SYS_FUNC(listen)
793 789
 {
794 790
 	if (entering(tcp)) {
795 791
 		printfd(tcp, tcp->u_arg[0]);
@@ -828,22 +824,19 @@ do_sockname(struct tcb *tcp, int flags_arg)
828 824
 	return 0;
829 825
 }
830 826
 
831
-int
832
-sys_accept(struct tcb *tcp)
827
+SYS_FUNC(accept)
833 828
 {
834 829
 	do_sockname(tcp, -1);
835 830
 	return RVAL_FD;
836 831
 }
837 832
 
838
-int
839
-sys_accept4(struct tcb *tcp)
833
+SYS_FUNC(accept4)
840 834
 {
841 835
 	do_sockname(tcp, 3);
842 836
 	return RVAL_FD;
843 837
 }
844 838
 
845
-int
846
-sys_send(struct tcb *tcp)
839
+SYS_FUNC(send)
847 840
 {
848 841
 	if (entering(tcp)) {
849 842
 		printfd(tcp, tcp->u_arg[0]);
@@ -856,8 +849,7 @@ sys_send(struct tcb *tcp)
856 849
 	return 0;
857 850
 }
858 851
 
859
-int
860
-sys_sendto(struct tcb *tcp)
852
+SYS_FUNC(sendto)
861 853
 {
862 854
 	if (entering(tcp)) {
863 855
 		printfd(tcp, tcp->u_arg[0]);
@@ -877,8 +869,7 @@ sys_sendto(struct tcb *tcp)
877 869
 
878 870
 #ifdef HAVE_SENDMSG
879 871
 
880
-int
881
-sys_sendmsg(struct tcb *tcp)
872
+SYS_FUNC(sendmsg)
882 873
 {
883 874
 	if (entering(tcp)) {
884 875
 		printfd(tcp, tcp->u_arg[0]);
@@ -891,8 +882,7 @@ sys_sendmsg(struct tcb *tcp)
891 882
 	return 0;
892 883
 }
893 884
 
894
-int
895
-sys_sendmmsg(struct tcb *tcp)
885
+SYS_FUNC(sendmmsg)
896 886
 {
897 887
 	if (entering(tcp)) {
898 888
 		/* sockfd */
@@ -912,8 +902,7 @@ sys_sendmmsg(struct tcb *tcp)
912 902
 
913 903
 #endif /* HAVE_SENDMSG */
914 904
 
915
-int
916
-sys_recv(struct tcb *tcp)
905
+SYS_FUNC(recv)
917 906
 {
918 907
 	if (entering(tcp)) {
919 908
 		printfd(tcp, tcp->u_arg[0]);
@@ -930,8 +919,7 @@ sys_recv(struct tcb *tcp)
930 919
 	return 0;
931 920
 }
932 921
 
933
-int
934
-sys_recvfrom(struct tcb *tcp)
922
+SYS_FUNC(recvfrom)
935 923
 {
936 924
 	int fromlen;
937 925
 
@@ -977,8 +965,7 @@ sys_recvfrom(struct tcb *tcp)
977 965
 
978 966
 #ifdef HAVE_SENDMSG
979 967
 
980
-int
981
-sys_recvmsg(struct tcb *tcp)
968
+SYS_FUNC(recvmsg)
982 969
 {
983 970
 	if (entering(tcp)) {
984 971
 		printfd(tcp, tcp->u_arg[0]);
@@ -995,8 +982,7 @@ sys_recvmsg(struct tcb *tcp)
995 982
 	return 0;
996 983
 }
997 984
 
998
-int
999
-sys_recvmmsg(struct tcb *tcp)
985
+SYS_FUNC(recvmmsg)
1000 986
 {
1001 987
 	/* +5 chars are for "left " prefix */
1002 988
 	static char str[5 + TIMESPEC_TEXT_BUFSIZE];
@@ -1044,8 +1030,7 @@ sys_recvmmsg(struct tcb *tcp)
1044 1030
 
1045 1031
 #include "xlat/shutdown_modes.h"
1046 1032
 
1047
-int
1048
-sys_shutdown(struct tcb *tcp)
1033
+SYS_FUNC(shutdown)
1049 1034
 {
1050 1035
 	if (entering(tcp)) {
1051 1036
 		printfd(tcp, tcp->u_arg[0]);
@@ -1055,8 +1040,7 @@ sys_shutdown(struct tcb *tcp)
1055 1040
 	return 0;
1056 1041
 }
1057 1042
 
1058
-int
1059
-sys_getsockname(struct tcb *tcp)
1043
+SYS_FUNC(getsockname)
1060 1044
 {
1061 1045
 	return do_sockname(tcp, -1);
1062 1046
 }
@@ -1090,20 +1074,17 @@ do_pipe(struct tcb *tcp, int flags_arg)
1090 1074
 	return 0;
1091 1075
 }
1092 1076
 
1093
-int
1094
-sys_pipe(struct tcb *tcp)
1077
+SYS_FUNC(pipe)
1095 1078
 {
1096 1079
 	return do_pipe(tcp, -1);
1097 1080
 }
1098 1081
 
1099
-int
1100
-sys_pipe2(struct tcb *tcp)
1082
+SYS_FUNC(pipe2)
1101 1083
 {
1102 1084
 	return do_pipe(tcp, 1);
1103 1085
 }
1104 1086
 
1105
-int
1106
-sys_socketpair(struct tcb *tcp)
1087
+SYS_FUNC(socketpair)
1107 1088
 {
1108 1089
 	int fds[2];
1109 1090
 
@@ -1306,8 +1287,7 @@ done:
1306 1287
 	tprintf(", [%d]", len);
1307 1288
 }
1308 1289
 
1309
-int
1310
-sys_getsockopt(struct tcb *tcp)
1290
+SYS_FUNC(getsockopt)
1311 1291
 {
1312 1292
 	if (entering(tcp)) {
1313 1293
 		print_sockopt_fd_level_name(tcp, tcp->u_arg[0],
@@ -1493,8 +1473,7 @@ done:
1493 1473
 	tprintf(", %d", len);
1494 1474
 }
1495 1475
 
1496
-int
1497
-sys_setsockopt(struct tcb *tcp)
1476
+SYS_FUNC(setsockopt)
1498 1477
 {
1499 1478
 	if (entering(tcp)) {
1500 1479
 		print_sockopt_fd_level_name(tcp, tcp->u_arg[0],

+ 3
- 6
open.c View File

@@ -97,22 +97,19 @@ decode_open(struct tcb *tcp, int offset)
97 97
 	return RVAL_FD;
98 98
 }
99 99
 
100
-int
101
-sys_open(struct tcb *tcp)
100
+SYS_FUNC(open)
102 101
 {
103 102
 	return decode_open(tcp, 0);
104 103
 }
105 104
 
106
-int
107
-sys_openat(struct tcb *tcp)
105
+SYS_FUNC(openat)
108 106
 {
109 107
 	if (entering(tcp))
110 108
 		print_dirfd(tcp, tcp->u_arg[0]);
111 109
 	return decode_open(tcp, 1);
112 110
 }
113 111
 
114
-int
115
-sys_creat(struct tcb *tcp)
112
+SYS_FUNC(creat)
116 113
 {
117 114
 	if (entering(tcp)) {
118 115
 		printpath(tcp, tcp->u_arg[0]);

+ 1
- 1
or1k_atomic.c View File

@@ -14,7 +14,7 @@
14 14
 
15 15
 #include "xlat/atomic_ops.h"
16 16
 
17
-int sys_or1k_atomic(struct tcb *tcp)
17
+SYS_FUNC(or1k_atomic)
18 18
 {
19 19
 	if (entering(tcp)) {
20 20
 		printxval(atomic_ops, tcp->u_arg[0], "???");

+ 1
- 2
personality.c View File

@@ -4,8 +4,7 @@
4 4
 
5 5
 #include "xlat/personality_options.h"
6 6
 
7
-int
8
-sys_personality(struct tcb *tcp)
7
+SYS_FUNC(personality)
9 8
 {
10 9
 	if (entering(tcp))
11 10
 		printxval(personality_options, tcp->u_arg[0], "PER_???");

+ 2
- 4
prctl.c View File

@@ -281,8 +281,7 @@ prctl_exit(struct tcb *tcp)
281 281
 	return 0;
282 282
 }
283 283
 
284
-int
285
-sys_prctl(struct tcb *tcp)
284
+SYS_FUNC(prctl)
286 285
 {
287 286
 	return entering(tcp) ? prctl_enter(tcp) : prctl_exit(tcp);
288 287
 }
@@ -291,8 +290,7 @@ sys_prctl(struct tcb *tcp)
291 290
 # include <asm/prctl.h>
292 291
 # include "xlat/archvals.h"
293 292
 
294
-int
295
-sys_arch_prctl(struct tcb *tcp)
293
+SYS_FUNC(arch_prctl)
296 294
 {
297 295
 	if (entering(tcp))
298 296
 		printxval(archvals, tcp->u_arg[0], "ARCH_???");

+ 1
- 2
process.c View File

@@ -55,8 +55,7 @@ static const struct xlat struct_user_offsets[] = {
55 55
 	XLAT_END
56 56
 };
57 57
 
58
-int
59
-sys_ptrace(struct tcb *tcp)
58
+SYS_FUNC(ptrace)
60 59
 {
61 60
 	const struct xlat *x;
62 61
 	unsigned long addr;

+ 2
- 4
process_vm.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_process_vm_readv(struct tcb *tcp)
3
+SYS_FUNC(process_vm_readv)
5 4
 {
6 5
 	if (entering(tcp)) {
7 6
 		/* arg 1: pid */
@@ -28,8 +27,7 @@ sys_process_vm_readv(struct tcb *tcp)
28 27
 	return 0;
29 28
 }
30 29
 
31
-int
32
-sys_process_vm_writev(struct tcb *tcp)
30
+SYS_FUNC(process_vm_writev)
33 31
 {
34 32
 	if (entering(tcp)) {
35 33
 		/* arg 1: pid */

+ 1
- 2
quota.c View File

@@ -524,8 +524,7 @@ decode_cmd_data(struct tcb *tcp, u_int32_t cmd, unsigned long data)
524 524
 	}
525 525
 }
526 526
 
527
-int
528
-sys_quotactl(struct tcb *tcp)
527
+SYS_FUNC(quotactl)
529 528
 {
530 529
 	/*
531 530
 	 * The Linux kernel only looks at the low 32 bits of command and id

+ 1
- 2
readahead.c View File

@@ -1,7 +1,6 @@
1 1
 #include "defs.h"
2 2
 
3
-int
4
-sys_readahead(struct tcb *tcp)
3
+SYS_FUNC(readahead)
5 4
 {
6 5
 	if (entering(tcp)) {
7 6
 		int argn;

+ 2
- 4
readlink.c View File

@@ -23,14 +23,12 @@ decode_readlink(struct tcb *tcp, int offset)
23 23
 	return 0;
24 24
 }
25 25
 
26
-int
27
-sys_readlink(struct tcb *tcp)
26
+SYS_FUNC(readlink)
28 27
 {
29 28
 	return decode_readlink(tcp, 0);
30 29
 }
31 30
 
32
-int
33
-sys_readlinkat(struct tcb *tcp)
31
+SYS_FUNC(readlinkat)
34 32
 {
35 33
 	if (entering(tcp))
36 34
 		print_dirfd(tcp, tcp->u_arg[0]);

+ 1
- 2
reboot.c View File

@@ -4,8 +4,7 @@
4 4
 #include "xlat/bootflags2.h"
5 5
 #include "xlat/bootflags3.h"
6 6
 
7
-int
8
-sys_reboot(struct tcb *tcp)
7
+SYS_FUNC(reboot)
9 8
 {
10 9
 	if (exiting(tcp))
11 10
 		return 0;

+ 2
- 4
renameat.c View File

@@ -10,8 +10,7 @@ decode_renameat(struct tcb *tcp)
10 10
 	printpath(tcp, tcp->u_arg[3]);
11 11
 }
12 12
 
13
-int
14
-sys_renameat(struct tcb *tcp)
13
+SYS_FUNC(renameat)
15 14
 {
16 15
 	if (entering(tcp)) {
17 16
 		decode_renameat(tcp);
@@ -22,8 +21,7 @@ sys_renameat(struct tcb *tcp)
22 21
 #include <linux/fs.h>
23 22
 #include "xlat/rename_flags.h"
24 23
 
25
-int
26
-sys_renameat2(struct tcb *tcp)
24
+SYS_FUNC(renameat2)
27 25
 {
28 26
 	if (entering(tcp)) {
29 27
 		decode_renameat(tcp);

+ 8
- 16
resource.c View File

@@ -142,8 +142,7 @@ decode_rlimit(struct tcb *tcp, unsigned long addr)
142 142
 
143 143
 #endif
144 144
 
145
-int
146
-sys_getrlimit(struct tcb *tcp)
145
+SYS_FUNC(getrlimit)
147 146
 {
148 147
 	if (entering(tcp)) {
149 148
 		printxval(resources, tcp->u_arg[0], "RLIMIT_???");
@@ -155,8 +154,7 @@ sys_getrlimit(struct tcb *tcp)
155 154
 	return 0;
156 155
 }
157 156
 
158
-int
159
-sys_setrlimit(struct tcb *tcp)
157
+SYS_FUNC(setrlimit)
160 158
 {
161 159
 	if (entering(tcp)) {
162 160
 		printxval(resources, tcp->u_arg[0], "RLIMIT_???");
@@ -166,8 +164,7 @@ sys_setrlimit(struct tcb *tcp)
166 164
 	return 0;
167 165
 }
168 166
 
169
-int
170
-sys_prlimit64(struct tcb *tcp)
167
+SYS_FUNC(prlimit64)
171 168
 {
172 169
 	if (entering(tcp)) {
173 170
 		tprintf("%ld, ", tcp->u_arg[0]);
@@ -276,8 +273,7 @@ printrusage(struct tcb *tcp, long addr)
276 273
 	}
277 274
 }
278 275
 
279
-int
280
-sys_getrusage(struct tcb *tcp)
276
+SYS_FUNC(getrusage)
281 277
 {
282 278
 	if (entering(tcp)) {
283 279
 		printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
@@ -289,8 +285,7 @@ sys_getrusage(struct tcb *tcp)
289 285
 }
290 286
 
291 287
 #ifdef ALPHA
292
-int
293
-sys_osf_getrusage(struct tcb *tcp)
288
+SYS_FUNC(osf_getrusage)
294 289
 {
295 290
 	if (entering(tcp)) {
296 291
 		printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
@@ -304,8 +299,7 @@ sys_osf_getrusage(struct tcb *tcp)
304 299
 
305 300
 #include "xlat/priorities.h"
306 301
 
307
-int
308
-sys_getpriority(struct tcb *tcp)
302
+SYS_FUNC(getpriority)
309 303
 {
310 304
 	if (entering(tcp)) {
311 305
 		printxval(priorities, tcp->u_arg[0], "PRIO_???");
@@ -314,8 +308,7 @@ sys_getpriority(struct tcb *tcp)
314 308
 	return 0;
315 309
 }
316 310
 
317
-int
318
-sys_setpriority(struct tcb *tcp)
311
+SYS_FUNC(setpriority)
319 312
 {
320 313
 	if (entering(tcp)) {
321 314
 		printxval(priorities, tcp->u_arg[0], "PRIO_???");
@@ -324,8 +317,7 @@ sys_setpriority(struct tcb *tcp)
324 317
 	return 0;
325 318
 }
326 319
 
327
-int
328
-sys_times(struct tcb *tcp)
320
+SYS_FUNC(times)
329 321
 {
330 322
 	struct tms tbuf;
331 323
 

+ 6
- 12
sched.c View File

@@ -4,8 +4,7 @@
4 4
 
5 5
 #include "xlat/schedulers.h"
6 6
 
7
-int
8
-sys_sched_getscheduler(struct tcb *tcp)
7
+SYS_FUNC(sched_getscheduler)
9 8
 {
10 9
 	if (entering(tcp)) {
11 10
 		tprintf("%d", (int) tcp->u_arg[0]);
@@ -17,8 +16,7 @@ sys_sched_getscheduler(struct tcb *tcp)
17 16
 	return 0;
18 17
 }
19 18
 
20
-int
21
-sys_sched_setscheduler(struct tcb *tcp)
19
+SYS_FUNC(sched_setscheduler)
22 20
 {
23 21
 	if (entering(tcp)) {
24 22
 		struct sched_param p;
@@ -32,8 +30,7 @@ sys_sched_setscheduler(struct tcb *tcp)
32 30
 	return 0;
33 31
 }
34 32
 
35
-int
36
-sys_sched_getparam(struct tcb *tcp)
33
+SYS_FUNC(sched_getparam)
37 34
 {
38 35
 	if (entering(tcp)) {
39 36
 		tprintf("%d, ", (int) tcp->u_arg[0]);
@@ -47,8 +44,7 @@ sys_sched_getparam(struct tcb *tcp)
47 44
 	return 0;
48 45
 }
49 46
 
50
-int
51
-sys_sched_setparam(struct tcb *tcp)
47
+SYS_FUNC(sched_setparam)
52 48
 {
53 49
 	if (entering(tcp)) {
54 50
 		struct sched_param p;
@@ -60,8 +56,7 @@ sys_sched_setparam(struct tcb *tcp)
60 56
 	return 0;
61 57
 }
62 58
 
63
-int
64
-sys_sched_get_priority_min(struct tcb *tcp)
59
+SYS_FUNC(sched_get_priority_min)
65 60
 {
66 61
 	if (entering(tcp)) {
67 62
 		printxval(schedulers, tcp->u_arg[0], "SCHED_???");
@@ -69,8 +64,7 @@ sys_sched_get_priority_min(struct tcb *tcp)
69 64
 	return 0;
70 65
 }
71 66
 
72
-int
73
-sys_sched_rr_get_interval(struct tcb *tcp)
67
+SYS_FUNC(sched_rr_get_interval)
74 68
 {
75 69
 	if (entering(tcp)) {
76 70
 		tprintf("%ld, ", (long) (pid_t) tcp->u_arg[0]);

+ 1
- 2
seccomp.c View File

@@ -230,8 +230,7 @@ decode_seccomp_set_mode_strict(unsigned int flags, unsigned long addr)
230 230
 		tprints("NULL");
231 231
 }
232 232
 
233
-int
234
-sys_seccomp(struct tcb *tcp)
233
+SYS_FUNC(seccomp)
235 234
 {
236 235
 	if (entering(tcp)) {
237 236
 		unsigned int op = tcp->u_arg[0];

+ 1
- 2
sigaltstack.c View File

@@ -40,8 +40,7 @@ print_stack_t(struct tcb *tcp, unsigned long addr)
40 40
 	}
41 41
 }
42 42
 
43
-int
44
-sys_sigaltstack(struct tcb *tcp)
43
+SYS_FUNC(sigaltstack)
45 44
 {
46 45
 	if (entering(tcp)) {
47 46
 		print_stack_t(tcp, tcp->u_arg[0]);

+ 19
- 37
signal.c View File

@@ -249,8 +249,7 @@ print_sigset_addr_len(struct tcb *tcp, long addr, long len)
249 249
 	tprints(sprintsigmask_n("", mask, len));
250 250
 }
251 251
 
252