1 //===-- sanitizer_syscalls_netbsd.inc ---------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Common syscalls handlers for tools like AddressSanitizer,
10 // ThreadSanitizer, MemorySanitizer, etc.
12 // This file should be included into the tool's interceptor file,
13 // which has to define it's own macros:
14 // COMMON_SYSCALL_PRE_READ_RANGE
15 // Called in prehook for regions that will be read by the kernel and
16 // must be initialized.
17 // COMMON_SYSCALL_PRE_WRITE_RANGE
18 // Called in prehook for regions that will be written to by the kernel
19 // and must be addressable. The actual write range may be smaller than
20 // reported in the prehook. See POST_WRITE_RANGE.
21 // COMMON_SYSCALL_POST_READ_RANGE
22 // Called in posthook for regions that were read by the kernel. Does
23 // not make much sense.
24 // COMMON_SYSCALL_POST_WRITE_RANGE
25 // Called in posthook for regions that were written to by the kernel
26 // and are now initialized.
27 // COMMON_SYSCALL_ACQUIRE(addr)
28 // Acquire memory visibility from addr.
29 // COMMON_SYSCALL_RELEASE(addr)
30 // Release memory visibility to addr.
31 // COMMON_SYSCALL_FD_CLOSE(fd)
32 // Called before closing file descriptor fd.
33 // COMMON_SYSCALL_FD_ACQUIRE(fd)
34 // Acquire memory visibility from fd.
35 // COMMON_SYSCALL_FD_RELEASE(fd)
36 // Release memory visibility to fd.
37 // COMMON_SYSCALL_PRE_FORK()
38 // Called before fork syscall.
39 // COMMON_SYSCALL_POST_FORK(long long res)
40 // Called after fork syscall.
42 // DO NOT EDIT! THIS FILE HAS BEEN GENERATED!
44 // Generated with: generate_netbsd_syscalls.awk
45 // Generated date: 2020-09-10
46 // Generated from: syscalls.master,v 1.306 2020/08/14 00:53:16 riastradh Exp
48 //===----------------------------------------------------------------------===//
50 #include "sanitizer_platform.h"
53 #include "sanitizer_libc.h"
55 #define PRE_SYSCALL(name) \
56 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_syscall_pre_impl_##name
57 #define PRE_READ(p, s) COMMON_SYSCALL_PRE_READ_RANGE(p, s)
58 #define PRE_WRITE(p, s) COMMON_SYSCALL_PRE_WRITE_RANGE(p, s)
60 #define POST_SYSCALL(name) \
61 SANITIZER_INTERFACE_ATTRIBUTE void __sanitizer_syscall_post_impl_##name
62 #define POST_READ(p, s) COMMON_SYSCALL_POST_READ_RANGE(p, s)
63 #define POST_WRITE(p, s) COMMON_SYSCALL_POST_WRITE_RANGE(p, s)
65 #ifndef COMMON_SYSCALL_ACQUIRE
66 #define COMMON_SYSCALL_ACQUIRE(addr) ((void)(addr))
69 #ifndef COMMON_SYSCALL_RELEASE
70 #define COMMON_SYSCALL_RELEASE(addr) ((void)(addr))
73 #ifndef COMMON_SYSCALL_FD_CLOSE
74 #define COMMON_SYSCALL_FD_CLOSE(fd) ((void)(fd))
77 #ifndef COMMON_SYSCALL_FD_ACQUIRE
78 #define COMMON_SYSCALL_FD_ACQUIRE(fd) ((void)(fd))
81 #ifndef COMMON_SYSCALL_FD_RELEASE
82 #define COMMON_SYSCALL_FD_RELEASE(fd) ((void)(fd))
85 #ifndef COMMON_SYSCALL_PRE_FORK
86 #define COMMON_SYSCALL_PRE_FORK() \
90 #ifndef COMMON_SYSCALL_POST_FORK
91 #define COMMON_SYSCALL_POST_FORK(res) \
95 // FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such).
98 #define SYS_MAXSYSARGS 8
99 PRE_SYSCALL(syscall)(long long code_, long long args_[SYS_MAXSYSARGS]) {
102 POST_SYSCALL(syscall)
103 (long long res, long long code_, long long args_[SYS_MAXSYSARGS]) {
106 PRE_SYSCALL(exit)(long long rval_) { /* Nothing to do */ }
107 POST_SYSCALL(exit)(long long res, long long rval_) { /* Nothing to do */ }
108 PRE_SYSCALL(fork)(void) { COMMON_SYSCALL_PRE_FORK(); }
109 POST_SYSCALL(fork)(long long res) { COMMON_SYSCALL_POST_FORK(res); }
110 PRE_SYSCALL(read)(long long fd_, void *buf_, long long nbyte_) {
112 PRE_WRITE(buf_, nbyte_);
115 POST_SYSCALL(read)(long long res, long long fd_, void *buf_, long long nbyte_) {
117 POST_WRITE(buf_, res);
120 PRE_SYSCALL(write)(long long fd_, void *buf_, long long nbyte_) {
122 PRE_READ(buf_, nbyte_);
126 (long long res, long long fd_, void *buf_, long long nbyte_) {
128 POST_READ(buf_, res);
131 PRE_SYSCALL(open)(void *path_, long long flags_, long long mode_) {
132 const char *path = (const char *)path_;
134 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
138 (long long res, void *path_, long long flags_, long long mode_) {
140 const char *path = (const char *)path_;
142 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
146 PRE_SYSCALL(close)(long long fd_) { COMMON_SYSCALL_FD_CLOSE((int)fd_); }
147 POST_SYSCALL(close)(long long res, long long fd_) { /* Nothing to do */ }
148 PRE_SYSCALL(compat_50_wait4)
149 (long long pid_, void *status_, long long options_, void *rusage_) {
152 POST_SYSCALL(compat_50_wait4)
153 (long long res, long long pid_, void *status_, long long options_,
157 PRE_SYSCALL(compat_43_ocreat)(void *path_, long long mode_) { /* TODO */ }
158 POST_SYSCALL(compat_43_ocreat)(long long res, void *path_, long long mode_) {
161 PRE_SYSCALL(link)(void *path_, void *link_) {
162 const char *path = (const char *)path_;
163 const char *link = (const char *)link_;
165 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
168 PRE_READ(path, __sanitizer::internal_strlen(link) + 1);
171 POST_SYSCALL(link)(long long res, void *path_, void *link_) {
173 const char *path = (const char *)path_;
174 const char *link = (const char *)link_;
176 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
179 POST_READ(path, __sanitizer::internal_strlen(link) + 1);
183 PRE_SYSCALL(unlink)(void *path_) {
184 const char *path = (const char *)path_;
186 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
189 POST_SYSCALL(unlink)(long long res, void *path_) {
191 const char *path = (const char *)path_;
193 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
197 /* syscall 11 has been skipped */
198 PRE_SYSCALL(chdir)(void *path_) {
199 const char *path = (const char *)path_;
201 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
204 POST_SYSCALL(chdir)(long long res, void *path_) {
206 const char *path = (const char *)path_;
208 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
212 PRE_SYSCALL(fchdir)(long long fd_) { /* Nothing to do */ }
213 POST_SYSCALL(fchdir)(long long res, long long fd_) { /* Nothing to do */ }
214 PRE_SYSCALL(compat_50_mknod)(void *path_, long long mode_, long long dev_) {
217 POST_SYSCALL(compat_50_mknod)
218 (long long res, void *path_, long long mode_, long long dev_) {
221 PRE_SYSCALL(chmod)(void *path_, long long mode_) {
222 const char *path = (const char *)path_;
224 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
227 POST_SYSCALL(chmod)(long long res, void *path_, long long mode_) {
229 const char *path = (const char *)path_;
231 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
235 PRE_SYSCALL(chown)(void *path_, long long uid_, long long gid_) {
236 const char *path = (const char *)path_;
238 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
242 (long long res, void *path_, long long uid_, long long gid_) {
244 const char *path = (const char *)path_;
246 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
250 PRE_SYSCALL(break)(void *nsize_) { /* Nothing to do */ }
251 POST_SYSCALL(break)(long long res, void *nsize_) { /* Nothing to do */ }
252 PRE_SYSCALL(compat_20_getfsstat)
253 (void *buf_, long long bufsize_, long long flags_) {
256 POST_SYSCALL(compat_20_getfsstat)
257 (long long res, void *buf_, long long bufsize_, long long flags_) {
260 PRE_SYSCALL(compat_43_olseek)
261 (long long fd_, long long offset_, long long whence_) {
264 POST_SYSCALL(compat_43_olseek)
265 (long long res, long long fd_, long long offset_, long long whence_) {
268 PRE_SYSCALL(getpid)(void) { /* Nothing to do */ }
269 POST_SYSCALL(getpid)(long long res) { /* Nothing to do */ }
270 PRE_SYSCALL(compat_40_mount)
271 (void *type_, void *path_, long long flags_, void *data_) {
274 POST_SYSCALL(compat_40_mount)
275 (long long res, void *type_, void *path_, long long flags_, void *data_) {
278 PRE_SYSCALL(unmount)(void *path_, long long flags_) {
279 const char *path = (const char *)path_;
281 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
284 POST_SYSCALL(unmount)(long long res, void *path_, long long flags_) {
286 const char *path = (const char *)path_;
288 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
292 PRE_SYSCALL(setuid)(long long uid_) { /* Nothing to do */ }
293 POST_SYSCALL(setuid)(long long res, long long uid_) { /* Nothing to do */ }
294 PRE_SYSCALL(getuid)(void) { /* Nothing to do */ }
295 POST_SYSCALL(getuid)(long long res) { /* Nothing to do */ }
296 PRE_SYSCALL(geteuid)(void) { /* Nothing to do */ }
297 POST_SYSCALL(geteuid)(long long res) { /* Nothing to do */ }
299 (long long req_, long long pid_, void *addr_, long long data_) {
300 if (req_ == ptrace_pt_io) {
301 struct __sanitizer_ptrace_io_desc *addr =
302 (struct __sanitizer_ptrace_io_desc *)addr_;
303 PRE_READ(addr, struct_ptrace_ptrace_io_desc_struct_sz);
304 if (addr->piod_op == ptrace_piod_write_d ||
305 addr->piod_op == ptrace_piod_write_i) {
306 PRE_READ(addr->piod_addr, addr->piod_len);
308 if (addr->piod_op == ptrace_piod_read_d ||
309 addr->piod_op == ptrace_piod_read_i ||
310 addr->piod_op == ptrace_piod_read_auxv) {
311 PRE_WRITE(addr->piod_addr, addr->piod_len);
313 } else if (req_ == ptrace_pt_lwpinfo) {
314 struct __sanitizer_ptrace_lwpinfo *addr =
315 (struct __sanitizer_ptrace_lwpinfo *)addr_;
316 PRE_READ(&addr->pl_lwpid, sizeof(__sanitizer_lwpid_t));
317 PRE_WRITE(addr, struct_ptrace_ptrace_lwpinfo_struct_sz);
318 } else if (req_ == ptrace_pt_set_event_mask) {
319 PRE_READ(addr_, struct_ptrace_ptrace_event_struct_sz);
320 } else if (req_ == ptrace_pt_get_event_mask) {
321 PRE_WRITE(addr_, struct_ptrace_ptrace_event_struct_sz);
322 } else if (req_ == ptrace_pt_set_siginfo) {
323 PRE_READ(addr_, struct_ptrace_ptrace_siginfo_struct_sz);
324 } else if (req_ == ptrace_pt_get_siginfo) {
325 PRE_WRITE(addr_, struct_ptrace_ptrace_siginfo_struct_sz);
326 } else if (req_ == ptrace_pt_lwpstatus) {
327 struct __sanitizer_ptrace_lwpstatus *addr =
328 (struct __sanitizer_ptrace_lwpstatus *)addr_;
329 PRE_READ(&addr->pl_lwpid, sizeof(__sanitizer_lwpid_t));
330 PRE_WRITE(addr, struct_ptrace_ptrace_lwpstatus_struct_sz);
331 } else if (req_ == ptrace_pt_lwpnext) {
332 struct __sanitizer_ptrace_lwpstatus *addr =
333 (struct __sanitizer_ptrace_lwpstatus *)addr_;
334 PRE_READ(&addr->pl_lwpid, sizeof(__sanitizer_lwpid_t));
335 PRE_WRITE(addr, struct_ptrace_ptrace_lwpstatus_struct_sz);
336 } else if (req_ == ptrace_pt_setregs) {
337 PRE_READ(addr_, struct_ptrace_reg_struct_sz);
338 } else if (req_ == ptrace_pt_getregs) {
339 PRE_WRITE(addr_, struct_ptrace_reg_struct_sz);
340 } else if (req_ == ptrace_pt_setfpregs) {
341 PRE_READ(addr_, struct_ptrace_fpreg_struct_sz);
342 } else if (req_ == ptrace_pt_getfpregs) {
343 PRE_WRITE(addr_, struct_ptrace_fpreg_struct_sz);
344 } else if (req_ == ptrace_pt_setdbregs) {
345 PRE_READ(addr_, struct_ptrace_dbreg_struct_sz);
346 } else if (req_ == ptrace_pt_getdbregs) {
347 PRE_WRITE(addr_, struct_ptrace_dbreg_struct_sz);
351 (long long res, long long req_, long long pid_, void *addr_, long long data_) {
353 if (req_ == ptrace_pt_io) {
354 struct __sanitizer_ptrace_io_desc *addr =
355 (struct __sanitizer_ptrace_io_desc *)addr_;
356 POST_READ(addr, struct_ptrace_ptrace_io_desc_struct_sz);
357 if (addr->piod_op == ptrace_piod_write_d ||
358 addr->piod_op == ptrace_piod_write_i) {
359 POST_READ(addr->piod_addr, addr->piod_len);
361 if (addr->piod_op == ptrace_piod_read_d ||
362 addr->piod_op == ptrace_piod_read_i ||
363 addr->piod_op == ptrace_piod_read_auxv) {
364 POST_WRITE(addr->piod_addr, addr->piod_len);
366 } else if (req_ == ptrace_pt_lwpinfo) {
367 struct __sanitizer_ptrace_lwpinfo *addr =
368 (struct __sanitizer_ptrace_lwpinfo *)addr_;
369 POST_READ(&addr->pl_lwpid, sizeof(__sanitizer_lwpid_t));
370 POST_WRITE(addr, struct_ptrace_ptrace_lwpinfo_struct_sz);
371 } else if (req_ == ptrace_pt_set_event_mask) {
372 POST_READ(addr_, struct_ptrace_ptrace_event_struct_sz);
373 } else if (req_ == ptrace_pt_get_event_mask) {
374 POST_WRITE(addr_, struct_ptrace_ptrace_event_struct_sz);
375 } else if (req_ == ptrace_pt_set_siginfo) {
376 POST_READ(addr_, struct_ptrace_ptrace_siginfo_struct_sz);
377 } else if (req_ == ptrace_pt_get_siginfo) {
378 POST_WRITE(addr_, struct_ptrace_ptrace_siginfo_struct_sz);
379 } else if (req_ == ptrace_pt_lwpstatus) {
380 struct __sanitizer_ptrace_lwpstatus *addr =
381 (struct __sanitizer_ptrace_lwpstatus *)addr_;
382 POST_READ(&addr->pl_lwpid, sizeof(__sanitizer_lwpid_t));
383 POST_WRITE(addr, struct_ptrace_ptrace_lwpstatus_struct_sz);
384 } else if (req_ == ptrace_pt_lwpnext) {
385 struct __sanitizer_ptrace_lwpstatus *addr =
386 (struct __sanitizer_ptrace_lwpstatus *)addr_;
387 POST_READ(&addr->pl_lwpid, sizeof(__sanitizer_lwpid_t));
388 POST_WRITE(addr, struct_ptrace_ptrace_lwpstatus_struct_sz);
389 } else if (req_ == ptrace_pt_setregs) {
390 POST_READ(addr_, struct_ptrace_reg_struct_sz);
391 } else if (req_ == ptrace_pt_getregs) {
392 POST_WRITE(addr_, struct_ptrace_reg_struct_sz);
393 } else if (req_ == ptrace_pt_setfpregs) {
394 POST_READ(addr_, struct_ptrace_fpreg_struct_sz);
395 } else if (req_ == ptrace_pt_getfpregs) {
396 POST_WRITE(addr_, struct_ptrace_fpreg_struct_sz);
397 } else if (req_ == ptrace_pt_setdbregs) {
398 POST_READ(addr_, struct_ptrace_dbreg_struct_sz);
399 } else if (req_ == ptrace_pt_getdbregs) {
400 POST_WRITE(addr_, struct_ptrace_dbreg_struct_sz);
404 PRE_SYSCALL(recvmsg)(long long s_, void *msg_, long long flags_) {
405 PRE_WRITE(msg_, sizeof(__sanitizer_msghdr));
407 POST_SYSCALL(recvmsg)
408 (long long res, long long s_, void *msg_, long long flags_) {
410 POST_WRITE(msg_, sizeof(__sanitizer_msghdr));
413 PRE_SYSCALL(sendmsg)(long long s_, void *msg_, long long flags_) {
414 PRE_READ(msg_, sizeof(__sanitizer_msghdr));
416 POST_SYSCALL(sendmsg)
417 (long long res, long long s_, void *msg_, long long flags_) {
419 POST_READ(msg_, sizeof(__sanitizer_msghdr));
422 PRE_SYSCALL(recvfrom)
423 (long long s_, void *buf_, long long len_, long long flags_, void *from_,
424 void *fromlenaddr_) {
425 PRE_WRITE(buf_, len_);
426 PRE_WRITE(from_, struct_sockaddr_sz);
427 PRE_WRITE(fromlenaddr_, sizeof(__sanitizer_socklen_t));
429 POST_SYSCALL(recvfrom)
430 (long long res, long long s_, void *buf_, long long len_, long long flags_,
431 void *from_, void *fromlenaddr_) {
433 POST_WRITE(buf_, res);
434 POST_WRITE(from_, struct_sockaddr_sz);
435 POST_WRITE(fromlenaddr_, sizeof(__sanitizer_socklen_t));
438 PRE_SYSCALL(accept)(long long s_, void *name_, void *anamelen_) {
439 PRE_WRITE(name_, struct_sockaddr_sz);
440 PRE_WRITE(anamelen_, sizeof(__sanitizer_socklen_t));
443 (long long res, long long s_, void *name_, void *anamelen_) {
445 POST_WRITE(name_, struct_sockaddr_sz);
446 POST_WRITE(anamelen_, sizeof(__sanitizer_socklen_t));
449 PRE_SYSCALL(getpeername)(long long fdes_, void *asa_, void *alen_) {
450 PRE_WRITE(asa_, struct_sockaddr_sz);
451 PRE_WRITE(alen_, sizeof(__sanitizer_socklen_t));
453 POST_SYSCALL(getpeername)
454 (long long res, long long fdes_, void *asa_, void *alen_) {
456 POST_WRITE(asa_, struct_sockaddr_sz);
457 POST_WRITE(alen_, sizeof(__sanitizer_socklen_t));
460 PRE_SYSCALL(getsockname)(long long fdes_, void *asa_, void *alen_) {
461 PRE_WRITE(asa_, struct_sockaddr_sz);
462 PRE_WRITE(alen_, sizeof(__sanitizer_socklen_t));
464 POST_SYSCALL(getsockname)
465 (long long res, long long fdes_, void *asa_, void *alen_) {
467 POST_WRITE(asa_, struct_sockaddr_sz);
468 POST_WRITE(alen_, sizeof(__sanitizer_socklen_t));
471 PRE_SYSCALL(access)(void *path_, long long flags_) {
472 const char *path = (const char *)path_;
474 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
477 POST_SYSCALL(access)(long long res, void *path_, long long flags_) {
479 const char *path = (const char *)path_;
481 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
485 PRE_SYSCALL(chflags)(void *path_, long long flags_) {
486 const char *path = (const char *)path_;
488 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
491 POST_SYSCALL(chflags)(long long res, void *path_, long long flags_) {
493 const char *path = (const char *)path_;
495 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
499 PRE_SYSCALL(fchflags)(long long fd_, long long flags_) { /* Nothing to do */ }
500 POST_SYSCALL(fchflags)(long long res, long long fd_, long long flags_) {
503 PRE_SYSCALL(sync)(void) { /* Nothing to do */ }
504 POST_SYSCALL(sync)(long long res) { /* Nothing to do */ }
505 PRE_SYSCALL(kill)(long long pid_, long long signum_) { /* Nothing to do */ }
506 POST_SYSCALL(kill)(long long res, long long pid_, long long signum_) {
509 PRE_SYSCALL(compat_43_stat43)(void *path_, void *ub_) { /* TODO */ }
510 POST_SYSCALL(compat_43_stat43)(long long res, void *path_, void *ub_) {
513 PRE_SYSCALL(getppid)(void) { /* Nothing to do */ }
514 POST_SYSCALL(getppid)(long long res) { /* Nothing to do */ }
515 PRE_SYSCALL(compat_43_lstat43)(void *path_, void *ub_) { /* TODO */ }
516 POST_SYSCALL(compat_43_lstat43)(long long res, void *path_, void *ub_) {
519 PRE_SYSCALL(dup)(long long fd_) { /* Nothing to do */ }
520 POST_SYSCALL(dup)(long long res, long long fd_) { /* Nothing to do */ }
521 PRE_SYSCALL(pipe)(void) {
522 /* pipe returns two descriptors through two returned values */
524 POST_SYSCALL(pipe)(long long res) {
525 /* pipe returns two descriptors through two returned values */
527 PRE_SYSCALL(getegid)(void) { /* Nothing to do */ }
528 POST_SYSCALL(getegid)(long long res) { /* Nothing to do */ }
530 (void *samples_, long long size_, long long offset_, long long scale_) {
532 PRE_WRITE(samples_, size_);
536 (long long res, void *samples_, long long size_, long long offset_,
540 POST_WRITE(samples_, size_);
545 (void *fname_, long long ops_, long long facs_, long long pid_) {
546 const char *fname = (const char *)fname_;
548 PRE_READ(fname, __sanitizer::internal_strlen(fname) + 1);
552 (long long res, void *fname_, long long ops_, long long facs_, long long pid_) {
553 const char *fname = (const char *)fname_;
556 POST_READ(fname, __sanitizer::internal_strlen(fname) + 1);
560 PRE_SYSCALL(compat_13_sigaction13)(long long signum_, void *nsa_, void *osa_) {
563 POST_SYSCALL(compat_13_sigaction13)
564 (long long res, long long signum_, void *nsa_, void *osa_) {
567 PRE_SYSCALL(getgid)(void) { /* Nothing to do */ }
568 POST_SYSCALL(getgid)(long long res) { /* Nothing to do */ }
569 PRE_SYSCALL(compat_13_sigprocmask13)(long long how_, long long mask_) {
572 POST_SYSCALL(compat_13_sigprocmask13)
573 (long long res, long long how_, long long mask_) {
576 PRE_SYSCALL(__getlogin)(void *namebuf_, long long namelen_) {
578 PRE_WRITE(namebuf_, namelen_);
581 POST_SYSCALL(__getlogin)(long long res, void *namebuf_, long long namelen_) {
584 POST_WRITE(namebuf_, namelen_);
588 PRE_SYSCALL(__setlogin)(void *namebuf_) {
589 const char *namebuf = (const char *)namebuf_;
591 PRE_READ(namebuf, __sanitizer::internal_strlen(namebuf) + 1);
594 POST_SYSCALL(__setlogin)(long long res, void *namebuf_) {
596 const char *namebuf = (const char *)namebuf_;
598 POST_READ(namebuf, __sanitizer::internal_strlen(namebuf) + 1);
602 PRE_SYSCALL(acct)(void *path_) {
603 const char *path = (const char *)path_;
605 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
608 POST_SYSCALL(acct)(long long res, void *path_) {
610 const char *path = (const char *)path_;
612 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
616 PRE_SYSCALL(compat_13_sigpending13)(void) { /* TODO */ }
617 POST_SYSCALL(compat_13_sigpending13)(long long res) { /* TODO */ }
618 PRE_SYSCALL(compat_13_sigaltstack13)(void *nss_, void *oss_) { /* TODO */ }
619 POST_SYSCALL(compat_13_sigaltstack13)(long long res, void *nss_, void *oss_) {
622 PRE_SYSCALL(ioctl)(long long fd_, long long com_, void *data_) {
625 POST_SYSCALL(ioctl)(long long res, long long fd_, long long com_, void *data_) {
628 PRE_SYSCALL(compat_12_oreboot)(long long opt_) { /* TODO */ }
629 POST_SYSCALL(compat_12_oreboot)(long long res, long long opt_) { /* TODO */ }
630 PRE_SYSCALL(revoke)(void *path_) {
631 const char *path = (const char *)path_;
633 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
636 POST_SYSCALL(revoke)(long long res, void *path_) {
638 const char *path = (const char *)path_;
640 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
644 PRE_SYSCALL(symlink)(void *path_, void *link_) {
645 const char *path = (const char *)path_;
646 const char *link = (const char *)link_;
648 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
651 PRE_READ(link, __sanitizer::internal_strlen(link) + 1);
654 POST_SYSCALL(symlink)(long long res, void *path_, void *link_) {
656 const char *path = (const char *)path_;
657 const char *link = (const char *)link_;
659 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
662 POST_READ(link, __sanitizer::internal_strlen(link) + 1);
666 PRE_SYSCALL(readlink)(void *path_, void *buf_, long long count_) {
667 const char *path = (const char *)path_;
669 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
672 PRE_WRITE(buf_, count_);
675 POST_SYSCALL(readlink)
676 (long long res, void *path_, void *buf_, long long count_) {
678 const char *path = (const char *)path_;
680 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
683 PRE_WRITE(buf_, res);
687 PRE_SYSCALL(execve)(void *path_, void *argp_, void *envp_) {
688 const char *path = (const char *)path_;
689 char **argp = (char **)argp_;
690 char **envp = (char **)envp_;
692 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
694 if (argp && argp[0]) {
697 PRE_READ(a, __sanitizer::internal_strlen(a) + 1);
700 if (envp && envp[0]) {
703 PRE_READ(e, __sanitizer::internal_strlen(e) + 1);
707 POST_SYSCALL(execve)(long long res, void *path_, void *argp_, void *envp_) {
708 /* If we are here, something went wrong */
709 const char *path = (const char *)path_;
710 char **argp = (char **)argp_;
711 char **envp = (char **)envp_;
713 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
715 if (argp && argp[0]) {
718 POST_READ(a, __sanitizer::internal_strlen(a) + 1);
721 if (envp && envp[0]) {
724 POST_READ(e, __sanitizer::internal_strlen(e) + 1);
728 PRE_SYSCALL(umask)(long long newmask_) { /* Nothing to do */ }
729 POST_SYSCALL(umask)(long long res, long long newmask_) { /* Nothing to do */ }
730 PRE_SYSCALL(chroot)(void *path_) {
731 const char *path = (const char *)path_;
733 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
736 POST_SYSCALL(chroot)(long long res, void *path_) {
738 const char *path = (const char *)path_;
740 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
744 PRE_SYSCALL(compat_43_fstat43)(long long fd_, void *sb_) { /* TODO */ }
745 POST_SYSCALL(compat_43_fstat43)(long long res, long long fd_, void *sb_) {
748 PRE_SYSCALL(compat_43_ogetkerninfo)
749 (long long op_, void *where_, void *size_, long long arg_) {
752 POST_SYSCALL(compat_43_ogetkerninfo)
753 (long long res, long long op_, void *where_, void *size_, long long arg_) {
756 PRE_SYSCALL(compat_43_ogetpagesize)(void) { /* TODO */ }
757 POST_SYSCALL(compat_43_ogetpagesize)(long long res) { /* TODO */ }
758 PRE_SYSCALL(compat_12_msync)(void *addr_, long long len_) { /* TODO */ }
759 POST_SYSCALL(compat_12_msync)(long long res, void *addr_, long long len_) {
762 PRE_SYSCALL(vfork)(void) { /* Nothing to do */ }
763 POST_SYSCALL(vfork)(long long res) { /* Nothing to do */ }
764 /* syscall 67 has been skipped */
765 /* syscall 68 has been skipped */
766 /* syscall 69 has been skipped */
767 /* syscall 70 has been skipped */
768 PRE_SYSCALL(compat_43_ommap)
769 (void *addr_, long long len_, long long prot_, long long flags_, long long fd_,
773 POST_SYSCALL(compat_43_ommap)
774 (long long res, void *addr_, long long len_, long long prot_, long long flags_,
775 long long fd_, long long pos_) {
778 PRE_SYSCALL(vadvise)(long long anom_) { /* Nothing to do */ }
779 POST_SYSCALL(vadvise)(long long res, long long anom_) { /* Nothing to do */ }
780 PRE_SYSCALL(munmap)(void *addr_, long long len_) { /* Nothing to do */ }
781 POST_SYSCALL(munmap)(long long res, void *addr_, long long len_) {
784 PRE_SYSCALL(mprotect)(void *addr_, long long len_, long long prot_) {
787 POST_SYSCALL(mprotect)
788 (long long res, void *addr_, long long len_, long long prot_) {
791 PRE_SYSCALL(madvise)(void *addr_, long long len_, long long behav_) {
794 POST_SYSCALL(madvise)
795 (long long res, void *addr_, long long len_, long long behav_) {
798 /* syscall 76 has been skipped */
799 /* syscall 77 has been skipped */
800 PRE_SYSCALL(mincore)(void *addr_, long long len_, void *vec_) {
803 POST_SYSCALL(mincore)(long long res, void *addr_, long long len_, void *vec_) {
806 PRE_SYSCALL(getgroups)(long long gidsetsize_, void *gidset_) {
807 unsigned int *gidset = (unsigned int *)gidset_;
809 PRE_WRITE(gidset, sizeof(*gidset) * gidsetsize_);
812 POST_SYSCALL(getgroups)(long long res, long long gidsetsize_, void *gidset_) {
814 unsigned int *gidset = (unsigned int *)gidset_;
816 POST_WRITE(gidset, sizeof(*gidset) * gidsetsize_);
820 PRE_SYSCALL(setgroups)(long long gidsetsize_, void *gidset_) {
821 unsigned int *gidset = (unsigned int *)gidset_;
823 PRE_READ(gidset, sizeof(*gidset) * gidsetsize_);
826 POST_SYSCALL(setgroups)(long long res, long long gidsetsize_, void *gidset_) {
828 unsigned int *gidset = (unsigned int *)gidset_;
830 POST_READ(gidset, sizeof(*gidset) * gidsetsize_);
834 PRE_SYSCALL(getpgrp)(void) { /* Nothing to do */ }
835 POST_SYSCALL(getpgrp)(long long res) { /* Nothing to do */ }
836 PRE_SYSCALL(setpgid)(long long pid_, long long pgid_) { /* Nothing to do */ }
837 POST_SYSCALL(setpgid)(long long res, long long pid_, long long pgid_) {
840 PRE_SYSCALL(compat_50_setitimer)(long long which_, void *itv_, void *oitv_) {
843 POST_SYSCALL(compat_50_setitimer)
844 (long long res, long long which_, void *itv_, void *oitv_) {
847 PRE_SYSCALL(compat_43_owait)(void) { /* TODO */ }
848 POST_SYSCALL(compat_43_owait)(long long res) { /* TODO */ }
849 PRE_SYSCALL(compat_12_oswapon)(void *name_) { /* TODO */ }
850 POST_SYSCALL(compat_12_oswapon)(long long res, void *name_) { /* TODO */ }
851 PRE_SYSCALL(compat_50_getitimer)(long long which_, void *itv_) { /* TODO */ }
852 POST_SYSCALL(compat_50_getitimer)(long long res, long long which_, void *itv_) {
855 PRE_SYSCALL(compat_43_ogethostname)(void *hostname_, long long len_) {
858 POST_SYSCALL(compat_43_ogethostname)
859 (long long res, void *hostname_, long long len_) {
862 PRE_SYSCALL(compat_43_osethostname)(void *hostname_, long long len_) {
865 POST_SYSCALL(compat_43_osethostname)
866 (long long res, void *hostname_, long long len_) {
869 PRE_SYSCALL(compat_43_ogetdtablesize)(void) { /* TODO */ }
870 POST_SYSCALL(compat_43_ogetdtablesize)(long long res) { /* TODO */ }
871 PRE_SYSCALL(dup2)(long long from_, long long to_) { /* Nothing to do */ }
872 POST_SYSCALL(dup2)(long long res, long long from_, long long to_) {
875 PRE_SYSCALL(getrandom)(void *buf_, long long buflen_, long long flags_) {
878 POST_SYSCALL(getrandom)
879 (long long res, void *buf_, long long buflen_, long long flags_) {
882 PRE_SYSCALL(fcntl)(long long fd_, long long cmd_, void *arg_) {
885 POST_SYSCALL(fcntl)(long long res, long long fd_, long long cmd_, void *arg_) {
888 PRE_SYSCALL(compat_50_select)
889 (long long nd_, void *in_, void *ou_, void *ex_, void *tv_) {
892 POST_SYSCALL(compat_50_select)
893 (long long res, long long nd_, void *in_, void *ou_, void *ex_, void *tv_) {
896 /* syscall 94 has been skipped */
897 PRE_SYSCALL(fsync)(long long fd_) { /* Nothing to do */ }
898 POST_SYSCALL(fsync)(long long res, long long fd_) { /* Nothing to do */ }
899 PRE_SYSCALL(setpriority)(long long which_, long long who_, long long prio_) {
902 POST_SYSCALL(setpriority)
903 (long long res, long long which_, long long who_, long long prio_) {
906 PRE_SYSCALL(compat_30_socket)
907 (long long domain_, long long type_, long long protocol_) {
910 POST_SYSCALL(compat_30_socket)
911 (long long res, long long domain_, long long type_, long long protocol_) {
914 PRE_SYSCALL(connect)(long long s_, void *name_, long long namelen_) {
915 PRE_READ(name_, namelen_);
917 POST_SYSCALL(connect)
918 (long long res, long long s_, void *name_, long long namelen_) {
920 POST_READ(name_, namelen_);
923 PRE_SYSCALL(compat_43_oaccept)(long long s_, void *name_, void *anamelen_) {
926 POST_SYSCALL(compat_43_oaccept)
927 (long long res, long long s_, void *name_, void *anamelen_) {
930 PRE_SYSCALL(getpriority)(long long which_, long long who_) {
933 POST_SYSCALL(getpriority)(long long res, long long which_, long long who_) {
936 PRE_SYSCALL(compat_43_osend)
937 (long long s_, void *buf_, long long len_, long long flags_) {
940 POST_SYSCALL(compat_43_osend)
941 (long long res, long long s_, void *buf_, long long len_, long long flags_) {
944 PRE_SYSCALL(compat_43_orecv)
945 (long long s_, void *buf_, long long len_, long long flags_) {
948 POST_SYSCALL(compat_43_orecv)
949 (long long res, long long s_, void *buf_, long long len_, long long flags_) {
952 PRE_SYSCALL(compat_13_sigreturn13)(void *sigcntxp_) { /* TODO */ }
953 POST_SYSCALL(compat_13_sigreturn13)(long long res, void *sigcntxp_) {
956 PRE_SYSCALL(bind)(long long s_, void *name_, long long namelen_) {
957 PRE_READ(name_, namelen_);
960 (long long res, long long s_, void *name_, long long namelen_) {
962 PRE_READ(name_, namelen_);
965 PRE_SYSCALL(setsockopt)
966 (long long s_, long long level_, long long name_, void *val_,
967 long long valsize_) {
969 PRE_READ(val_, valsize_);
972 POST_SYSCALL(setsockopt)
973 (long long res, long long s_, long long level_, long long name_, void *val_,
974 long long valsize_) {
977 POST_READ(val_, valsize_);
981 PRE_SYSCALL(listen)(long long s_, long long backlog_) { /* Nothing to do */ }
982 POST_SYSCALL(listen)(long long res, long long s_, long long backlog_) {
985 /* syscall 107 has been skipped */
986 PRE_SYSCALL(compat_43_osigvec)(long long signum_, void *nsv_, void *osv_) {
989 POST_SYSCALL(compat_43_osigvec)
990 (long long res, long long signum_, void *nsv_, void *osv_) {
993 PRE_SYSCALL(compat_43_osigblock)(long long mask_) { /* TODO */ }
994 POST_SYSCALL(compat_43_osigblock)(long long res, long long mask_) { /* TODO */ }
995 PRE_SYSCALL(compat_43_osigsetmask)(long long mask_) { /* TODO */ }
996 POST_SYSCALL(compat_43_osigsetmask)(long long res, long long mask_) {
999 PRE_SYSCALL(compat_13_sigsuspend13)(long long mask_) { /* TODO */ }
1000 POST_SYSCALL(compat_13_sigsuspend13)(long long res, long long mask_) {
1003 PRE_SYSCALL(compat_43_osigstack)(void *nss_, void *oss_) { /* TODO */ }
1004 POST_SYSCALL(compat_43_osigstack)(long long res, void *nss_, void *oss_) {
1007 PRE_SYSCALL(compat_43_orecvmsg)(long long s_, void *msg_, long long flags_) {
1010 POST_SYSCALL(compat_43_orecvmsg)
1011 (long long res, long long s_, void *msg_, long long flags_) {
1014 PRE_SYSCALL(compat_43_osendmsg)(long long s_, void *msg_, long long flags_) {
1017 POST_SYSCALL(compat_43_osendmsg)
1018 (long long res, long long s_, void *msg_, long long flags_) {
1021 /* syscall 115 has been skipped */
1022 PRE_SYSCALL(compat_50_gettimeofday)(void *tp_, void *tzp_) { /* TODO */ }
1023 POST_SYSCALL(compat_50_gettimeofday)(long long res, void *tp_, void *tzp_) {
1026 PRE_SYSCALL(compat_50_getrusage)(long long who_, void *rusage_) { /* TODO */ }
1027 POST_SYSCALL(compat_50_getrusage)
1028 (long long res, long long who_, void *rusage_) {
1031 PRE_SYSCALL(getsockopt)
1032 (long long s_, long long level_, long long name_, void *val_, void *avalsize_) {
1035 POST_SYSCALL(getsockopt)
1036 (long long res, long long s_, long long level_, long long name_, void *val_,
1040 /* syscall 119 has been skipped */
1041 PRE_SYSCALL(readv)(long long fd_, void *iovp_, long long iovcnt_) {
1042 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_;
1045 PRE_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_);
1046 for (i = 0; i < iovcnt_; i++) {
1047 PRE_WRITE(iovp[i].iov_base, iovp[i].iov_len);
1052 (long long res, long long fd_, void *iovp_, long long iovcnt_) {
1053 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_;
1058 POST_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_);
1059 for (i = 0; i < iovcnt_ && n > 0; i++) {
1060 m = n > iovp[i].iov_len ? iovp[i].iov_len : n;
1061 POST_WRITE(iovp[i].iov_base, m);
1067 PRE_SYSCALL(writev)(long long fd_, void *iovp_, long long iovcnt_) {
1068 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_;
1071 PRE_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_);
1072 for (i = 0; i < iovcnt_; i++) {
1073 PRE_READ(iovp[i].iov_base, iovp[i].iov_len);
1077 POST_SYSCALL(writev)
1078 (long long res, long long fd_, void *iovp_, long long iovcnt_) {
1079 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_;
1084 POST_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_);
1085 for (i = 0; i < iovcnt_ && n > 0; i++) {
1086 m = n > iovp[i].iov_len ? iovp[i].iov_len : n;
1087 POST_READ(iovp[i].iov_base, m);
1093 PRE_SYSCALL(compat_50_settimeofday)(void *tv_, void *tzp_) { /* TODO */ }
1094 POST_SYSCALL(compat_50_settimeofday)(long long res, void *tv_, void *tzp_) {
1097 PRE_SYSCALL(fchown)(long long fd_, long long uid_, long long gid_) {
1100 POST_SYSCALL(fchown)
1101 (long long res, long long fd_, long long uid_, long long gid_) {
1104 PRE_SYSCALL(fchmod)(long long fd_, long long mode_) { /* Nothing to do */ }
1105 POST_SYSCALL(fchmod)(long long res, long long fd_, long long mode_) {
1108 PRE_SYSCALL(compat_43_orecvfrom)
1109 (long long s_, void *buf_, long long len_, long long flags_, void *from_,
1110 void *fromlenaddr_) {
1113 POST_SYSCALL(compat_43_orecvfrom)
1114 (long long res, long long s_, void *buf_, long long len_, long long flags_,
1115 void *from_, void *fromlenaddr_) {
1118 PRE_SYSCALL(setreuid)(long long ruid_, long long euid_) { /* Nothing to do */ }
1119 POST_SYSCALL(setreuid)(long long res, long long ruid_, long long euid_) {
1122 PRE_SYSCALL(setregid)(long long rgid_, long long egid_) { /* Nothing to do */ }
1123 POST_SYSCALL(setregid)(long long res, long long rgid_, long long egid_) {
1126 PRE_SYSCALL(rename)(void *from_, void *to_) {
1127 const char *from = (const char *)from_;
1128 const char *to = (const char *)to_;
1130 PRE_READ(from, __sanitizer::internal_strlen(from) + 1);
1133 PRE_READ(to, __sanitizer::internal_strlen(to) + 1);
1136 POST_SYSCALL(rename)(long long res, void *from_, void *to_) {
1138 const char *from = (const char *)from_;
1139 const char *to = (const char *)to_;
1141 POST_READ(from, __sanitizer::internal_strlen(from) + 1);
1144 POST_READ(to, __sanitizer::internal_strlen(to) + 1);
1148 PRE_SYSCALL(compat_43_otruncate)(void *path_, long long length_) { /* TODO */ }
1149 POST_SYSCALL(compat_43_otruncate)
1150 (long long res, void *path_, long long length_) {
1153 PRE_SYSCALL(compat_43_oftruncate)(long long fd_, long long length_) {
1156 POST_SYSCALL(compat_43_oftruncate)
1157 (long long res, long long fd_, long long length_) {
1160 PRE_SYSCALL(flock)(long long fd_, long long how_) { /* Nothing to do */ }
1161 POST_SYSCALL(flock)(long long res, long long fd_, long long how_) {
1164 PRE_SYSCALL(mkfifo)(void *path_, long long mode_) {
1165 const char *path = (const char *)path_;
1167 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
1170 POST_SYSCALL(mkfifo)(long long res, void *path_, long long mode_) {
1172 const char *path = (const char *)path_;
1174 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
1179 (long long s_, void *buf_, long long len_, long long flags_, void *to_,
1181 PRE_READ(buf_, len_);
1182 PRE_READ(to_, tolen_);
1184 POST_SYSCALL(sendto)
1185 (long long res, long long s_, void *buf_, long long len_, long long flags_,
1186 void *to_, long long tolen_) {
1188 POST_READ(buf_, len_);
1189 POST_READ(to_, tolen_);
1192 PRE_SYSCALL(shutdown)(long long s_, long long how_) { /* Nothing to do */ }
1193 POST_SYSCALL(shutdown)(long long res, long long s_, long long how_) {
1196 PRE_SYSCALL(socketpair)
1197 (long long domain_, long long type_, long long protocol_, void *rsv_) {
1198 PRE_WRITE(rsv_, 2 * sizeof(int));
1200 POST_SYSCALL(socketpair)
1201 (long long res, long long domain_, long long type_, long long protocol_,
1204 POST_WRITE(rsv_, 2 * sizeof(int));
1207 PRE_SYSCALL(mkdir)(void *path_, long long mode_) {
1208 const char *path = (const char *)path_;
1210 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
1213 POST_SYSCALL(mkdir)(long long res, void *path_, long long mode_) {
1215 const char *path = (const char *)path_;
1217 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
1221 PRE_SYSCALL(rmdir)(void *path_) {
1222 const char *path = (const char *)path_;
1224 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
1227 POST_SYSCALL(rmdir)(long long res, void *path_) {
1229 const char *path = (const char *)path_;
1231 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
1235 PRE_SYSCALL(compat_50_utimes)(void *path_, void *tptr_) { /* TODO */ }
1236 POST_SYSCALL(compat_50_utimes)(long long res, void *path_, void *tptr_) {
1239 /* syscall 139 has been skipped */
1240 PRE_SYSCALL(compat_50_adjtime)(void *delta_, void *olddelta_) { /* TODO */ }
1241 POST_SYSCALL(compat_50_adjtime)(long long res, void *delta_, void *olddelta_) {
1244 PRE_SYSCALL(compat_43_ogetpeername)(long long fdes_, void *asa_, void *alen_) {
1247 POST_SYSCALL(compat_43_ogetpeername)
1248 (long long res, long long fdes_, void *asa_, void *alen_) {
1251 PRE_SYSCALL(compat_43_ogethostid)(void) { /* TODO */ }
1252 POST_SYSCALL(compat_43_ogethostid)(long long res) { /* TODO */ }
1253 PRE_SYSCALL(compat_43_osethostid)(long long hostid_) { /* TODO */ }
1254 POST_SYSCALL(compat_43_osethostid)(long long res, long long hostid_) {
1257 PRE_SYSCALL(compat_43_ogetrlimit)(long long which_, void *rlp_) { /* TODO */ }
1258 POST_SYSCALL(compat_43_ogetrlimit)
1259 (long long res, long long which_, void *rlp_) {
1262 PRE_SYSCALL(compat_43_osetrlimit)(long long which_, void *rlp_) { /* TODO */ }
1263 POST_SYSCALL(compat_43_osetrlimit)
1264 (long long res, long long which_, void *rlp_) {
1267 PRE_SYSCALL(compat_43_okillpg)(long long pgid_, long long signum_) {
1270 POST_SYSCALL(compat_43_okillpg)
1271 (long long res, long long pgid_, long long signum_) {
1274 PRE_SYSCALL(setsid)(void) { /* Nothing to do */ }
1275 POST_SYSCALL(setsid)(long long res) { /* Nothing to do */ }
1276 PRE_SYSCALL(compat_50_quotactl)
1277 (void *path_, long long cmd_, long long uid_, void *arg_) {
1280 POST_SYSCALL(compat_50_quotactl)
1281 (long long res, void *path_, long long cmd_, long long uid_, void *arg_) {
1284 PRE_SYSCALL(compat_43_oquota)(void) { /* TODO */ }
1285 POST_SYSCALL(compat_43_oquota)(long long res) { /* TODO */ }
1286 PRE_SYSCALL(compat_43_ogetsockname)(long long fdec_, void *asa_, void *alen_) {
1289 POST_SYSCALL(compat_43_ogetsockname)
1290 (long long res, long long fdec_, void *asa_, void *alen_) {
1293 /* syscall 151 has been skipped */
1294 /* syscall 152 has been skipped */
1295 /* syscall 153 has been skipped */
1296 /* syscall 154 has been skipped */
1297 PRE_SYSCALL(nfssvc)(long long flag_, void *argp_) { /* Nothing to do */ }
1298 POST_SYSCALL(nfssvc)(long long res, long long flag_, void *argp_) {
1301 PRE_SYSCALL(compat_43_ogetdirentries)
1302 (long long fd_, void *buf_, long long count_, void *basep_) {
1305 POST_SYSCALL(compat_43_ogetdirentries)
1306 (long long res, long long fd_, void *buf_, long long count_, void *basep_) {
1309 PRE_SYSCALL(compat_20_statfs)(void *path_, void *buf_) { /* TODO */ }
1310 POST_SYSCALL(compat_20_statfs)(long long res, void *path_, void *buf_) {
1313 PRE_SYSCALL(compat_20_fstatfs)(long long fd_, void *buf_) { /* TODO */ }
1314 POST_SYSCALL(compat_20_fstatfs)(long long res, long long fd_, void *buf_) {
1317 /* syscall 159 has been skipped */
1318 /* syscall 160 has been skipped */
1319 PRE_SYSCALL(compat_30_getfh)(void *fname_, void *fhp_) { /* TODO */ }
1320 POST_SYSCALL(compat_30_getfh)(long long res, void *fname_, void *fhp_) {
1323 PRE_SYSCALL(compat_09_ogetdomainname)(void *domainname_, long long len_) {
1326 POST_SYSCALL(compat_09_ogetdomainname)
1327 (long long res, void *domainname_, long long len_) {
1330 PRE_SYSCALL(compat_09_osetdomainname)(void *domainname_, long long len_) {
1333 POST_SYSCALL(compat_09_osetdomainname)
1334 (long long res, void *domainname_, long long len_) {
1337 PRE_SYSCALL(compat_09_ouname)(void *name_) { /* TODO */ }
1338 POST_SYSCALL(compat_09_ouname)(long long res, void *name_) { /* TODO */ }
1339 PRE_SYSCALL(sysarch)(long long op_, void *parms_) { /* TODO */ }
1340 POST_SYSCALL(sysarch)(long long res, long long op_, void *parms_) { /* TODO */ }
1341 PRE_SYSCALL(__futex)
1342 (void *uaddr_, long long op_, long long val_, void *timeout_, void *uaddr2_,
1343 long long val2_, long long val3_) {
1346 POST_SYSCALL(__futex)
1347 (long long res, void *uaddr_, long long op_, long long val_, void *timeout_,
1348 void *uaddr2_, long long val2_, long long val3_) {
1351 PRE_SYSCALL(__futex_set_robust_list)(void *head_, long long len_) { /* TODO */ }
1352 POST_SYSCALL(__futex_set_robust_list)
1353 (long long res, void *head_, long long len_) {
1356 PRE_SYSCALL(__futex_get_robust_list)
1357 (long long lwpid_, void **headp_, void *lenp_) {
1360 POST_SYSCALL(__futex_get_robust_list)
1361 (long long res, long long lwpid_, void **headp_, void *lenp_) {
1365 PRE_SYSCALL(compat_10_osemsys)
1366 (long long which_, long long a2_, long long a3_, long long a4_, long long a5_) {
1369 POST_SYSCALL(compat_10_osemsys)
1370 (long long res, long long which_, long long a2_, long long a3_, long long a4_,
1375 /* syscall 169 has been skipped */
1378 PRE_SYSCALL(compat_10_omsgsys)
1379 (long long which_, long long a2_, long long a3_, long long a4_, long long a5_,
1383 POST_SYSCALL(compat_10_omsgsys)
1384 (long long res, long long which_, long long a2_, long long a3_, long long a4_,
1385 long long a5_, long long a6_) {
1389 /* syscall 170 has been skipped */
1392 PRE_SYSCALL(compat_10_oshmsys)
1393 (long long which_, long long a2_, long long a3_, long long a4_) {
1396 POST_SYSCALL(compat_10_oshmsys)
1397 (long long res, long long which_, long long a2_, long long a3_, long long a4_) {
1401 /* syscall 171 has been skipped */
1403 /* syscall 172 has been skipped */
1405 (long long fd_, void *buf_, long long nbyte_, long long PAD_,
1406 long long offset_) {
1408 PRE_WRITE(buf_, nbyte_);
1412 (long long res, long long fd_, void *buf_, long long nbyte_, long long PAD_,
1413 long long offset_) {
1415 POST_WRITE(buf_, res);
1419 (long long fd_, void *buf_, long long nbyte_, long long PAD_,
1420 long long offset_) {
1422 PRE_READ(buf_, nbyte_);
1425 POST_SYSCALL(pwrite)
1426 (long long res, long long fd_, void *buf_, long long nbyte_, long long PAD_,
1427 long long offset_) {
1429 POST_READ(buf_, res);
1432 PRE_SYSCALL(compat_30_ntp_gettime)(void *ntvp_) { /* TODO */ }
1433 POST_SYSCALL(compat_30_ntp_gettime)(long long res, void *ntvp_) { /* TODO */ }
1434 #if defined(NTP) || !defined(_KERNEL_OPT)
1435 PRE_SYSCALL(ntp_adjtime)(void *tp_) { /* Nothing to do */ }
1436 POST_SYSCALL(ntp_adjtime)(long long res, void *tp_) { /* Nothing to do */ }
1438 /* syscall 176 has been skipped */
1440 /* syscall 177 has been skipped */
1441 /* syscall 178 has been skipped */
1442 /* syscall 179 has been skipped */
1443 /* syscall 180 has been skipped */
1444 PRE_SYSCALL(setgid)(long long gid_) { /* Nothing to do */ }
1445 POST_SYSCALL(setgid)(long long res, long long gid_) { /* Nothing to do */ }
1446 PRE_SYSCALL(setegid)(long long egid_) { /* Nothing to do */ }
1447 POST_SYSCALL(setegid)(long long res, long long egid_) { /* Nothing to do */ }
1448 PRE_SYSCALL(seteuid)(long long euid_) { /* Nothing to do */ }
1449 POST_SYSCALL(seteuid)(long long res, long long euid_) { /* Nothing to do */ }
1450 PRE_SYSCALL(lfs_bmapv)(void *fsidp_, void *blkiov_, long long blkcnt_) {
1453 POST_SYSCALL(lfs_bmapv)
1454 (long long res, void *fsidp_, void *blkiov_, long long blkcnt_) {
1457 PRE_SYSCALL(lfs_markv)(void *fsidp_, void *blkiov_, long long blkcnt_) {
1460 POST_SYSCALL(lfs_markv)
1461 (long long res, void *fsidp_, void *blkiov_, long long blkcnt_) {
1464 PRE_SYSCALL(lfs_segclean)(void *fsidp_, long long segment_) { /* TODO */ }
1465 POST_SYSCALL(lfs_segclean)(long long res, void *fsidp_, long long segment_) {
1468 PRE_SYSCALL(compat_50_lfs_segwait)(void *fsidp_, void *tv_) { /* TODO */ }
1469 POST_SYSCALL(compat_50_lfs_segwait)(long long res, void *fsidp_, void *tv_) {
1472 PRE_SYSCALL(compat_12_stat12)(void *path_, void *ub_) { /* TODO */ }
1473 POST_SYSCALL(compat_12_stat12)(long long res, void *path_, void *ub_) {
1476 PRE_SYSCALL(compat_12_fstat12)(long long fd_, void *sb_) { /* TODO */ }
1477 POST_SYSCALL(compat_12_fstat12)(long long res, long long fd_, void *sb_) {
1480 PRE_SYSCALL(compat_12_lstat12)(void *path_, void *ub_) { /* TODO */ }
1481 POST_SYSCALL(compat_12_lstat12)(long long res, void *path_, void *ub_) {
1484 PRE_SYSCALL(pathconf)(void *path_, long long name_) {
1485 const char *path = (const char *)path_;
1487 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
1490 POST_SYSCALL(pathconf)(long long res, void *path_, long long name_) {
1492 const char *path = (const char *)path_;
1494 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
1498 PRE_SYSCALL(fpathconf)(long long fd_, long long name_) { /* Nothing to do */ }
1499 POST_SYSCALL(fpathconf)(long long res, long long fd_, long long name_) {
1502 PRE_SYSCALL(getsockopt2)
1503 (long long s_, long long level_, long long name_, void *val_, void *avalsize_) {
1506 POST_SYSCALL(getsockopt2)
1507 (long long res, long long s_, long long level_, long long name_, void *val_,
1511 PRE_SYSCALL(getrlimit)(long long which_, void *rlp_) {
1512 PRE_WRITE(rlp_, struct_rlimit_sz);
1514 POST_SYSCALL(getrlimit)(long long res, long long which_, void *rlp_) {
1516 POST_WRITE(rlp_, struct_rlimit_sz);
1519 PRE_SYSCALL(setrlimit)(long long which_, void *rlp_) {
1520 PRE_READ(rlp_, struct_rlimit_sz);
1522 POST_SYSCALL(setrlimit)(long long res, long long which_, void *rlp_) {
1524 POST_READ(rlp_, struct_rlimit_sz);
1527 PRE_SYSCALL(compat_12_getdirentries)
1528 (long long fd_, void *buf_, long long count_, void *basep_) {
1531 POST_SYSCALL(compat_12_getdirentries)
1532 (long long res, long long fd_, void *buf_, long long count_, void *basep_) {
1536 (void *addr_, long long len_, long long prot_, long long flags_, long long fd_,
1537 long long PAD_, long long pos_) {
1541 (long long res, void *addr_, long long len_, long long prot_, long long flags_,
1542 long long fd_, long long PAD_, long long pos_) {
1545 PRE_SYSCALL(__syscall)(long long code_, long long args_[SYS_MAXSYSARGS]) {
1548 POST_SYSCALL(__syscall)
1549 (long long res, long long code_, long long args_[SYS_MAXSYSARGS]) {
1553 (long long fd_, long long PAD_, long long offset_, long long whence_) {
1557 (long long res, long long fd_, long long PAD_, long long offset_,
1558 long long whence_) {
1561 PRE_SYSCALL(truncate)(void *path_, long long PAD_, long long length_) {
1562 const char *path = (const char *)path_;
1564 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
1567 POST_SYSCALL(truncate)
1568 (long long res, void *path_, long long PAD_, long long length_) {
1570 const char *path = (const char *)path_;
1572 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
1576 PRE_SYSCALL(ftruncate)(long long fd_, long long PAD_, long long length_) {
1579 POST_SYSCALL(ftruncate)
1580 (long long res, long long fd_, long long PAD_, long long length_) {
1583 PRE_SYSCALL(__sysctl)
1584 (void *name_, long long namelen_, void *oldv_, void *oldlenp_, void *newv_,
1585 long long newlen_) {
1586 const int *name = (const int *)name_;
1588 PRE_READ(name, namelen_ * sizeof(*name));
1591 PRE_READ(name, newlen_);
1594 POST_SYSCALL(__sysctl)
1595 (long long res, void *name_, long long namelen_, void *oldv_, void *oldlenp_,
1596 void *newv_, long long newlen_) {
1598 const int *name = (const int *)name_;
1600 POST_READ(name, namelen_ * sizeof(*name));
1603 POST_READ(name, newlen_);
1607 PRE_SYSCALL(mlock)(void *addr_, long long len_) { /* Nothing to do */ }
1608 POST_SYSCALL(mlock)(long long res, void *addr_, long long len_) {
1611 PRE_SYSCALL(munlock)(void *addr_, long long len_) { /* Nothing to do */ }
1612 POST_SYSCALL(munlock)(long long res, void *addr_, long long len_) {
1615 PRE_SYSCALL(undelete)(void *path_) {
1616 const char *path = (const char *)path_;
1618 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
1621 POST_SYSCALL(undelete)(long long res, void *path_) {
1623 const char *path = (const char *)path_;
1625 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
1629 PRE_SYSCALL(compat_50_futimes)(long long fd_, void *tptr_) { /* TODO */ }
1630 POST_SYSCALL(compat_50_futimes)(long long res, long long fd_, void *tptr_) {
1633 PRE_SYSCALL(getpgid)(long long pid_) { /* Nothing to do */ }
1634 POST_SYSCALL(getpgid)(long long res, long long pid_) { /* Nothing to do */ }
1635 PRE_SYSCALL(reboot)(long long opt_, void *bootstr_) {
1636 const char *bootstr = (const char *)bootstr_;
1638 PRE_READ(bootstr, __sanitizer::internal_strlen(bootstr) + 1);
1641 POST_SYSCALL(reboot)(long long res, long long opt_, void *bootstr_) {
1642 /* This call should never return */
1643 const char *bootstr = (const char *)bootstr_;
1645 POST_READ(bootstr, __sanitizer::internal_strlen(bootstr) + 1);
1648 PRE_SYSCALL(poll)(void *fds_, long long nfds_, long long timeout_) {
1652 (long long res, void *fds_, long long nfds_, long long timeout_) {
1656 (long long id_, long long a1_, long long a2_, long long a3_, long long a4_,
1657 long long a5_, long long a6_) {
1660 POST_SYSCALL(afssys)
1661 (long long res, long long id_, long long a1_, long long a2_, long long a3_,
1662 long long a4_, long long a5_, long long a6_) {
1665 /* syscall 211 has been skipped */
1666 /* syscall 212 has been skipped */
1667 /* syscall 213 has been skipped */
1668 /* syscall 214 has been skipped */
1669 /* syscall 215 has been skipped */
1670 /* syscall 216 has been skipped */
1671 /* syscall 217 has been skipped */
1672 /* syscall 218 has been skipped */
1673 /* syscall 219 has been skipped */
1674 PRE_SYSCALL(compat_14___semctl)
1675 (long long semid_, long long semnum_, long long cmd_, void *arg_) {
1678 POST_SYSCALL(compat_14___semctl)
1679 (long long res, long long semid_, long long semnum_, long long cmd_,
1683 PRE_SYSCALL(semget)(long long key_, long long nsems_, long long semflg_) {
1686 POST_SYSCALL(semget)
1687 (long long res, long long key_, long long nsems_, long long semflg_) {
1690 PRE_SYSCALL(semop)(long long semid_, void *sops_, long long nsops_) {
1692 PRE_READ(sops_, nsops_ * struct_sembuf_sz);
1696 (long long res, long long semid_, void *sops_, long long nsops_) {
1699 POST_READ(sops_, nsops_ * struct_sembuf_sz);
1703 PRE_SYSCALL(semconfig)(long long flag_) { /* Nothing to do */ }
1704 POST_SYSCALL(semconfig)(long long res, long long flag_) { /* Nothing to do */ }
1705 PRE_SYSCALL(compat_14_msgctl)(long long msqid_, long long cmd_, void *buf_) {
1708 POST_SYSCALL(compat_14_msgctl)
1709 (long long res, long long msqid_, long long cmd_, void *buf_) {
1712 PRE_SYSCALL(msgget)(long long key_, long long msgflg_) { /* Nothing to do */ }
1713 POST_SYSCALL(msgget)(long long res, long long key_, long long msgflg_) {
1717 (long long msqid_, void *msgp_, long long msgsz_, long long msgflg_) {
1719 PRE_READ(msgp_, msgsz_);
1722 POST_SYSCALL(msgsnd)
1723 (long long res, long long msqid_, void *msgp_, long long msgsz_,
1724 long long msgflg_) {
1727 POST_READ(msgp_, msgsz_);
1732 (long long msqid_, void *msgp_, long long msgsz_, long long msgtyp_,
1733 long long msgflg_) {
1736 POST_SYSCALL(msgrcv)
1737 (long long res, long long msqid_, void *msgp_, long long msgsz_,
1738 long long msgtyp_, long long msgflg_) {
1741 PRE_SYSCALL(shmat)(long long shmid_, void *shmaddr_, long long shmflg_) {
1745 (long long res, long long shmid_, void *shmaddr_, long long shmflg_) {
1748 PRE_SYSCALL(compat_14_shmctl)(long long shmid_, long long cmd_, void *buf_) {
1751 POST_SYSCALL(compat_14_shmctl)
1752 (long long res, long long shmid_, long long cmd_, void *buf_) {
1755 PRE_SYSCALL(shmdt)(void *shmaddr_) { /* Nothing to do */ }
1756 POST_SYSCALL(shmdt)(long long res, void *shmaddr_) { /* Nothing to do */ }
1757 PRE_SYSCALL(shmget)(long long key_, long long size_, long long shmflg_) {
1760 POST_SYSCALL(shmget)
1761 (long long res, long long key_, long long size_, long long shmflg_) {
1764 PRE_SYSCALL(compat_50_clock_gettime)(long long clock_id_, void *tp_) {
1767 POST_SYSCALL(compat_50_clock_gettime)
1768 (long long res, long long clock_id_, void *tp_) {
1771 PRE_SYSCALL(compat_50_clock_settime)(long long clock_id_, void *tp_) {
1774 POST_SYSCALL(compat_50_clock_settime)
1775 (long long res, long long clock_id_, void *tp_) {
1778 PRE_SYSCALL(compat_50_clock_getres)(long long clock_id_, void *tp_) {
1781 POST_SYSCALL(compat_50_clock_getres)
1782 (long long res, long long clock_id_, void *tp_) {
1785 PRE_SYSCALL(timer_create)(long long clock_id_, void *evp_, void *timerid_) {
1788 POST_SYSCALL(timer_create)
1789 (long long res, long long clock_id_, void *evp_, void *timerid_) {
1792 PRE_SYSCALL(timer_delete)(long long timerid_) { /* Nothing to do */ }
1793 POST_SYSCALL(timer_delete)(long long res, long long timerid_) {
1796 PRE_SYSCALL(compat_50_timer_settime)
1797 (long long timerid_, long long flags_, void *value_, void *ovalue_) {
1800 POST_SYSCALL(compat_50_timer_settime)
1801 (long long res, long long timerid_, long long flags_, void *value_,
1805 PRE_SYSCALL(compat_50_timer_gettime)(long long timerid_, void *value_) {
1808 POST_SYSCALL(compat_50_timer_gettime)
1809 (long long res, long long timerid_, void *value_) {
1812 PRE_SYSCALL(timer_getoverrun)(long long timerid_) { /* Nothing to do */ }
1813 POST_SYSCALL(timer_getoverrun)(long long res, long long timerid_) {
1816 PRE_SYSCALL(compat_50_nanosleep)(void *rqtp_, void *rmtp_) { /* TODO */ }
1817 POST_SYSCALL(compat_50_nanosleep)(long long res, void *rqtp_, void *rmtp_) {
1820 PRE_SYSCALL(fdatasync)(long long fd_) { /* Nothing to do */ }
1821 POST_SYSCALL(fdatasync)(long long res, long long fd_) { /* Nothing to do */ }
1822 PRE_SYSCALL(mlockall)(long long flags_) { /* Nothing to do */ }
1823 POST_SYSCALL(mlockall)(long long res, long long flags_) { /* Nothing to do */ }
1824 PRE_SYSCALL(munlockall)(void) { /* Nothing to do */ }
1825 POST_SYSCALL(munlockall)(long long res) { /* Nothing to do */ }
1826 PRE_SYSCALL(compat_50___sigtimedwait)(void *set_, void *info_, void *timeout_) {
1829 POST_SYSCALL(compat_50___sigtimedwait)
1830 (long long res, void *set_, void *info_, void *timeout_) {
1833 PRE_SYSCALL(sigqueueinfo)(long long pid_, void *info_) {
1835 PRE_READ(info_, siginfo_t_sz);
1838 POST_SYSCALL(sigqueueinfo)(long long res, long long pid_, void *info_) {}
1839 PRE_SYSCALL(modctl)(long long cmd_, void *arg_) { /* TODO */ }
1840 POST_SYSCALL(modctl)(long long res, long long cmd_, void *arg_) { /* TODO */ }
1841 PRE_SYSCALL(_ksem_init)(long long value_, void *idp_) { /* Nothing to do */ }
1842 POST_SYSCALL(_ksem_init)(long long res, long long value_, void *idp_) {
1845 PRE_SYSCALL(_ksem_open)
1846 (void *name_, long long oflag_, long long mode_, long long value_, void *idp_) {
1847 const char *name = (const char *)name_;
1849 PRE_READ(name, __sanitizer::internal_strlen(name) + 1);
1852 POST_SYSCALL(_ksem_open)
1853 (long long res, void *name_, long long oflag_, long long mode_,
1854 long long value_, void *idp_) {
1855 const char *name = (const char *)name_;
1857 POST_READ(name, __sanitizer::internal_strlen(name) + 1);
1860 PRE_SYSCALL(_ksem_unlink)(void *name_) {
1861 const char *name = (const char *)name_;
1863 PRE_READ(name, __sanitizer::internal_strlen(name) + 1);
1866 POST_SYSCALL(_ksem_unlink)(long long res, void *name_) {
1867 const char *name = (const char *)name_;
1869 POST_READ(name, __sanitizer::internal_strlen(name) + 1);
1872 PRE_SYSCALL(_ksem_close)(long long id_) { /* Nothing to do */ }
1873 POST_SYSCALL(_ksem_close)(long long res, long long id_) { /* Nothing to do */ }
1874 PRE_SYSCALL(_ksem_post)(long long id_) { /* Nothing to do */ }
1875 POST_SYSCALL(_ksem_post)(long long res, long long id_) { /* Nothing to do */ }
1876 PRE_SYSCALL(_ksem_wait)(long long id_) { /* Nothing to do */ }
1877 POST_SYSCALL(_ksem_wait)(long long res, long long id_) { /* Nothing to do */ }
1878 PRE_SYSCALL(_ksem_trywait)(long long id_) { /* Nothing to do */ }
1879 POST_SYSCALL(_ksem_trywait)(long long res, long long id_) {
1882 PRE_SYSCALL(_ksem_getvalue)(long long id_, void *value_) { /* Nothing to do */ }
1883 POST_SYSCALL(_ksem_getvalue)(long long res, long long id_, void *value_) {
1886 PRE_SYSCALL(_ksem_destroy)(long long id_) { /* Nothing to do */ }
1887 POST_SYSCALL(_ksem_destroy)(long long res, long long id_) {
1890 PRE_SYSCALL(_ksem_timedwait)(long long id_, void *abstime_) {
1892 PRE_READ(abstime_, struct_timespec_sz);
1895 POST_SYSCALL(_ksem_timedwait)(long long res, long long id_, void *abstime_) {}
1896 PRE_SYSCALL(mq_open)
1897 (void *name_, long long oflag_, long long mode_, void *attr_) {
1898 const char *name = (const char *)name_;
1900 PRE_READ(name, __sanitizer::internal_strlen(name) + 1);
1903 POST_SYSCALL(mq_open)
1904 (long long res, void *name_, long long oflag_, long long mode_, void *attr_) {
1905 const char *name = (const char *)name_;
1907 POST_READ(name, __sanitizer::internal_strlen(name) + 1);
1910 PRE_SYSCALL(mq_close)(long long mqdes_) { /* Nothing to do */ }
1911 POST_SYSCALL(mq_close)(long long res, long long mqdes_) { /* Nothing to do */ }
1912 PRE_SYSCALL(mq_unlink)(void *name_) {
1913 const char *name = (const char *)name_;
1915 PRE_READ(name, __sanitizer::internal_strlen(name) + 1);
1918 POST_SYSCALL(mq_unlink)(long long res, void *name_) {
1919 const char *name = (const char *)name_;
1921 POST_READ(name, __sanitizer::internal_strlen(name) + 1);
1924 PRE_SYSCALL(mq_getattr)(long long mqdes_, void *mqstat_) { /* Nothing to do */ }
1925 POST_SYSCALL(mq_getattr)(long long res, long long mqdes_, void *mqstat_) {
1928 PRE_SYSCALL(mq_setattr)(long long mqdes_, void *mqstat_, void *omqstat_) {
1930 PRE_READ(mqstat_, struct_mq_attr_sz);
1933 POST_SYSCALL(mq_setattr)
1934 (long long res, long long mqdes_, void *mqstat_, void *omqstat_) {}
1935 PRE_SYSCALL(mq_notify)(long long mqdes_, void *notification_) {
1936 if (notification_) {
1937 PRE_READ(notification_, struct_sigevent_sz);
1940 POST_SYSCALL(mq_notify)(long long res, long long mqdes_, void *notification_) {}
1941 PRE_SYSCALL(mq_send)
1942 (long long mqdes_, void *msg_ptr_, long long msg_len_, long long msg_prio_) {
1944 PRE_READ(msg_ptr_, msg_len_);
1947 POST_SYSCALL(mq_send)
1948 (long long res, long long mqdes_, void *msg_ptr_, long long msg_len_,
1949 long long msg_prio_) {}
1950 PRE_SYSCALL(mq_receive)
1951 (long long mqdes_, void *msg_ptr_, long long msg_len_, void *msg_prio_) {
1954 POST_SYSCALL(mq_receive)
1955 (long long res, long long mqdes_, void *msg_ptr_, long long msg_len_,
1959 PRE_SYSCALL(compat_50_mq_timedsend)
1960 (long long mqdes_, void *msg_ptr_, long long msg_len_, long long msg_prio_,
1961 void *abs_timeout_) {
1964 POST_SYSCALL(compat_50_mq_timedsend)
1965 (long long res, long long mqdes_, void *msg_ptr_, long long msg_len_,
1966 long long msg_prio_, void *abs_timeout_) {
1969 PRE_SYSCALL(compat_50_mq_timedreceive)
1970 (long long mqdes_, void *msg_ptr_, long long msg_len_, void *msg_prio_,
1971 void *abs_timeout_) {
1974 POST_SYSCALL(compat_50_mq_timedreceive)
1975 (long long res, long long mqdes_, void *msg_ptr_, long long msg_len_,
1976 void *msg_prio_, void *abs_timeout_) {
1979 /* syscall 267 has been skipped */
1980 /* syscall 268 has been skipped */
1981 /* syscall 269 has been skipped */
1982 PRE_SYSCALL(__posix_rename)(void *from_, void *to_) {
1983 const char *from = (const char *)from_;
1984 const char *to = (const char *)to_;
1986 PRE_READ(from, __sanitizer::internal_strlen(from) + 1);
1989 PRE_READ(to, __sanitizer::internal_strlen(to) + 1);
1992 POST_SYSCALL(__posix_rename)(long long res, void *from_, void *to_) {
1993 const char *from = (const char *)from_;
1994 const char *to = (const char *)to_;
1996 POST_READ(from, __sanitizer::internal_strlen(from) + 1);
1999 POST_READ(to, __sanitizer::internal_strlen(to) + 1);
2002 PRE_SYSCALL(swapctl)(long long cmd_, void *arg_, long long misc_) { /* TODO */ }
2003 POST_SYSCALL(swapctl)
2004 (long long res, long long cmd_, void *arg_, long long misc_) {
2007 PRE_SYSCALL(compat_30_getdents)(long long fd_, void *buf_, long long count_) {
2010 POST_SYSCALL(compat_30_getdents)
2011 (long long res, long long fd_, void *buf_, long long count_) {
2014 PRE_SYSCALL(minherit)(void *addr_, long long len_, long long inherit_) {
2017 POST_SYSCALL(minherit)
2018 (long long res, void *addr_, long long len_, long long inherit_) {
2021 PRE_SYSCALL(lchmod)(void *path_, long long mode_) {
2022 const char *path = (const char *)path_;
2024 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2027 POST_SYSCALL(lchmod)(long long res, void *path_, long long mode_) {
2028 const char *path = (const char *)path_;
2030 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2033 PRE_SYSCALL(lchown)(void *path_, long long uid_, long long gid_) {
2034 const char *path = (const char *)path_;
2036 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2039 POST_SYSCALL(lchown)
2040 (long long res, void *path_, long long uid_, long long gid_) {
2041 const char *path = (const char *)path_;
2043 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2046 PRE_SYSCALL(compat_50_lutimes)(void *path_, void *tptr_) { /* TODO */ }
2047 POST_SYSCALL(compat_50_lutimes)(long long res, void *path_, void *tptr_) {
2050 PRE_SYSCALL(__msync13)(void *addr_, long long len_, long long flags_) {
2053 POST_SYSCALL(__msync13)
2054 (long long res, void *addr_, long long len_, long long flags_) {
2057 PRE_SYSCALL(compat_30___stat13)(void *path_, void *ub_) { /* TODO */ }
2058 POST_SYSCALL(compat_30___stat13)(long long res, void *path_, void *ub_) {
2061 PRE_SYSCALL(compat_30___fstat13)(long long fd_, void *sb_) { /* TODO */ }
2062 POST_SYSCALL(compat_30___fstat13)(long long res, long long fd_, void *sb_) {
2065 PRE_SYSCALL(compat_30___lstat13)(void *path_, void *ub_) { /* TODO */ }
2066 POST_SYSCALL(compat_30___lstat13)(long long res, void *path_, void *ub_) {
2069 PRE_SYSCALL(__sigaltstack14)(void *nss_, void *oss_) {
2071 PRE_READ(nss_, struct_sigaltstack_sz);
2074 PRE_READ(oss_, struct_sigaltstack_sz);
2077 POST_SYSCALL(__sigaltstack14)(long long res, void *nss_, void *oss_) {}
2078 PRE_SYSCALL(__vfork14)(void) { /* Nothing to do */ }
2079 POST_SYSCALL(__vfork14)(long long res) { /* Nothing to do */ }
2080 PRE_SYSCALL(__posix_chown)(void *path_, long long uid_, long long gid_) {
2081 const char *path = (const char *)path_;
2083 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2086 POST_SYSCALL(__posix_chown)
2087 (long long res, void *path_, long long uid_, long long gid_) {
2088 const char *path = (const char *)path_;
2090 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2093 PRE_SYSCALL(__posix_fchown)(long long fd_, long long uid_, long long gid_) {
2096 POST_SYSCALL(__posix_fchown)
2097 (long long res, long long fd_, long long uid_, long long gid_) {
2100 PRE_SYSCALL(__posix_lchown)(void *path_, long long uid_, long long gid_) {
2101 const char *path = (const char *)path_;
2103 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2106 POST_SYSCALL(__posix_lchown)
2107 (long long res, void *path_, long long uid_, long long gid_) {
2108 const char *path = (const char *)path_;
2110 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2113 PRE_SYSCALL(getsid)(long long pid_) { /* Nothing to do */ }
2114 POST_SYSCALL(getsid)(long long res, long long pid_) { /* Nothing to do */ }
2115 PRE_SYSCALL(__clone)(long long flags_, void *stack_) { /* Nothing to do */ }
2116 POST_SYSCALL(__clone)(long long res, long long flags_, void *stack_) {
2119 PRE_SYSCALL(fktrace)
2120 (long long fd_, long long ops_, long long facs_, long long pid_) {
2123 POST_SYSCALL(fktrace)
2124 (long long res, long long fd_, long long ops_, long long facs_,
2129 (long long fd_, void *iovp_, long long iovcnt_, long long PAD_,
2130 long long offset_) {
2133 POST_SYSCALL(preadv)
2134 (long long res, long long fd_, void *iovp_, long long iovcnt_, long long PAD_,
2135 long long offset_) {
2138 PRE_SYSCALL(pwritev)
2139 (long long fd_, void *iovp_, long long iovcnt_, long long PAD_,
2140 long long offset_) {
2143 POST_SYSCALL(pwritev)
2144 (long long res, long long fd_, void *iovp_, long long iovcnt_, long long PAD_,
2145 long long offset_) {
2148 PRE_SYSCALL(compat_16___sigaction14)
2149 (long long signum_, void *nsa_, void *osa_) {
2152 POST_SYSCALL(compat_16___sigaction14)
2153 (long long res, long long signum_, void *nsa_, void *osa_) {
2156 PRE_SYSCALL(__sigpending14)(void *set_) { /* Nothing to do */ }
2157 POST_SYSCALL(__sigpending14)(long long res, void *set_) { /* Nothing to do */ }
2158 PRE_SYSCALL(__sigprocmask14)(long long how_, void *set_, void *oset_) {
2161 POST_SYSCALL(__sigprocmask14)
2162 (long long res, long long how_, void *set_, void *oset_) {
2165 PRE_SYSCALL(__sigsuspend14)(void *set_) {
2167 PRE_READ(set_, sizeof(__sanitizer_sigset_t));
2170 POST_SYSCALL(__sigsuspend14)(long long res, void *set_) {
2172 PRE_READ(set_, sizeof(__sanitizer_sigset_t));
2175 PRE_SYSCALL(compat_16___sigreturn14)(void *sigcntxp_) { /* TODO */ }
2176 POST_SYSCALL(compat_16___sigreturn14)(long long res, void *sigcntxp_) {
2179 PRE_SYSCALL(__getcwd)(void *bufp_, long long length_) { /* Nothing to do */ }
2180 POST_SYSCALL(__getcwd)(long long res, void *bufp_, long long length_) {
2183 PRE_SYSCALL(fchroot)(long long fd_) { /* Nothing to do */ }
2184 POST_SYSCALL(fchroot)(long long res, long long fd_) { /* Nothing to do */ }
2185 PRE_SYSCALL(compat_30_fhopen)(void *fhp_, long long flags_) { /* TODO */ }
2186 POST_SYSCALL(compat_30_fhopen)(long long res, void *fhp_, long long flags_) {
2189 PRE_SYSCALL(compat_30_fhstat)(void *fhp_, void *sb_) { /* TODO */ }
2190 POST_SYSCALL(compat_30_fhstat)(long long res, void *fhp_, void *sb_) {
2193 PRE_SYSCALL(compat_20_fhstatfs)(void *fhp_, void *buf_) { /* TODO */ }
2194 POST_SYSCALL(compat_20_fhstatfs)(long long res, void *fhp_, void *buf_) {
2197 PRE_SYSCALL(compat_50_____semctl13)
2198 (long long semid_, long long semnum_, long long cmd_, void *arg_) {
2201 POST_SYSCALL(compat_50_____semctl13)
2202 (long long res, long long semid_, long long semnum_, long long cmd_,
2206 PRE_SYSCALL(compat_50___msgctl13)
2207 (long long msqid_, long long cmd_, void *buf_) {
2210 POST_SYSCALL(compat_50___msgctl13)
2211 (long long res, long long msqid_, long long cmd_, void *buf_) {
2214 PRE_SYSCALL(compat_50___shmctl13)
2215 (long long shmid_, long long cmd_, void *buf_) {
2218 POST_SYSCALL(compat_50___shmctl13)
2219 (long long res, long long shmid_, long long cmd_, void *buf_) {
2222 PRE_SYSCALL(lchflags)(void *path_, long long flags_) {
2223 const char *path = (const char *)path_;
2225 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2228 POST_SYSCALL(lchflags)(long long res, void *path_, long long flags_) {
2229 const char *path = (const char *)path_;
2231 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2234 PRE_SYSCALL(issetugid)(void) { /* Nothing to do */ }
2235 POST_SYSCALL(issetugid)(long long res) { /* Nothing to do */ }
2236 PRE_SYSCALL(utrace)(void *label_, void *addr_, long long len_) {
2237 const char *label = (const char *)label_;
2239 PRE_READ(label, __sanitizer::internal_strlen(label) + 1);
2242 PRE_READ(addr_, len_);
2245 POST_SYSCALL(utrace)(long long res, void *label_, void *addr_, long long len_) {
2246 const char *label = (const char *)label_;
2248 POST_READ(label, __sanitizer::internal_strlen(label) + 1);
2251 POST_READ(addr_, len_);
2254 PRE_SYSCALL(getcontext)(void *ucp_) { /* Nothing to do */ }
2255 POST_SYSCALL(getcontext)(long long res, void *ucp_) { /* Nothing to do */ }
2256 PRE_SYSCALL(setcontext)(void *ucp_) {
2258 PRE_READ(ucp_, ucontext_t_sz(ucp_));
2261 POST_SYSCALL(setcontext)(long long res, void *ucp_) {}
2262 PRE_SYSCALL(_lwp_create)(void *ucp_, long long flags_, void *new_lwp_) {
2264 PRE_READ(ucp_, ucontext_t_sz(ucp_));
2267 POST_SYSCALL(_lwp_create)
2268 (long long res, void *ucp_, long long flags_, void *new_lwp_) {}
2269 PRE_SYSCALL(_lwp_exit)(void) { /* Nothing to do */ }
2270 POST_SYSCALL(_lwp_exit)(long long res) { /* Nothing to do */ }
2271 PRE_SYSCALL(_lwp_self)(void) { /* Nothing to do */ }
2272 POST_SYSCALL(_lwp_self)(long long res) { /* Nothing to do */ }
2273 PRE_SYSCALL(_lwp_wait)(long long wait_for_, void *departed_) {
2276 POST_SYSCALL(_lwp_wait)(long long res, long long wait_for_, void *departed_) {
2279 PRE_SYSCALL(_lwp_suspend)(long long target_) { /* Nothing to do */ }
2280 POST_SYSCALL(_lwp_suspend)(long long res, long long target_) {
2283 PRE_SYSCALL(_lwp_continue)(long long target_) { /* Nothing to do */ }
2284 POST_SYSCALL(_lwp_continue)(long long res, long long target_) {
2287 PRE_SYSCALL(_lwp_wakeup)(long long target_) { /* Nothing to do */ }
2288 POST_SYSCALL(_lwp_wakeup)(long long res, long long target_) {
2291 PRE_SYSCALL(_lwp_getprivate)(void) { /* Nothing to do */ }
2292 POST_SYSCALL(_lwp_getprivate)(long long res) { /* Nothing to do */ }
2293 PRE_SYSCALL(_lwp_setprivate)(void *ptr_) { /* Nothing to do */ }
2294 POST_SYSCALL(_lwp_setprivate)(long long res, void *ptr_) { /* Nothing to do */ }
2295 PRE_SYSCALL(_lwp_kill)(long long target_, long long signo_) {
2298 POST_SYSCALL(_lwp_kill)(long long res, long long target_, long long signo_) {
2301 PRE_SYSCALL(_lwp_detach)(long long target_) { /* Nothing to do */ }
2302 POST_SYSCALL(_lwp_detach)(long long res, long long target_) {
2305 PRE_SYSCALL(compat_50__lwp_park)
2306 (void *ts_, long long unpark_, void *hint_, void *unparkhint_) {
2309 POST_SYSCALL(compat_50__lwp_park)
2310 (long long res, void *ts_, long long unpark_, void *hint_, void *unparkhint_) {
2313 PRE_SYSCALL(_lwp_unpark)(long long target_, void *hint_) { /* Nothing to do */ }
2314 POST_SYSCALL(_lwp_unpark)(long long res, long long target_, void *hint_) {
2317 PRE_SYSCALL(_lwp_unpark_all)(void *targets_, long long ntargets_, void *hint_) {
2319 PRE_READ(targets_, ntargets_ * sizeof(__sanitizer_lwpid_t));
2322 POST_SYSCALL(_lwp_unpark_all)
2323 (long long res, void *targets_, long long ntargets_, void *hint_) {}
2324 PRE_SYSCALL(_lwp_setname)(long long target_, void *name_) {
2325 const char *name = (const char *)name_;
2327 PRE_READ(name, __sanitizer::internal_strlen(name) + 1);
2330 POST_SYSCALL(_lwp_setname)(long long res, long long target_, void *name_) {
2331 const char *name = (const char *)name_;
2333 POST_READ(name, __sanitizer::internal_strlen(name) + 1);
2336 PRE_SYSCALL(_lwp_getname)(long long target_, void *name_, long long len_) {
2339 POST_SYSCALL(_lwp_getname)
2340 (long long res, long long target_, void *name_, long long len_) {
2343 PRE_SYSCALL(_lwp_ctl)(long long features_, void **address_) {
2346 POST_SYSCALL(_lwp_ctl)(long long res, long long features_, void **address_) {
2349 /* syscall 326 has been skipped */
2350 /* syscall 327 has been skipped */
2351 /* syscall 328 has been skipped */
2352 /* syscall 329 has been skipped */
2353 PRE_SYSCALL(compat_60_sa_register)
2354 (void *newv_, void **oldv_, long long flags_, long long stackinfo_offset_) {
2357 POST_SYSCALL(compat_60_sa_register)
2358 (long long res, void *newv_, void **oldv_, long long flags_,
2359 long long stackinfo_offset_) {
2362 PRE_SYSCALL(compat_60_sa_stacks)(long long num_, void *stacks_) { /* TODO */ }
2363 POST_SYSCALL(compat_60_sa_stacks)
2364 (long long res, long long num_, void *stacks_) {
2367 PRE_SYSCALL(compat_60_sa_enable)(void) { /* TODO */ }
2368 POST_SYSCALL(compat_60_sa_enable)(long long res) { /* TODO */ }
2369 PRE_SYSCALL(compat_60_sa_setconcurrency)(long long concurrency_) { /* TODO */ }
2370 POST_SYSCALL(compat_60_sa_setconcurrency)
2371 (long long res, long long concurrency_) {
2374 PRE_SYSCALL(compat_60_sa_yield)(void) { /* TODO */ }
2375 POST_SYSCALL(compat_60_sa_yield)(long long res) { /* TODO */ }
2376 PRE_SYSCALL(compat_60_sa_preempt)(long long sa_id_) { /* TODO */ }
2377 POST_SYSCALL(compat_60_sa_preempt)(long long res, long long sa_id_) {
2380 /* syscall 336 has been skipped */
2381 /* syscall 337 has been skipped */
2382 /* syscall 338 has been skipped */
2383 /* syscall 339 has been skipped */
2384 PRE_SYSCALL(__sigaction_sigtramp)
2385 (long long signum_, void *nsa_, void *osa_, void *tramp_, long long vers_) {
2387 PRE_READ(nsa_, sizeof(__sanitizer_sigaction));
2390 POST_SYSCALL(__sigaction_sigtramp)
2391 (long long res, long long signum_, void *nsa_, void *osa_, void *tramp_,
2394 PRE_READ(nsa_, sizeof(__sanitizer_sigaction));
2397 /* syscall 341 has been skipped */
2398 /* syscall 342 has been skipped */
2399 PRE_SYSCALL(rasctl)(void *addr_, long long len_, long long op_) {
2402 POST_SYSCALL(rasctl)
2403 (long long res, void *addr_, long long len_, long long op_) {
2406 PRE_SYSCALL(kqueue)(void) { /* Nothing to do */ }
2407 POST_SYSCALL(kqueue)(long long res) { /* Nothing to do */ }
2408 PRE_SYSCALL(compat_50_kevent)
2409 (long long fd_, void *changelist_, long long nchanges_, void *eventlist_,
2410 long long nevents_, void *timeout_) {
2413 POST_SYSCALL(compat_50_kevent)
2414 (long long res, long long fd_, void *changelist_, long long nchanges_,
2415 void *eventlist_, long long nevents_, void *timeout_) {
2418 PRE_SYSCALL(_sched_setparam)
2419 (long long pid_, long long lid_, long long policy_, void *params_) {
2421 PRE_READ(params_, struct_sched_param_sz);
2424 POST_SYSCALL(_sched_setparam)
2425 (long long res, long long pid_, long long lid_, long long policy_,
2428 PRE_READ(params_, struct_sched_param_sz);
2431 PRE_SYSCALL(_sched_getparam)
2432 (long long pid_, long long lid_, void *policy_, void *params_) {
2435 POST_SYSCALL(_sched_getparam)
2436 (long long res, long long pid_, long long lid_, void *policy_, void *params_) {
2439 PRE_SYSCALL(_sched_setaffinity)
2440 (long long pid_, long long lid_, long long size_, void *cpuset_) {
2442 PRE_READ(cpuset_, size_);
2445 POST_SYSCALL(_sched_setaffinity)
2446 (long long res, long long pid_, long long lid_, long long size_,
2449 PRE_READ(cpuset_, size_);
2452 PRE_SYSCALL(_sched_getaffinity)
2453 (long long pid_, long long lid_, long long size_, void *cpuset_) {
2456 POST_SYSCALL(_sched_getaffinity)
2457 (long long res, long long pid_, long long lid_, long long size_,
2461 PRE_SYSCALL(sched_yield)(void) { /* Nothing to do */ }
2462 POST_SYSCALL(sched_yield)(long long res) { /* Nothing to do */ }
2463 PRE_SYSCALL(_sched_protect)(long long priority_) { /* Nothing to do */ }
2464 POST_SYSCALL(_sched_protect)(long long res, long long priority_) {
2467 /* syscall 352 has been skipped */
2468 /* syscall 353 has been skipped */
2469 PRE_SYSCALL(fsync_range)
2470 (long long fd_, long long flags_, long long start_, long long length_) {
2473 POST_SYSCALL(fsync_range)
2474 (long long res, long long fd_, long long flags_, long long start_,
2475 long long length_) {
2478 PRE_SYSCALL(uuidgen)(void *store_, long long count_) { /* Nothing to do */ }
2479 POST_SYSCALL(uuidgen)(long long res, void *store_, long long count_) {
2482 PRE_SYSCALL(compat_90_getvfsstat)
2483 (void *buf_, long long bufsize_, long long flags_) {
2486 POST_SYSCALL(compat_90_getvfsstat)
2487 (long long res, void *buf_, long long bufsize_, long long flags_) {
2490 PRE_SYSCALL(compat_90_statvfs1)(void *path_, void *buf_, long long flags_) {
2491 const char *path = (const char *)path_;
2493 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2496 POST_SYSCALL(compat_90_statvfs1)
2497 (long long res, void *path_, void *buf_, long long flags_) {
2498 const char *path = (const char *)path_;
2500 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2503 PRE_SYSCALL(compat_90_fstatvfs1)(long long fd_, void *buf_, long long flags_) {
2506 POST_SYSCALL(compat_90_fstatvfs1)
2507 (long long res, long long fd_, void *buf_, long long flags_) {
2510 PRE_SYSCALL(compat_30_fhstatvfs1)(void *fhp_, void *buf_, long long flags_) {
2513 POST_SYSCALL(compat_30_fhstatvfs1)
2514 (long long res, void *fhp_, void *buf_, long long flags_) {
2517 PRE_SYSCALL(extattrctl)
2518 (void *path_, long long cmd_, void *filename_, long long attrnamespace_,
2520 const char *path = (const char *)path_;
2522 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2525 POST_SYSCALL(extattrctl)
2526 (long long res, void *path_, long long cmd_, void *filename_,
2527 long long attrnamespace_, void *attrname_) {
2528 const char *path = (const char *)path_;
2530 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2533 PRE_SYSCALL(extattr_set_file)
2534 (void *path_, long long attrnamespace_, void *attrname_, void *data_,
2535 long long nbytes_) {
2536 const char *path = (const char *)path_;
2538 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2541 POST_SYSCALL(extattr_set_file)
2542 (long long res, void *path_, long long attrnamespace_, void *attrname_,
2543 void *data_, long long nbytes_) {
2544 const char *path = (const char *)path_;
2546 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2549 PRE_SYSCALL(extattr_get_file)
2550 (void *path_, long long attrnamespace_, void *attrname_, void *data_,
2551 long long nbytes_) {
2552 const char *path = (const char *)path_;
2554 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2557 POST_SYSCALL(extattr_get_file)
2558 (long long res, void *path_, long long attrnamespace_, void *attrname_,
2559 void *data_, long long nbytes_) {
2560 const char *path = (const char *)path_;
2562 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2565 PRE_SYSCALL(extattr_delete_file)
2566 (void *path_, long long attrnamespace_, void *attrname_) {
2567 const char *path = (const char *)path_;
2569 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2572 POST_SYSCALL(extattr_delete_file)
2573 (long long res, void *path_, long long attrnamespace_, void *attrname_) {
2574 const char *path = (const char *)path_;
2576 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2579 PRE_SYSCALL(extattr_set_fd)
2580 (long long fd_, long long attrnamespace_, void *attrname_, void *data_,
2581 long long nbytes_) {
2584 POST_SYSCALL(extattr_set_fd)
2585 (long long res, long long fd_, long long attrnamespace_, void *attrname_,
2586 void *data_, long long nbytes_) {
2589 PRE_SYSCALL(extattr_get_fd)
2590 (long long fd_, long long attrnamespace_, void *attrname_, void *data_,
2591 long long nbytes_) {
2594 POST_SYSCALL(extattr_get_fd)
2595 (long long res, long long fd_, long long attrnamespace_, void *attrname_,
2596 void *data_, long long nbytes_) {
2599 PRE_SYSCALL(extattr_delete_fd)
2600 (long long fd_, long long attrnamespace_, void *attrname_) {
2603 POST_SYSCALL(extattr_delete_fd)
2604 (long long res, long long fd_, long long attrnamespace_, void *attrname_) {
2607 PRE_SYSCALL(extattr_set_link)
2608 (void *path_, long long attrnamespace_, void *attrname_, void *data_,
2609 long long nbytes_) {
2610 const char *path = (const char *)path_;
2612 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2615 POST_SYSCALL(extattr_set_link)
2616 (long long res, void *path_, long long attrnamespace_, void *attrname_,
2617 void *data_, long long nbytes_) {
2618 const char *path = (const char *)path_;
2620 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2623 PRE_SYSCALL(extattr_get_link)
2624 (void *path_, long long attrnamespace_, void *attrname_, void *data_,
2625 long long nbytes_) {
2626 const char *path = (const char *)path_;
2628 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2631 POST_SYSCALL(extattr_get_link)
2632 (long long res, void *path_, long long attrnamespace_, void *attrname_,
2633 void *data_, long long nbytes_) {
2634 const char *path = (const char *)path_;
2636 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2639 PRE_SYSCALL(extattr_delete_link)
2640 (void *path_, long long attrnamespace_, void *attrname_) {
2641 const char *path = (const char *)path_;
2643 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2646 POST_SYSCALL(extattr_delete_link)
2647 (long long res, void *path_, long long attrnamespace_, void *attrname_) {
2648 const char *path = (const char *)path_;
2650 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2653 PRE_SYSCALL(extattr_list_fd)
2654 (long long fd_, long long attrnamespace_, void *data_, long long nbytes_) {
2657 POST_SYSCALL(extattr_list_fd)
2658 (long long res, long long fd_, long long attrnamespace_, void *data_,
2659 long long nbytes_) {
2662 PRE_SYSCALL(extattr_list_file)
2663 (void *path_, long long attrnamespace_, void *data_, long long nbytes_) {
2664 const char *path = (const char *)path_;
2666 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2669 POST_SYSCALL(extattr_list_file)
2670 (long long res, void *path_, long long attrnamespace_, void *data_,
2671 long long nbytes_) {
2672 const char *path = (const char *)path_;
2674 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2677 PRE_SYSCALL(extattr_list_link)
2678 (void *path_, long long attrnamespace_, void *data_, long long nbytes_) {
2679 const char *path = (const char *)path_;
2681 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2684 POST_SYSCALL(extattr_list_link)
2685 (long long res, void *path_, long long attrnamespace_, void *data_,
2686 long long nbytes_) {
2687 const char *path = (const char *)path_;
2689 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2692 PRE_SYSCALL(compat_50_pselect)
2693 (long long nd_, void *in_, void *ou_, void *ex_, void *ts_, void *mask_) {
2696 POST_SYSCALL(compat_50_pselect)
2697 (long long res, long long nd_, void *in_, void *ou_, void *ex_, void *ts_,
2701 PRE_SYSCALL(compat_50_pollts)
2702 (void *fds_, long long nfds_, void *ts_, void *mask_) {
2705 POST_SYSCALL(compat_50_pollts)
2706 (long long res, void *fds_, long long nfds_, void *ts_, void *mask_) {
2709 PRE_SYSCALL(setxattr)
2710 (void *path_, void *name_, void *value_, long long size_, long long flags_) {
2711 const char *path = (const char *)path_;
2713 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2716 POST_SYSCALL(setxattr)
2717 (long long res, void *path_, void *name_, void *value_, long long size_,
2719 const char *path = (const char *)path_;
2721 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2724 PRE_SYSCALL(lsetxattr)
2725 (void *path_, void *name_, void *value_, long long size_, long long flags_) {
2726 const char *path = (const char *)path_;
2728 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2731 POST_SYSCALL(lsetxattr)
2732 (long long res, void *path_, void *name_, void *value_, long long size_,
2734 const char *path = (const char *)path_;
2736 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2739 PRE_SYSCALL(fsetxattr)
2740 (long long fd_, void *name_, void *value_, long long size_, long long flags_) {
2743 POST_SYSCALL(fsetxattr)
2744 (long long res, long long fd_, void *name_, void *value_, long long size_,
2748 PRE_SYSCALL(getxattr)(void *path_, void *name_, void *value_, long long size_) {
2749 const char *path = (const char *)path_;
2751 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2754 POST_SYSCALL(getxattr)
2755 (long long res, void *path_, void *name_, void *value_, long long size_) {
2756 const char *path = (const char *)path_;
2758 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2761 PRE_SYSCALL(lgetxattr)
2762 (void *path_, void *name_, void *value_, long long size_) {
2763 const char *path = (const char *)path_;
2765 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2768 POST_SYSCALL(lgetxattr)
2769 (long long res, void *path_, void *name_, void *value_, long long size_) {
2770 const char *path = (const char *)path_;
2772 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2775 PRE_SYSCALL(fgetxattr)
2776 (long long fd_, void *name_, void *value_, long long size_) {
2779 POST_SYSCALL(fgetxattr)
2780 (long long res, long long fd_, void *name_, void *value_, long long size_) {
2783 PRE_SYSCALL(listxattr)(void *path_, void *list_, long long size_) {
2784 const char *path = (const char *)path_;
2786 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2789 POST_SYSCALL(listxattr)
2790 (long long res, void *path_, void *list_, long long size_) {
2791 const char *path = (const char *)path_;
2793 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2796 PRE_SYSCALL(llistxattr)(void *path_, void *list_, long long size_) {
2797 const char *path = (const char *)path_;
2799 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2802 POST_SYSCALL(llistxattr)
2803 (long long res, void *path_, void *list_, long long size_) {
2804 const char *path = (const char *)path_;
2806 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2809 PRE_SYSCALL(flistxattr)(long long fd_, void *list_, long long size_) {
2812 POST_SYSCALL(flistxattr)
2813 (long long res, long long fd_, void *list_, long long size_) {
2816 PRE_SYSCALL(removexattr)(void *path_, void *name_) {
2817 const char *path = (const char *)path_;
2819 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2822 POST_SYSCALL(removexattr)(long long res, void *path_, void *name_) {
2823 const char *path = (const char *)path_;
2825 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2828 PRE_SYSCALL(lremovexattr)(void *path_, void *name_) {
2829 const char *path = (const char *)path_;
2831 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2834 POST_SYSCALL(lremovexattr)(long long res, void *path_, void *name_) {
2835 const char *path = (const char *)path_;
2837 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2840 PRE_SYSCALL(fremovexattr)(long long fd_, void *name_) { /* TODO */ }
2841 POST_SYSCALL(fremovexattr)(long long res, long long fd_, void *name_) {
2844 PRE_SYSCALL(compat_50___stat30)(void *path_, void *ub_) { /* TODO */ }
2845 POST_SYSCALL(compat_50___stat30)(long long res, void *path_, void *ub_) {
2848 PRE_SYSCALL(compat_50___fstat30)(long long fd_, void *sb_) { /* TODO */ }
2849 POST_SYSCALL(compat_50___fstat30)(long long res, long long fd_, void *sb_) {
2852 PRE_SYSCALL(compat_50___lstat30)(void *path_, void *ub_) { /* TODO */ }
2853 POST_SYSCALL(compat_50___lstat30)(long long res, void *path_, void *ub_) {
2856 PRE_SYSCALL(__getdents30)(long long fd_, void *buf_, long long count_) {
2859 POST_SYSCALL(__getdents30)
2860 (long long res, long long fd_, void *buf_, long long count_) {
2863 PRE_SYSCALL(posix_fadvise)(long long) { /* Nothing to do */ }
2864 POST_SYSCALL(posix_fadvise)(long long res, long long) { /* Nothing to do */ }
2865 PRE_SYSCALL(compat_30___fhstat30)(void *fhp_, void *sb_) { /* TODO */ }
2866 POST_SYSCALL(compat_30___fhstat30)(long long res, void *fhp_, void *sb_) {
2869 PRE_SYSCALL(compat_50___ntp_gettime30)(void *ntvp_) { /* TODO */ }
2870 POST_SYSCALL(compat_50___ntp_gettime30)(long long res, void *ntvp_) {
2873 PRE_SYSCALL(__socket30)
2874 (long long domain_, long long type_, long long protocol_) {
2877 POST_SYSCALL(__socket30)
2878 (long long res, long long domain_, long long type_, long long protocol_) {
2881 PRE_SYSCALL(__getfh30)(void *fname_, void *fhp_, void *fh_size_) {
2882 const char *fname = (const char *)fname_;
2884 PRE_READ(fname, __sanitizer::internal_strlen(fname) + 1);
2887 POST_SYSCALL(__getfh30)
2888 (long long res, void *fname_, void *fhp_, void *fh_size_) {
2889 const char *fname = (const char *)fname_;
2892 POST_READ(fname, __sanitizer::internal_strlen(fname) + 1);
2896 PRE_SYSCALL(__fhopen40)(void *fhp_, long long fh_size_, long long flags_) {
2898 PRE_READ(fhp_, fh_size_);
2901 POST_SYSCALL(__fhopen40)
2902 (long long res, void *fhp_, long long fh_size_, long long flags_) {}
2903 PRE_SYSCALL(compat_90_fhstatvfs1)
2904 (void *fhp_, long long fh_size_, void *buf_, long long flags_) {
2906 PRE_READ(fhp_, fh_size_);
2909 POST_SYSCALL(compat_90_fhstatvfs1)
2910 (long long res, void *fhp_, long long fh_size_, void *buf_, long long flags_) {}
2911 PRE_SYSCALL(compat_50___fhstat40)(void *fhp_, long long fh_size_, void *sb_) {
2913 PRE_READ(fhp_, fh_size_);
2916 POST_SYSCALL(compat_50___fhstat40)
2917 (long long res, void *fhp_, long long fh_size_, void *sb_) {}
2918 PRE_SYSCALL(aio_cancel)(long long fildes_, void *aiocbp_) {
2920 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb));
2923 POST_SYSCALL(aio_cancel)(long long res, long long fildes_, void *aiocbp_) {}
2924 PRE_SYSCALL(aio_error)(void *aiocbp_) {
2926 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb));
2929 POST_SYSCALL(aio_error)(long long res, void *aiocbp_) {}
2930 PRE_SYSCALL(aio_fsync)(long long op_, void *aiocbp_) {
2932 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb));
2935 POST_SYSCALL(aio_fsync)(long long res, long long op_, void *aiocbp_) {}
2936 PRE_SYSCALL(aio_read)(void *aiocbp_) {
2938 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb));
2941 POST_SYSCALL(aio_read)(long long res, void *aiocbp_) {}
2942 PRE_SYSCALL(aio_return)(void *aiocbp_) {
2944 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb));
2947 POST_SYSCALL(aio_return)(long long res, void *aiocbp_) {}
2948 PRE_SYSCALL(compat_50_aio_suspend)
2949 (void *list_, long long nent_, void *timeout_) {
2952 POST_SYSCALL(compat_50_aio_suspend)
2953 (long long res, void *list_, long long nent_, void *timeout_) {
2956 PRE_SYSCALL(aio_write)(void *aiocbp_) {
2958 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb));
2961 POST_SYSCALL(aio_write)(long long res, void *aiocbp_) {}
2962 PRE_SYSCALL(lio_listio)
2963 (long long mode_, void *list_, long long nent_, void *sig_) {
2966 POST_SYSCALL(lio_listio)
2967 (long long res, long long mode_, void *list_, long long nent_, void *sig_) {
2970 /* syscall 407 has been skipped */
2971 /* syscall 408 has been skipped */
2972 /* syscall 409 has been skipped */
2973 PRE_SYSCALL(__mount50)
2974 (void *type_, void *path_, long long flags_, void *data_, long long data_len_) {
2975 const char *type = (const char *)type_;
2976 const char *path = (const char *)path_;
2978 PRE_READ(type, __sanitizer::internal_strlen(type) + 1);
2981 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
2984 PRE_READ(data_, data_len_);
2987 POST_SYSCALL(__mount50)
2988 (long long res, void *type_, void *path_, long long flags_, void *data_,
2989 long long data_len_) {
2990 const char *type = (const char *)type_;
2991 const char *path = (const char *)path_;
2993 POST_READ(type, __sanitizer::internal_strlen(type) + 1);
2996 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
2999 POST_READ(data_, data_len_);
3003 (void *old_address_, long long old_size_, void *new_address_,
3004 long long new_size_, long long flags_) {
3007 POST_SYSCALL(mremap)
3008 (long long res, void *old_address_, long long old_size_, void *new_address_,
3009 long long new_size_, long long flags_) {
3012 PRE_SYSCALL(pset_create)(void *psid_) { /* Nothing to do */ }
3013 POST_SYSCALL(pset_create)(long long res, void *psid_) { /* Nothing to do */ }
3014 PRE_SYSCALL(pset_destroy)(long long psid_) { /* Nothing to do */ }
3015 POST_SYSCALL(pset_destroy)(long long res, long long psid_) {
3018 PRE_SYSCALL(pset_assign)(long long psid_, long long cpuid_, void *opsid_) {
3021 POST_SYSCALL(pset_assign)
3022 (long long res, long long psid_, long long cpuid_, void *opsid_) {
3025 PRE_SYSCALL(_pset_bind)
3026 (long long idtype_, long long first_id_, long long second_id_, long long psid_,
3030 POST_SYSCALL(_pset_bind)
3031 (long long res, long long idtype_, long long first_id_, long long second_id_,
3032 long long psid_, void *opsid_) {
3035 PRE_SYSCALL(__posix_fadvise50)
3036 (long long fd_, long long PAD_, long long offset_, long long len_,
3037 long long advice_) {
3040 POST_SYSCALL(__posix_fadvise50)
3041 (long long res, long long fd_, long long PAD_, long long offset_,
3042 long long len_, long long advice_) {
3045 PRE_SYSCALL(__select50)
3046 (long long nd_, void *in_, void *ou_, void *ex_, void *tv_) {
3049 POST_SYSCALL(__select50)
3050 (long long res, long long nd_, void *in_, void *ou_, void *ex_, void *tv_) {
3053 PRE_SYSCALL(__gettimeofday50)(void *tp_, void *tzp_) { /* Nothing to do */ }
3054 POST_SYSCALL(__gettimeofday50)(long long res, void *tp_, void *tzp_) {
3057 PRE_SYSCALL(__settimeofday50)(void *tv_, void *tzp_) {
3059 PRE_READ(tv_, timeval_sz);
3062 PRE_READ(tzp_, struct_timezone_sz);
3065 POST_SYSCALL(__settimeofday50)(long long res, void *tv_, void *tzp_) {}
3066 PRE_SYSCALL(__utimes50)(void *path_, void *tptr_) {
3067 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_;
3068 const char *path = (const char *)path_;
3070 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3073 PRE_READ(tptr[0], struct_timespec_sz);
3074 PRE_READ(tptr[1], struct_timespec_sz);
3077 POST_SYSCALL(__utimes50)(long long res, void *path_, void *tptr_) {}
3078 PRE_SYSCALL(__adjtime50)(void *delta_, void *olddelta_) {
3080 PRE_READ(delta_, timeval_sz);
3083 POST_SYSCALL(__adjtime50)(long long res, void *delta_, void *olddelta_) {}
3084 PRE_SYSCALL(__lfs_segwait50)(void *fsidp_, void *tv_) { /* TODO */ }
3085 POST_SYSCALL(__lfs_segwait50)(long long res, void *fsidp_, void *tv_) {
3088 PRE_SYSCALL(__futimes50)(long long fd_, void *tptr_) {
3089 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_;
3091 PRE_READ(tptr[0], struct_timespec_sz);
3092 PRE_READ(tptr[1], struct_timespec_sz);
3095 POST_SYSCALL(__futimes50)(long long res, long long fd_, void *tptr_) {}
3096 PRE_SYSCALL(__lutimes50)(void *path_, void *tptr_) {
3097 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_;
3098 const char *path = (const char *)path_;
3100 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3103 PRE_READ(tptr[0], struct_timespec_sz);
3104 PRE_READ(tptr[1], struct_timespec_sz);
3107 POST_SYSCALL(__lutimes50)(long long res, void *path_, void *tptr_) {
3108 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_;
3109 const char *path = (const char *)path_;
3111 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3114 POST_READ(tptr[0], struct_timespec_sz);
3115 POST_READ(tptr[1], struct_timespec_sz);
3118 PRE_SYSCALL(__setitimer50)(long long which_, void *itv_, void *oitv_) {
3119 struct __sanitizer_itimerval *itv = (struct __sanitizer_itimerval *)itv_;
3121 PRE_READ(&itv->it_interval.tv_sec, sizeof(__sanitizer_time_t));
3122 PRE_READ(&itv->it_interval.tv_usec, sizeof(__sanitizer_suseconds_t));
3123 PRE_READ(&itv->it_value.tv_sec, sizeof(__sanitizer_time_t));
3124 PRE_READ(&itv->it_value.tv_usec, sizeof(__sanitizer_suseconds_t));
3127 POST_SYSCALL(__setitimer50)
3128 (long long res, long long which_, void *itv_, void *oitv_) {}
3129 PRE_SYSCALL(__getitimer50)(long long which_, void *itv_) { /* Nothing to do */ }
3130 POST_SYSCALL(__getitimer50)(long long res, long long which_, void *itv_) {
3133 PRE_SYSCALL(__clock_gettime50)(long long clock_id_, void *tp_) {
3136 POST_SYSCALL(__clock_gettime50)(long long res, long long clock_id_, void *tp_) {
3139 PRE_SYSCALL(__clock_settime50)(long long clock_id_, void *tp_) {
3141 PRE_READ(tp_, struct_timespec_sz);
3144 POST_SYSCALL(__clock_settime50)
3145 (long long res, long long clock_id_, void *tp_) {}
3146 PRE_SYSCALL(__clock_getres50)(long long clock_id_, void *tp_) {
3149 POST_SYSCALL(__clock_getres50)(long long res, long long clock_id_, void *tp_) {
3152 PRE_SYSCALL(__nanosleep50)(void *rqtp_, void *rmtp_) {
3154 PRE_READ(rqtp_, struct_timespec_sz);
3157 POST_SYSCALL(__nanosleep50)(long long res, void *rqtp_, void *rmtp_) {}
3158 PRE_SYSCALL(____sigtimedwait50)(void *set_, void *info_, void *timeout_) {
3160 PRE_READ(set_, sizeof(__sanitizer_sigset_t));
3163 PRE_READ(timeout_, struct_timespec_sz);
3166 POST_SYSCALL(____sigtimedwait50)
3167 (long long res, void *set_, void *info_, void *timeout_) {}
3168 PRE_SYSCALL(__mq_timedsend50)
3169 (long long mqdes_, void *msg_ptr_, long long msg_len_, long long msg_prio_,
3170 void *abs_timeout_) {
3172 PRE_READ(msg_ptr_, msg_len_);
3175 PRE_READ(abs_timeout_, struct_timespec_sz);
3178 POST_SYSCALL(__mq_timedsend50)
3179 (long long res, long long mqdes_, void *msg_ptr_, long long msg_len_,
3180 long long msg_prio_, void *abs_timeout_) {}
3181 PRE_SYSCALL(__mq_timedreceive50)
3182 (long long mqdes_, void *msg_ptr_, long long msg_len_, void *msg_prio_,
3183 void *abs_timeout_) {
3185 PRE_READ(msg_ptr_, msg_len_);
3188 PRE_READ(abs_timeout_, struct_timespec_sz);
3191 POST_SYSCALL(__mq_timedreceive50)
3192 (long long res, long long mqdes_, void *msg_ptr_, long long msg_len_,
3193 void *msg_prio_, void *abs_timeout_) {}
3194 PRE_SYSCALL(compat_60__lwp_park)
3195 (void *ts_, long long unpark_, void *hint_, void *unparkhint_) {
3198 POST_SYSCALL(compat_60__lwp_park)
3199 (long long res, void *ts_, long long unpark_, void *hint_, void *unparkhint_) {
3202 PRE_SYSCALL(__kevent50)
3203 (long long fd_, void *changelist_, long long nchanges_, void *eventlist_,
3204 long long nevents_, void *timeout_) {
3206 PRE_READ(changelist_, nchanges_ * struct_kevent_sz);
3209 PRE_READ(timeout_, struct_timespec_sz);
3212 POST_SYSCALL(__kevent50)
3213 (long long res, long long fd_, void *changelist_, long long nchanges_,
3214 void *eventlist_, long long nevents_, void *timeout_) {}
3215 PRE_SYSCALL(__pselect50)
3216 (long long nd_, void *in_, void *ou_, void *ex_, void *ts_, void *mask_) {
3218 PRE_READ(ts_, struct_timespec_sz);
3221 PRE_READ(mask_, sizeof(struct __sanitizer_sigset_t));
3224 POST_SYSCALL(__pselect50)
3225 (long long res, long long nd_, void *in_, void *ou_, void *ex_, void *ts_,
3227 PRE_SYSCALL(__pollts50)(void *fds_, long long nfds_, void *ts_, void *mask_) {
3229 PRE_READ(ts_, struct_timespec_sz);
3232 PRE_READ(mask_, sizeof(struct __sanitizer_sigset_t));
3235 POST_SYSCALL(__pollts50)
3236 (long long res, void *fds_, long long nfds_, void *ts_, void *mask_) {}
3237 PRE_SYSCALL(__aio_suspend50)(void *list_, long long nent_, void *timeout_) {
3239 const struct aiocb *const *list = (const struct aiocb *const *)list_;
3241 for (i = 0; i < nent_; i++) {
3243 PRE_READ(list[i], sizeof(struct __sanitizer_aiocb));
3248 PRE_READ(timeout_, struct_timespec_sz);
3251 POST_SYSCALL(__aio_suspend50)
3252 (long long res, void *list_, long long nent_, void *timeout_) {}
3253 PRE_SYSCALL(__stat50)(void *path_, void *ub_) {
3254 const char *path = (const char *)path_;
3256 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3259 POST_SYSCALL(__stat50)(long long res, void *path_, void *ub_) {
3260 const char *path = (const char *)path_;
3263 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3267 PRE_SYSCALL(__fstat50)(long long fd_, void *sb_) { /* Nothing to do */ }
3268 POST_SYSCALL(__fstat50)(long long res, long long fd_, void *sb_) {
3271 PRE_SYSCALL(__lstat50)(void *path_, void *ub_) {
3272 const char *path = (const char *)path_;
3274 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3277 POST_SYSCALL(__lstat50)(long long res, void *path_, void *ub_) {
3278 const char *path = (const char *)path_;
3281 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3285 PRE_SYSCALL(____semctl50)
3286 (long long semid_, long long semnum_, long long cmd_, void *arg_) {
3289 POST_SYSCALL(____semctl50)
3290 (long long res, long long semid_, long long semnum_, long long cmd_,
3294 PRE_SYSCALL(__shmctl50)(long long shmid_, long long cmd_, void *buf_) {
3297 POST_SYSCALL(__shmctl50)
3298 (long long res, long long shmid_, long long cmd_, void *buf_) {
3301 PRE_SYSCALL(__msgctl50)(long long msqid_, long long cmd_, void *buf_) {
3304 POST_SYSCALL(__msgctl50)
3305 (long long res, long long msqid_, long long cmd_, void *buf_) {
3308 PRE_SYSCALL(__getrusage50)(long long who_, void *rusage_) {
3311 POST_SYSCALL(__getrusage50)(long long res, long long who_, void *rusage_) {
3314 PRE_SYSCALL(__timer_settime50)
3315 (long long timerid_, long long flags_, void *value_, void *ovalue_) {
3316 struct __sanitizer_itimerval *value = (struct __sanitizer_itimerval *)value_;
3318 PRE_READ(&value->it_interval.tv_sec, sizeof(__sanitizer_time_t));
3319 PRE_READ(&value->it_interval.tv_usec, sizeof(__sanitizer_suseconds_t));
3320 PRE_READ(&value->it_value.tv_sec, sizeof(__sanitizer_time_t));
3321 PRE_READ(&value->it_value.tv_usec, sizeof(__sanitizer_suseconds_t));
3324 POST_SYSCALL(__timer_settime50)
3325 (long long res, long long timerid_, long long flags_, void *value_,
3327 struct __sanitizer_itimerval *value = (struct __sanitizer_itimerval *)value_;
3330 POST_READ(&value->it_interval.tv_sec, sizeof(__sanitizer_time_t));
3331 POST_READ(&value->it_interval.tv_usec, sizeof(__sanitizer_suseconds_t));
3332 POST_READ(&value->it_value.tv_sec, sizeof(__sanitizer_time_t));
3333 POST_READ(&value->it_value.tv_usec, sizeof(__sanitizer_suseconds_t));
3337 PRE_SYSCALL(__timer_gettime50)(long long timerid_, void *value_) {
3340 POST_SYSCALL(__timer_gettime50)
3341 (long long res, long long timerid_, void *value_) {
3344 #if defined(NTP) || !defined(_KERNEL_OPT)
3345 PRE_SYSCALL(__ntp_gettime50)(void *ntvp_) { /* Nothing to do */ }
3346 POST_SYSCALL(__ntp_gettime50)(long long res, void *ntvp_) {
3350 /* syscall 448 has been skipped */
3352 PRE_SYSCALL(__wait450)
3353 (long long pid_, void *status_, long long options_, void *rusage_) {
3356 POST_SYSCALL(__wait450)
3357 (long long res, long long pid_, void *status_, long long options_,
3361 PRE_SYSCALL(__mknod50)(void *path_, long long mode_, long long dev_) {
3362 const char *path = (const char *)path_;
3364 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3367 POST_SYSCALL(__mknod50)
3368 (long long res, void *path_, long long mode_, long long dev_) {
3369 const char *path = (const char *)path_;
3372 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3376 PRE_SYSCALL(__fhstat50)(void *fhp_, long long fh_size_, void *sb_) {
3378 PRE_READ(fhp_, fh_size_);
3381 POST_SYSCALL(__fhstat50)
3382 (long long res, void *fhp_, long long fh_size_, void *sb_) {
3385 POST_READ(fhp_, fh_size_);
3389 /* syscall 452 has been skipped */
3390 PRE_SYSCALL(pipe2)(void *fildes_, long long flags_) { /* Nothing to do */ }
3391 POST_SYSCALL(pipe2)(long long res, void *fildes_, long long flags_) {
3394 PRE_SYSCALL(dup3)(long long from_, long long to_, long long flags_) {
3398 (long long res, long long from_, long long to_, long long flags_) {
3401 PRE_SYSCALL(kqueue1)(long long flags_) { /* Nothing to do */ }
3402 POST_SYSCALL(kqueue1)(long long res, long long flags_) { /* Nothing to do */ }
3403 PRE_SYSCALL(paccept)
3404 (long long s_, void *name_, void *anamelen_, void *mask_, long long flags_) {
3406 PRE_READ(mask_, sizeof(__sanitizer_sigset_t));
3409 POST_SYSCALL(paccept)
3410 (long long res, long long s_, void *name_, void *anamelen_, void *mask_,
3414 PRE_READ(mask_, sizeof(__sanitizer_sigset_t));
3419 (long long fd1_, void *name1_, long long fd2_, void *name2_, long long flags_) {
3420 const char *name1 = (const char *)name1_;
3421 const char *name2 = (const char *)name2_;
3423 PRE_READ(name1, __sanitizer::internal_strlen(name1) + 1);
3426 PRE_READ(name2, __sanitizer::internal_strlen(name2) + 1);
3429 POST_SYSCALL(linkat)
3430 (long long res, long long fd1_, void *name1_, long long fd2_, void *name2_,
3432 const char *name1 = (const char *)name1_;
3433 const char *name2 = (const char *)name2_;
3436 POST_READ(name1, __sanitizer::internal_strlen(name1) + 1);
3439 POST_READ(name2, __sanitizer::internal_strlen(name2) + 1);
3443 PRE_SYSCALL(renameat)
3444 (long long fromfd_, void *from_, long long tofd_, void *to_) {
3445 const char *from = (const char *)from_;
3446 const char *to = (const char *)to_;
3448 PRE_READ(from, __sanitizer::internal_strlen(from) + 1);
3451 PRE_READ(to, __sanitizer::internal_strlen(to) + 1);
3454 POST_SYSCALL(renameat)
3455 (long long res, long long fromfd_, void *from_, long long tofd_, void *to_) {
3456 const char *from = (const char *)from_;
3457 const char *to = (const char *)to_;
3460 POST_READ(from, __sanitizer::internal_strlen(from) + 1);
3463 POST_READ(to, __sanitizer::internal_strlen(to) + 1);
3467 PRE_SYSCALL(mkfifoat)(long long fd_, void *path_, long long mode_) {
3468 const char *path = (const char *)path_;
3470 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3473 POST_SYSCALL(mkfifoat)
3474 (long long res, long long fd_, void *path_, long long mode_) {
3475 const char *path = (const char *)path_;
3478 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3482 PRE_SYSCALL(mknodat)
3483 (long long fd_, void *path_, long long mode_, long long PAD_, long long dev_) {
3484 const char *path = (const char *)path_;
3486 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3489 POST_SYSCALL(mknodat)
3490 (long long res, long long fd_, void *path_, long long mode_, long long PAD_,
3492 const char *path = (const char *)path_;
3495 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3499 PRE_SYSCALL(mkdirat)(long long fd_, void *path_, long long mode_) {
3500 const char *path = (const char *)path_;
3502 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3505 POST_SYSCALL(mkdirat)
3506 (long long res, long long fd_, void *path_, long long mode_) {
3507 const char *path = (const char *)path_;
3510 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3514 PRE_SYSCALL(faccessat)
3515 (long long fd_, void *path_, long long amode_, long long flag_) {
3516 const char *path = (const char *)path_;
3518 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3521 POST_SYSCALL(faccessat)
3522 (long long res, long long fd_, void *path_, long long amode_, long long flag_) {
3523 const char *path = (const char *)path_;
3526 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3530 PRE_SYSCALL(fchmodat)
3531 (long long fd_, void *path_, long long mode_, long long flag_) {
3532 const char *path = (const char *)path_;
3534 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3537 POST_SYSCALL(fchmodat)
3538 (long long res, long long fd_, void *path_, long long mode_, long long flag_) {
3539 const char *path = (const char *)path_;
3542 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3546 PRE_SYSCALL(fchownat)
3547 (long long fd_, void *path_, long long owner_, long long group_,
3549 const char *path = (const char *)path_;
3551 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3554 POST_SYSCALL(fchownat)
3555 (long long res, long long fd_, void *path_, long long owner_, long long group_,
3557 const char *path = (const char *)path_;
3560 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3564 PRE_SYSCALL(fexecve)(long long fd_, void *argp_, void *envp_) { /* TODO */ }
3565 POST_SYSCALL(fexecve)(long long res, long long fd_, void *argp_, void *envp_) {
3568 PRE_SYSCALL(fstatat)(long long fd_, void *path_, void *buf_, long long flag_) {
3569 const char *path = (const char *)path_;
3571 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3574 POST_SYSCALL(fstatat)
3575 (long long res, long long fd_, void *path_, void *buf_, long long flag_) {
3576 const char *path = (const char *)path_;
3578 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3581 PRE_SYSCALL(utimensat)
3582 (long long fd_, void *path_, void *tptr_, long long flag_) {
3583 const char *path = (const char *)path_;
3585 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3588 PRE_READ(tptr_, struct_timespec_sz);
3591 POST_SYSCALL(utimensat)
3592 (long long res, long long fd_, void *path_, void *tptr_, long long flag_) {
3593 const char *path = (const char *)path_;
3596 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3599 POST_READ(tptr_, struct_timespec_sz);
3604 (long long fd_, void *path_, long long oflags_, long long mode_) {
3605 const char *path = (const char *)path_;
3607 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3610 POST_SYSCALL(openat)
3611 (long long res, long long fd_, void *path_, long long oflags_,
3613 const char *path = (const char *)path_;
3616 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3620 PRE_SYSCALL(readlinkat)
3621 (long long fd_, void *path_, void *buf_, long long bufsize_) {
3622 const char *path = (const char *)path_;
3624 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3627 POST_SYSCALL(readlinkat)
3628 (long long res, long long fd_, void *path_, void *buf_, long long bufsize_) {
3629 const char *path = (const char *)path_;
3632 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3636 PRE_SYSCALL(symlinkat)(void *path1_, long long fd_, void *path2_) {
3637 const char *path1 = (const char *)path1_;
3638 const char *path2 = (const char *)path2_;
3640 PRE_READ(path1, __sanitizer::internal_strlen(path1) + 1);
3643 PRE_READ(path2, __sanitizer::internal_strlen(path2) + 1);
3646 POST_SYSCALL(symlinkat)
3647 (long long res, void *path1_, long long fd_, void *path2_) {
3648 const char *path1 = (const char *)path1_;
3649 const char *path2 = (const char *)path2_;
3652 POST_READ(path1, __sanitizer::internal_strlen(path1) + 1);
3655 POST_READ(path2, __sanitizer::internal_strlen(path2) + 1);
3659 PRE_SYSCALL(unlinkat)(long long fd_, void *path_, long long flag_) {
3660 const char *path = (const char *)path_;
3662 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3665 POST_SYSCALL(unlinkat)
3666 (long long res, long long fd_, void *path_, long long flag_) {
3667 const char *path = (const char *)path_;
3670 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3674 PRE_SYSCALL(futimens)(long long fd_, void *tptr_) {
3675 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_;
3677 PRE_READ(tptr[0], struct_timespec_sz);
3678 PRE_READ(tptr[1], struct_timespec_sz);
3681 POST_SYSCALL(futimens)(long long res, long long fd_, void *tptr_) {
3682 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_;
3685 POST_READ(tptr[0], struct_timespec_sz);
3686 POST_READ(tptr[1], struct_timespec_sz);
3690 PRE_SYSCALL(__quotactl)(void *path_, void *args_) {
3691 const char *path = (const char *)path_;
3693 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3696 POST_SYSCALL(__quotactl)(long long res, void *path_, void *args_) {
3697 const char *path = (const char *)path_;
3700 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3704 PRE_SYSCALL(posix_spawn)
3705 (void *pid_, void *path_, void *file_actions_, void *attrp_, void *argv_,
3707 const char *path = (const char *)path_;
3709 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3712 POST_SYSCALL(posix_spawn)
3713 (long long res, void *pid_, void *path_, void *file_actions_, void *attrp_,
3714 void *argv_, void *envp_) {
3715 const char *path = (const char *)path_;
3718 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3722 PRE_SYSCALL(recvmmsg)
3723 (long long s_, void *mmsg_, long long vlen_, long long flags_, void *timeout_) {
3725 PRE_READ(timeout_, struct_timespec_sz);
3728 POST_SYSCALL(recvmmsg)
3729 (long long res, long long s_, void *mmsg_, long long vlen_, long long flags_,
3733 POST_READ(timeout_, struct_timespec_sz);
3737 PRE_SYSCALL(sendmmsg)
3738 (long long s_, void *mmsg_, long long vlen_, long long flags_) {
3739 struct __sanitizer_mmsghdr *mmsg = (struct __sanitizer_mmsghdr *)mmsg_;
3741 PRE_READ(mmsg, sizeof(struct __sanitizer_mmsghdr) *
3742 (vlen_ > 1024 ? 1024 : vlen_));
3745 POST_SYSCALL(sendmmsg)
3746 (long long res, long long s_, void *mmsg_, long long vlen_, long long flags_) {
3747 struct __sanitizer_mmsghdr *mmsg = (struct __sanitizer_mmsghdr *)mmsg_;
3750 POST_READ(mmsg, sizeof(struct __sanitizer_mmsghdr) *
3751 (vlen_ > 1024 ? 1024 : vlen_));
3755 PRE_SYSCALL(clock_nanosleep)
3756 (long long clock_id_, long long flags_, void *rqtp_, void *rmtp_) {
3758 PRE_READ(rqtp_, struct_timespec_sz);
3761 POST_SYSCALL(clock_nanosleep)
3762 (long long res, long long clock_id_, long long flags_, void *rqtp_,
3765 POST_READ(rqtp_, struct_timespec_sz);
3768 PRE_SYSCALL(___lwp_park60)
3769 (long long clock_id_, long long flags_, void *ts_, long long unpark_,
3770 void *hint_, void *unparkhint_) {
3772 PRE_READ(ts_, struct_timespec_sz);
3775 POST_SYSCALL(___lwp_park60)
3776 (long long res, long long clock_id_, long long flags_, void *ts_,
3777 long long unpark_, void *hint_, void *unparkhint_) {
3780 POST_READ(ts_, struct_timespec_sz);
3784 PRE_SYSCALL(posix_fallocate)
3785 (long long fd_, long long PAD_, long long pos_, long long len_) {
3788 POST_SYSCALL(posix_fallocate)
3789 (long long res, long long fd_, long long PAD_, long long pos_, long long len_) {
3792 PRE_SYSCALL(fdiscard)
3793 (long long fd_, long long PAD_, long long pos_, long long len_) {
3796 POST_SYSCALL(fdiscard)
3797 (long long res, long long fd_, long long PAD_, long long pos_, long long len_) {
3801 (long long idtype_, long long id_, void *status_, long long options_,
3802 void *wru_, void *info_) {
3806 (long long res, long long idtype_, long long id_, void *status_,
3807 long long options_, void *wru_, void *info_) {
3810 PRE_SYSCALL(clock_getcpuclockid2)
3811 (long long idtype_, long long id_, void *clock_id_) {
3814 POST_SYSCALL(clock_getcpuclockid2)
3815 (long long res, long long idtype_, long long id_, void *clock_id_) {
3818 PRE_SYSCALL(__getvfsstat90)(void *buf_, long long bufsize_, long long flags_) {
3821 POST_SYSCALL(__getvfsstat90)
3822 (long long res, void *buf_, long long bufsize_, long long flags_) {
3825 PRE_SYSCALL(__statvfs190)(void *path_, void *buf_, long long flags_) {
3826 const char *path = (const char *)path_;
3828 PRE_READ(path, __sanitizer::internal_strlen(path) + 1);
3831 POST_SYSCALL(__statvfs190)
3832 (long long res, void *path_, void *buf_, long long flags_) {
3833 const char *path = (const char *)path_;
3835 POST_READ(path, __sanitizer::internal_strlen(path) + 1);
3838 PRE_SYSCALL(__fstatvfs190)(long long fd_, void *buf_, long long flags_) {
3841 POST_SYSCALL(__fstatvfs190)
3842 (long long res, long long fd_, void *buf_, long long flags_) {
3845 PRE_SYSCALL(__fhstatvfs190)
3846 (void *fhp_, long long fh_size_, void *buf_, long long flags_) {
3848 PRE_READ(fhp_, fh_size_);
3851 POST_SYSCALL(__fhstatvfs190)
3852 (long long res, void *fhp_, long long fh_size_, void *buf_, long long flags_) {}
3853 PRE_SYSCALL(__acl_get_link)(void *path_, long long type_, void *aclp_) {
3856 POST_SYSCALL(__acl_get_link)
3857 (long long res, void *path_, long long type_, void *aclp_) {
3860 PRE_SYSCALL(__acl_set_link)(void *path_, long long type_, void *aclp_) {
3863 POST_SYSCALL(__acl_set_link)
3864 (long long res, void *path_, long long type_, void *aclp_) {
3867 PRE_SYSCALL(__acl_delete_link)(void *path_, long long type_) { /* TODO */ }
3868 POST_SYSCALL(__acl_delete_link)(long long res, void *path_, long long type_) {
3871 PRE_SYSCALL(__acl_aclcheck_link)(void *path_, long long type_, void *aclp_) {
3874 POST_SYSCALL(__acl_aclcheck_link)
3875 (long long res, void *path_, long long type_, void *aclp_) {
3878 PRE_SYSCALL(__acl_get_file)(void *path_, long long type_, void *aclp_) {
3881 POST_SYSCALL(__acl_get_file)
3882 (long long res, void *path_, long long type_, void *aclp_) {
3885 PRE_SYSCALL(__acl_set_file)(void *path_, long long type_, void *aclp_) {
3888 POST_SYSCALL(__acl_set_file)
3889 (long long res, void *path_, long long type_, void *aclp_) {
3892 PRE_SYSCALL(__acl_get_fd)(long long filedes_, long long type_, void *aclp_) {
3895 POST_SYSCALL(__acl_get_fd)
3896 (long long res, long long filedes_, long long type_, void *aclp_) {
3899 PRE_SYSCALL(__acl_set_fd)(long long filedes_, long long type_, void *aclp_) {
3902 POST_SYSCALL(__acl_set_fd)
3903 (long long res, long long filedes_, long long type_, void *aclp_) {
3906 PRE_SYSCALL(__acl_delete_file)(void *path_, long long type_) { /* TODO */ }
3907 POST_SYSCALL(__acl_delete_file)(long long res, void *path_, long long type_) {
3910 PRE_SYSCALL(__acl_delete_fd)(long long filedes_, long long type_) { /* TODO */ }
3911 POST_SYSCALL(__acl_delete_fd)
3912 (long long res, long long filedes_, long long type_) {
3915 PRE_SYSCALL(__acl_aclcheck_file)(void *path_, long long type_, void *aclp_) {
3918 POST_SYSCALL(__acl_aclcheck_file)
3919 (long long res, void *path_, long long type_, void *aclp_) {
3922 PRE_SYSCALL(__acl_aclcheck_fd)
3923 (long long filedes_, long long type_, void *aclp_) {
3926 POST_SYSCALL(__acl_aclcheck_fd)
3927 (long long res, long long filedes_, long long type_, void *aclp_) {
3930 PRE_SYSCALL(lpathconf)(void *path_, long long name_) { /* TODO */ }
3931 POST_SYSCALL(lpathconf)(long long res, void *path_, long long name_) {
3934 #undef SYS_MAXSYSARGS
3944 #endif // SANITIZER_NETBSD