1//===-- sanitizer_syscalls_netbsd.inc ---------------------------*- C++ -*-===// 2// 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 6// 7//===----------------------------------------------------------------------===// 8// 9// Common syscalls handlers for tools like AddressSanitizer, 10// ThreadSanitizer, MemorySanitizer, etc. 11// 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. 41// 42// DO NOT EDIT! THIS FILE HAS BEEN GENERATED! 43// 44// Generated with: generate_netbsd_syscalls.awk 45// Generated date: 2019-12-24 46// Generated from: syscalls.master,v 1.296 2019/09/22 22:59:39 christos Exp 47// 48//===----------------------------------------------------------------------===// 49 50#include "sanitizer_platform.h" 51#if SANITIZER_NETBSD 52 53#include "sanitizer_libc.h" 54 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) 59 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) 64 65#ifndef COMMON_SYSCALL_ACQUIRE 66#define COMMON_SYSCALL_ACQUIRE(addr) ((void)(addr)) 67#endif 68 69#ifndef COMMON_SYSCALL_RELEASE 70#define COMMON_SYSCALL_RELEASE(addr) ((void)(addr)) 71#endif 72 73#ifndef COMMON_SYSCALL_FD_CLOSE 74#define COMMON_SYSCALL_FD_CLOSE(fd) ((void)(fd)) 75#endif 76 77#ifndef COMMON_SYSCALL_FD_ACQUIRE 78#define COMMON_SYSCALL_FD_ACQUIRE(fd) ((void)(fd)) 79#endif 80 81#ifndef COMMON_SYSCALL_FD_RELEASE 82#define COMMON_SYSCALL_FD_RELEASE(fd) ((void)(fd)) 83#endif 84 85#ifndef COMMON_SYSCALL_PRE_FORK 86#define COMMON_SYSCALL_PRE_FORK() \ 87 {} 88#endif 89 90#ifndef COMMON_SYSCALL_POST_FORK 91#define COMMON_SYSCALL_POST_FORK(res) \ 92 {} 93#endif 94 95// FIXME: do some kind of PRE_READ for all syscall arguments (int(s) and such). 96 97extern "C" { 98#define SYS_MAXSYSARGS 8 99PRE_SYSCALL(syscall)(long long code_, long long args_[SYS_MAXSYSARGS]) { 100 /* Nothing to do */ 101} 102POST_SYSCALL(syscall) 103(long long res, long long code_, long long args_[SYS_MAXSYSARGS]) { 104 /* Nothing to do */ 105} 106PRE_SYSCALL(exit)(long long rval_) { /* Nothing to do */ } 107POST_SYSCALL(exit)(long long res, long long rval_) { /* Nothing to do */ } 108PRE_SYSCALL(fork)(void) { COMMON_SYSCALL_PRE_FORK(); } 109POST_SYSCALL(fork)(long long res) { COMMON_SYSCALL_POST_FORK(res); } 110PRE_SYSCALL(read)(long long fd_, void *buf_, long long nbyte_) { 111 if (buf_) { 112 PRE_WRITE(buf_, nbyte_); 113 } 114} 115POST_SYSCALL(read)(long long res, long long fd_, void *buf_, long long nbyte_) { 116 if (res > 0) { 117 POST_WRITE(buf_, res); 118 } 119} 120PRE_SYSCALL(write)(long long fd_, void *buf_, long long nbyte_) { 121 if (buf_) { 122 PRE_READ(buf_, nbyte_); 123 } 124} 125POST_SYSCALL(write) 126(long long res, long long fd_, void *buf_, long long nbyte_) { 127 if (res > 0) { 128 POST_READ(buf_, res); 129 } 130} 131PRE_SYSCALL(open)(void *path_, long long flags_, long long mode_) { 132 const char *path = (const char *)path_; 133 if (path) { 134 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 135 } 136} 137POST_SYSCALL(open) 138(long long res, void *path_, long long flags_, long long mode_) { 139 if (res > 0) { 140 const char *path = (const char *)path_; 141 if (path) { 142 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 143 } 144 } 145} 146PRE_SYSCALL(close)(long long fd_) { COMMON_SYSCALL_FD_CLOSE((int)fd_); } 147POST_SYSCALL(close)(long long res, long long fd_) { /* Nothing to do */ } 148PRE_SYSCALL(compat_50_wait4) 149(long long pid_, void *status_, long long options_, void *rusage_) { 150 /* TODO */ 151} 152POST_SYSCALL(compat_50_wait4) 153(long long res, long long pid_, void *status_, long long options_, 154 void *rusage_) { 155 /* TODO */ 156} 157PRE_SYSCALL(compat_43_ocreat)(void *path_, long long mode_) { /* TODO */ } 158POST_SYSCALL(compat_43_ocreat)(long long res, void *path_, long long mode_) { 159 /* TODO */ 160} 161PRE_SYSCALL(link)(void *path_, void *link_) { 162 const char *path = (const char *)path_; 163 const char *link = (const char *)link_; 164 if (path) { 165 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 166 } 167 if (link) { 168 PRE_READ(path, __sanitizer::internal_strlen(link) + 1); 169 } 170} 171POST_SYSCALL(link)(long long res, void *path_, void *link_) { 172 if (res == 0) { 173 const char *path = (const char *)path_; 174 const char *link = (const char *)link_; 175 if (path) { 176 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 177 } 178 if (link) { 179 POST_READ(path, __sanitizer::internal_strlen(link) + 1); 180 } 181 } 182} 183PRE_SYSCALL(unlink)(void *path_) { 184 const char *path = (const char *)path_; 185 if (path) { 186 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 187 } 188} 189POST_SYSCALL(unlink)(long long res, void *path_) { 190 if (res == 0) { 191 const char *path = (const char *)path_; 192 if (path) { 193 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 194 } 195 } 196} 197/* syscall 11 has been skipped */ 198PRE_SYSCALL(chdir)(void *path_) { 199 const char *path = (const char *)path_; 200 if (path) { 201 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 202 } 203} 204POST_SYSCALL(chdir)(long long res, void *path_) { 205 if (res == 0) { 206 const char *path = (const char *)path_; 207 if (path) { 208 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 209 } 210 } 211} 212PRE_SYSCALL(fchdir)(long long fd_) { /* Nothing to do */ } 213POST_SYSCALL(fchdir)(long long res, long long fd_) { /* Nothing to do */ } 214PRE_SYSCALL(compat_50_mknod)(void *path_, long long mode_, long long dev_) { 215 /* TODO */ 216} 217POST_SYSCALL(compat_50_mknod) 218(long long res, void *path_, long long mode_, long long dev_) { 219 /* TODO */ 220} 221PRE_SYSCALL(chmod)(void *path_, long long mode_) { 222 const char *path = (const char *)path_; 223 if (path) { 224 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 225 } 226} 227POST_SYSCALL(chmod)(long long res, void *path_, long long mode_) { 228 if (res == 0) { 229 const char *path = (const char *)path_; 230 if (path) { 231 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 232 } 233 } 234} 235PRE_SYSCALL(chown)(void *path_, long long uid_, long long gid_) { 236 const char *path = (const char *)path_; 237 if (path) { 238 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 239 } 240} 241POST_SYSCALL(chown) 242(long long res, void *path_, long long uid_, long long gid_) { 243 if (res == 0) { 244 const char *path = (const char *)path_; 245 if (path) { 246 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 247 } 248 } 249} 250PRE_SYSCALL(break)(void *nsize_) { /* Nothing to do */ } 251POST_SYSCALL(break)(long long res, void *nsize_) { /* Nothing to do */ } 252PRE_SYSCALL(compat_20_getfsstat) 253(void *buf_, long long bufsize_, long long flags_) { 254 /* TODO */ 255} 256POST_SYSCALL(compat_20_getfsstat) 257(long long res, void *buf_, long long bufsize_, long long flags_) { 258 /* TODO */ 259} 260PRE_SYSCALL(compat_43_olseek) 261(long long fd_, long long offset_, long long whence_) { 262 /* TODO */ 263} 264POST_SYSCALL(compat_43_olseek) 265(long long res, long long fd_, long long offset_, long long whence_) { 266 /* TODO */ 267} 268PRE_SYSCALL(getpid)(void) { /* Nothing to do */ } 269POST_SYSCALL(getpid)(long long res) { /* Nothing to do */ } 270PRE_SYSCALL(compat_40_mount) 271(void *type_, void *path_, long long flags_, void *data_) { 272 /* TODO */ 273} 274POST_SYSCALL(compat_40_mount) 275(long long res, void *type_, void *path_, long long flags_, void *data_) { 276 /* TODO */ 277} 278PRE_SYSCALL(unmount)(void *path_, long long flags_) { 279 const char *path = (const char *)path_; 280 if (path) { 281 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 282 } 283} 284POST_SYSCALL(unmount)(long long res, void *path_, long long flags_) { 285 if (res == 0) { 286 const char *path = (const char *)path_; 287 if (path) { 288 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 289 } 290 } 291} 292PRE_SYSCALL(setuid)(long long uid_) { /* Nothing to do */ } 293POST_SYSCALL(setuid)(long long res, long long uid_) { /* Nothing to do */ } 294PRE_SYSCALL(getuid)(void) { /* Nothing to do */ } 295POST_SYSCALL(getuid)(long long res) { /* Nothing to do */ } 296PRE_SYSCALL(geteuid)(void) { /* Nothing to do */ } 297POST_SYSCALL(geteuid)(long long res) { /* Nothing to do */ } 298PRE_SYSCALL(ptrace) 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); 307 } 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); 312 } 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); 348 } 349} 350POST_SYSCALL(ptrace) 351(long long res, long long req_, long long pid_, void *addr_, long long data_) { 352 if (res == 0) { 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); 360 } 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); 365 } 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); 401 } 402 } 403} 404PRE_SYSCALL(recvmsg)(long long s_, void *msg_, long long flags_) { 405 PRE_WRITE(msg_, sizeof(__sanitizer_msghdr)); 406} 407POST_SYSCALL(recvmsg) 408(long long res, long long s_, void *msg_, long long flags_) { 409 if (res > 0) { 410 POST_WRITE(msg_, sizeof(__sanitizer_msghdr)); 411 } 412} 413PRE_SYSCALL(sendmsg)(long long s_, void *msg_, long long flags_) { 414 PRE_READ(msg_, sizeof(__sanitizer_msghdr)); 415} 416POST_SYSCALL(sendmsg) 417(long long res, long long s_, void *msg_, long long flags_) { 418 if (res > 0) { 419 POST_READ(msg_, sizeof(__sanitizer_msghdr)); 420 } 421} 422PRE_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)); 428} 429POST_SYSCALL(recvfrom) 430(long long res, long long s_, void *buf_, long long len_, long long flags_, 431 void *from_, void *fromlenaddr_) { 432 if (res >= 0) { 433 POST_WRITE(buf_, res); 434 POST_WRITE(from_, struct_sockaddr_sz); 435 POST_WRITE(fromlenaddr_, sizeof(__sanitizer_socklen_t)); 436 } 437} 438PRE_SYSCALL(accept)(long long s_, void *name_, void *anamelen_) { 439 PRE_WRITE(name_, struct_sockaddr_sz); 440 PRE_WRITE(anamelen_, sizeof(__sanitizer_socklen_t)); 441} 442POST_SYSCALL(accept) 443(long long res, long long s_, void *name_, void *anamelen_) { 444 if (res == 0) { 445 POST_WRITE(name_, struct_sockaddr_sz); 446 POST_WRITE(anamelen_, sizeof(__sanitizer_socklen_t)); 447 } 448} 449PRE_SYSCALL(getpeername)(long long fdes_, void *asa_, void *alen_) { 450 PRE_WRITE(asa_, struct_sockaddr_sz); 451 PRE_WRITE(alen_, sizeof(__sanitizer_socklen_t)); 452} 453POST_SYSCALL(getpeername) 454(long long res, long long fdes_, void *asa_, void *alen_) { 455 if (res == 0) { 456 POST_WRITE(asa_, struct_sockaddr_sz); 457 POST_WRITE(alen_, sizeof(__sanitizer_socklen_t)); 458 } 459} 460PRE_SYSCALL(getsockname)(long long fdes_, void *asa_, void *alen_) { 461 PRE_WRITE(asa_, struct_sockaddr_sz); 462 PRE_WRITE(alen_, sizeof(__sanitizer_socklen_t)); 463} 464POST_SYSCALL(getsockname) 465(long long res, long long fdes_, void *asa_, void *alen_) { 466 if (res == 0) { 467 POST_WRITE(asa_, struct_sockaddr_sz); 468 POST_WRITE(alen_, sizeof(__sanitizer_socklen_t)); 469 } 470} 471PRE_SYSCALL(access)(void *path_, long long flags_) { 472 const char *path = (const char *)path_; 473 if (path) { 474 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 475 } 476} 477POST_SYSCALL(access)(long long res, void *path_, long long flags_) { 478 if (res == 0) { 479 const char *path = (const char *)path_; 480 if (path) { 481 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 482 } 483 } 484} 485PRE_SYSCALL(chflags)(void *path_, long long flags_) { 486 const char *path = (const char *)path_; 487 if (path) { 488 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 489 } 490} 491POST_SYSCALL(chflags)(long long res, void *path_, long long flags_) { 492 if (res == 0) { 493 const char *path = (const char *)path_; 494 if (path) { 495 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 496 } 497 } 498} 499PRE_SYSCALL(fchflags)(long long fd_, long long flags_) { /* Nothing to do */ } 500POST_SYSCALL(fchflags)(long long res, long long fd_, long long flags_) { 501 /* Nothing to do */ 502} 503PRE_SYSCALL(sync)(void) { /* Nothing to do */ } 504POST_SYSCALL(sync)(long long res) { /* Nothing to do */ } 505PRE_SYSCALL(kill)(long long pid_, long long signum_) { /* Nothing to do */ } 506POST_SYSCALL(kill)(long long res, long long pid_, long long signum_) { 507 /* Nothing to do */ 508} 509PRE_SYSCALL(compat_43_stat43)(void *path_, void *ub_) { /* TODO */ } 510POST_SYSCALL(compat_43_stat43)(long long res, void *path_, void *ub_) { 511 /* TODO */ 512} 513PRE_SYSCALL(getppid)(void) { /* Nothing to do */ } 514POST_SYSCALL(getppid)(long long res) { /* Nothing to do */ } 515PRE_SYSCALL(compat_43_lstat43)(void *path_, void *ub_) { /* TODO */ } 516POST_SYSCALL(compat_43_lstat43)(long long res, void *path_, void *ub_) { 517 /* TODO */ 518} 519PRE_SYSCALL(dup)(long long fd_) { /* Nothing to do */ } 520POST_SYSCALL(dup)(long long res, long long fd_) { /* Nothing to do */ } 521PRE_SYSCALL(pipe)(void) { 522 /* pipe returns two descriptors through two returned values */ 523} 524POST_SYSCALL(pipe)(long long res) { 525 /* pipe returns two descriptors through two returned values */ 526} 527PRE_SYSCALL(getegid)(void) { /* Nothing to do */ } 528POST_SYSCALL(getegid)(long long res) { /* Nothing to do */ } 529PRE_SYSCALL(profil) 530(void *samples_, long long size_, long long offset_, long long scale_) { 531 if (samples_) { 532 PRE_WRITE(samples_, size_); 533 } 534} 535POST_SYSCALL(profil) 536(long long res, void *samples_, long long size_, long long offset_, 537 long long scale_) { 538 if (res == 0) { 539 if (samples_) { 540 POST_WRITE(samples_, size_); 541 } 542 } 543} 544PRE_SYSCALL(ktrace) 545(void *fname_, long long ops_, long long facs_, long long pid_) { 546 const char *fname = (const char *)fname_; 547 if (fname) { 548 PRE_READ(fname, __sanitizer::internal_strlen(fname) + 1); 549 } 550} 551POST_SYSCALL(ktrace) 552(long long res, void *fname_, long long ops_, long long facs_, long long pid_) { 553 const char *fname = (const char *)fname_; 554 if (res == 0) { 555 if (fname) { 556 POST_READ(fname, __sanitizer::internal_strlen(fname) + 1); 557 } 558 } 559} 560PRE_SYSCALL(compat_13_sigaction13)(long long signum_, void *nsa_, void *osa_) { 561 /* TODO */ 562} 563POST_SYSCALL(compat_13_sigaction13) 564(long long res, long long signum_, void *nsa_, void *osa_) { 565 /* TODO */ 566} 567PRE_SYSCALL(getgid)(void) { /* Nothing to do */ } 568POST_SYSCALL(getgid)(long long res) { /* Nothing to do */ } 569PRE_SYSCALL(compat_13_sigprocmask13)(long long how_, long long mask_) { 570 /* TODO */ 571} 572POST_SYSCALL(compat_13_sigprocmask13) 573(long long res, long long how_, long long mask_) { 574 /* TODO */ 575} 576PRE_SYSCALL(__getlogin)(void *namebuf_, long long namelen_) { 577 if (namebuf_) { 578 PRE_WRITE(namebuf_, namelen_); 579 } 580} 581POST_SYSCALL(__getlogin)(long long res, void *namebuf_, long long namelen_) { 582 if (res == 0) { 583 if (namebuf_) { 584 POST_WRITE(namebuf_, namelen_); 585 } 586 } 587} 588PRE_SYSCALL(__setlogin)(void *namebuf_) { 589 const char *namebuf = (const char *)namebuf_; 590 if (namebuf) { 591 PRE_READ(namebuf, __sanitizer::internal_strlen(namebuf) + 1); 592 } 593} 594POST_SYSCALL(__setlogin)(long long res, void *namebuf_) { 595 if (res == 0) { 596 const char *namebuf = (const char *)namebuf_; 597 if (namebuf) { 598 POST_READ(namebuf, __sanitizer::internal_strlen(namebuf) + 1); 599 } 600 } 601} 602PRE_SYSCALL(acct)(void *path_) { 603 const char *path = (const char *)path_; 604 if (path) { 605 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 606 } 607} 608POST_SYSCALL(acct)(long long res, void *path_) { 609 if (res == 0) { 610 const char *path = (const char *)path_; 611 if (path) { 612 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 613 } 614 } 615} 616PRE_SYSCALL(compat_13_sigpending13)(void) { /* TODO */ } 617POST_SYSCALL(compat_13_sigpending13)(long long res) { /* TODO */ } 618PRE_SYSCALL(compat_13_sigaltstack13)(void *nss_, void *oss_) { /* TODO */ } 619POST_SYSCALL(compat_13_sigaltstack13)(long long res, void *nss_, void *oss_) { 620 /* TODO */ 621} 622PRE_SYSCALL(ioctl)(long long fd_, long long com_, void *data_) { 623 /* Nothing to do */ 624} 625POST_SYSCALL(ioctl)(long long res, long long fd_, long long com_, void *data_) { 626 /* Nothing to do */ 627} 628PRE_SYSCALL(compat_12_oreboot)(long long opt_) { /* TODO */ } 629POST_SYSCALL(compat_12_oreboot)(long long res, long long opt_) { /* TODO */ } 630PRE_SYSCALL(revoke)(void *path_) { 631 const char *path = (const char *)path_; 632 if (path) { 633 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 634 } 635} 636POST_SYSCALL(revoke)(long long res, void *path_) { 637 if (res == 0) { 638 const char *path = (const char *)path_; 639 if (path) { 640 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 641 } 642 } 643} 644PRE_SYSCALL(symlink)(void *path_, void *link_) { 645 const char *path = (const char *)path_; 646 const char *link = (const char *)link_; 647 if (path) { 648 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 649 } 650 if (link) { 651 PRE_READ(link, __sanitizer::internal_strlen(link) + 1); 652 } 653} 654POST_SYSCALL(symlink)(long long res, void *path_, void *link_) { 655 if (res == 0) { 656 const char *path = (const char *)path_; 657 const char *link = (const char *)link_; 658 if (path) { 659 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 660 } 661 if (link) { 662 POST_READ(link, __sanitizer::internal_strlen(link) + 1); 663 } 664 } 665} 666PRE_SYSCALL(readlink)(void *path_, void *buf_, long long count_) { 667 const char *path = (const char *)path_; 668 if (path) { 669 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 670 } 671 if (buf_) { 672 PRE_WRITE(buf_, count_); 673 } 674} 675POST_SYSCALL(readlink) 676(long long res, void *path_, void *buf_, long long count_) { 677 if (res > 0) { 678 const char *path = (const char *)path_; 679 if (path) { 680 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 681 } 682 if (buf_) { 683 PRE_WRITE(buf_, res); 684 } 685 } 686} 687PRE_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_; 691 if (path) { 692 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 693 } 694 if (argp && argp[0]) { 695 char *a = argp[0]; 696 while (a++) { 697 PRE_READ(a, __sanitizer::internal_strlen(a) + 1); 698 } 699 } 700 if (envp && envp[0]) { 701 char *e = envp[0]; 702 while (e++) { 703 PRE_READ(e, __sanitizer::internal_strlen(e) + 1); 704 } 705 } 706} 707POST_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_; 712 if (path) { 713 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 714 } 715 if (argp && argp[0]) { 716 char *a = argp[0]; 717 while (a++) { 718 POST_READ(a, __sanitizer::internal_strlen(a) + 1); 719 } 720 } 721 if (envp && envp[0]) { 722 char *e = envp[0]; 723 while (e++) { 724 POST_READ(e, __sanitizer::internal_strlen(e) + 1); 725 } 726 } 727} 728PRE_SYSCALL(umask)(long long newmask_) { /* Nothing to do */ } 729POST_SYSCALL(umask)(long long res, long long newmask_) { /* Nothing to do */ } 730PRE_SYSCALL(chroot)(void *path_) { 731 const char *path = (const char *)path_; 732 if (path) { 733 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 734 } 735} 736POST_SYSCALL(chroot)(long long res, void *path_) { 737 if (res == 0) { 738 const char *path = (const char *)path_; 739 if (path) { 740 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 741 } 742 } 743} 744PRE_SYSCALL(compat_43_fstat43)(long long fd_, void *sb_) { /* TODO */ } 745POST_SYSCALL(compat_43_fstat43)(long long res, long long fd_, void *sb_) { 746 /* TODO */ 747} 748PRE_SYSCALL(compat_43_ogetkerninfo) 749(long long op_, void *where_, void *size_, long long arg_) { 750 /* TODO */ 751} 752POST_SYSCALL(compat_43_ogetkerninfo) 753(long long res, long long op_, void *where_, void *size_, long long arg_) { 754 /* TODO */ 755} 756PRE_SYSCALL(compat_43_ogetpagesize)(void) { /* TODO */ } 757POST_SYSCALL(compat_43_ogetpagesize)(long long res) { /* TODO */ } 758PRE_SYSCALL(compat_12_msync)(void *addr_, long long len_) { /* TODO */ } 759POST_SYSCALL(compat_12_msync)(long long res, void *addr_, long long len_) { 760 /* TODO */ 761} 762PRE_SYSCALL(vfork)(void) { /* Nothing to do */ } 763POST_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 */ 768PRE_SYSCALL(compat_43_ommap) 769(void *addr_, long long len_, long long prot_, long long flags_, long long fd_, 770 long long pos_) { 771 /* TODO */ 772} 773POST_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_) { 776 /* TODO */ 777} 778PRE_SYSCALL(vadvise)(long long anom_) { /* Nothing to do */ } 779POST_SYSCALL(vadvise)(long long res, long long anom_) { /* Nothing to do */ } 780PRE_SYSCALL(munmap)(void *addr_, long long len_) { /* Nothing to do */ } 781POST_SYSCALL(munmap)(long long res, void *addr_, long long len_) { 782 /* Nothing to do */ 783} 784PRE_SYSCALL(mprotect)(void *addr_, long long len_, long long prot_) { 785 /* Nothing to do */ 786} 787POST_SYSCALL(mprotect) 788(long long res, void *addr_, long long len_, long long prot_) { 789 /* Nothing to do */ 790} 791PRE_SYSCALL(madvise)(void *addr_, long long len_, long long behav_) { 792 /* Nothing to do */ 793} 794POST_SYSCALL(madvise) 795(long long res, void *addr_, long long len_, long long behav_) { 796 /* Nothing to do */ 797} 798/* syscall 76 has been skipped */ 799/* syscall 77 has been skipped */ 800PRE_SYSCALL(mincore)(void *addr_, long long len_, void *vec_) { 801 /* Nothing to do */ 802} 803POST_SYSCALL(mincore)(long long res, void *addr_, long long len_, void *vec_) { 804 /* Nothing to do */ 805} 806PRE_SYSCALL(getgroups)(long long gidsetsize_, void *gidset_) { 807 unsigned int *gidset = (unsigned int *)gidset_; 808 if (gidset) { 809 PRE_WRITE(gidset, sizeof(*gidset) * gidsetsize_); 810 } 811} 812POST_SYSCALL(getgroups)(long long res, long long gidsetsize_, void *gidset_) { 813 if (res == 0) { 814 unsigned int *gidset = (unsigned int *)gidset_; 815 if (gidset) { 816 POST_WRITE(gidset, sizeof(*gidset) * gidsetsize_); 817 } 818 } 819} 820PRE_SYSCALL(setgroups)(long long gidsetsize_, void *gidset_) { 821 unsigned int *gidset = (unsigned int *)gidset_; 822 if (gidset) { 823 PRE_READ(gidset, sizeof(*gidset) * gidsetsize_); 824 } 825} 826POST_SYSCALL(setgroups)(long long res, long long gidsetsize_, void *gidset_) { 827 if (res == 0) { 828 unsigned int *gidset = (unsigned int *)gidset_; 829 if (gidset) { 830 POST_READ(gidset, sizeof(*gidset) * gidsetsize_); 831 } 832 } 833} 834PRE_SYSCALL(getpgrp)(void) { /* Nothing to do */ } 835POST_SYSCALL(getpgrp)(long long res) { /* Nothing to do */ } 836PRE_SYSCALL(setpgid)(long long pid_, long long pgid_) { /* Nothing to do */ } 837POST_SYSCALL(setpgid)(long long res, long long pid_, long long pgid_) { 838 /* Nothing to do */ 839} 840PRE_SYSCALL(compat_50_setitimer)(long long which_, void *itv_, void *oitv_) { 841 /* TODO */ 842} 843POST_SYSCALL(compat_50_setitimer) 844(long long res, long long which_, void *itv_, void *oitv_) { 845 /* TODO */ 846} 847PRE_SYSCALL(compat_43_owait)(void) { /* TODO */ } 848POST_SYSCALL(compat_43_owait)(long long res) { /* TODO */ } 849PRE_SYSCALL(compat_12_oswapon)(void *name_) { /* TODO */ } 850POST_SYSCALL(compat_12_oswapon)(long long res, void *name_) { /* TODO */ } 851PRE_SYSCALL(compat_50_getitimer)(long long which_, void *itv_) { /* TODO */ } 852POST_SYSCALL(compat_50_getitimer)(long long res, long long which_, void *itv_) { 853 /* TODO */ 854} 855PRE_SYSCALL(compat_43_ogethostname)(void *hostname_, long long len_) { 856 /* TODO */ 857} 858POST_SYSCALL(compat_43_ogethostname) 859(long long res, void *hostname_, long long len_) { 860 /* TODO */ 861} 862PRE_SYSCALL(compat_43_osethostname)(void *hostname_, long long len_) { 863 /* TODO */ 864} 865POST_SYSCALL(compat_43_osethostname) 866(long long res, void *hostname_, long long len_) { 867 /* TODO */ 868} 869PRE_SYSCALL(compat_43_ogetdtablesize)(void) { /* TODO */ } 870POST_SYSCALL(compat_43_ogetdtablesize)(long long res) { /* TODO */ } 871PRE_SYSCALL(dup2)(long long from_, long long to_) { /* Nothing to do */ } 872POST_SYSCALL(dup2)(long long res, long long from_, long long to_) { 873 /* Nothing to do */ 874} 875/* syscall 91 has been skipped */ 876PRE_SYSCALL(fcntl)(long long fd_, long long cmd_, void *arg_) { 877 /* Nothing to do */ 878} 879POST_SYSCALL(fcntl)(long long res, long long fd_, long long cmd_, void *arg_) { 880 /* Nothing to do */ 881} 882PRE_SYSCALL(compat_50_select) 883(long long nd_, void *in_, void *ou_, void *ex_, void *tv_) { 884 /* TODO */ 885} 886POST_SYSCALL(compat_50_select) 887(long long res, long long nd_, void *in_, void *ou_, void *ex_, void *tv_) { 888 /* TODO */ 889} 890/* syscall 94 has been skipped */ 891PRE_SYSCALL(fsync)(long long fd_) { /* Nothing to do */ } 892POST_SYSCALL(fsync)(long long res, long long fd_) { /* Nothing to do */ } 893PRE_SYSCALL(setpriority)(long long which_, long long who_, long long prio_) { 894 /* Nothing to do */ 895} 896POST_SYSCALL(setpriority) 897(long long res, long long which_, long long who_, long long prio_) { 898 /* Nothing to do */ 899} 900PRE_SYSCALL(compat_30_socket) 901(long long domain_, long long type_, long long protocol_) { 902 /* TODO */ 903} 904POST_SYSCALL(compat_30_socket) 905(long long res, long long domain_, long long type_, long long protocol_) { 906 /* TODO */ 907} 908PRE_SYSCALL(connect)(long long s_, void *name_, long long namelen_) { 909 PRE_READ(name_, namelen_); 910} 911POST_SYSCALL(connect) 912(long long res, long long s_, void *name_, long long namelen_) { 913 if (res == 0) { 914 POST_READ(name_, namelen_); 915 } 916} 917PRE_SYSCALL(compat_43_oaccept)(long long s_, void *name_, void *anamelen_) { 918 /* TODO */ 919} 920POST_SYSCALL(compat_43_oaccept) 921(long long res, long long s_, void *name_, void *anamelen_) { 922 /* TODO */ 923} 924PRE_SYSCALL(getpriority)(long long which_, long long who_) { 925 /* Nothing to do */ 926} 927POST_SYSCALL(getpriority)(long long res, long long which_, long long who_) { 928 /* Nothing to do */ 929} 930PRE_SYSCALL(compat_43_osend) 931(long long s_, void *buf_, long long len_, long long flags_) { 932 /* TODO */ 933} 934POST_SYSCALL(compat_43_osend) 935(long long res, long long s_, void *buf_, long long len_, long long flags_) { 936 /* TODO */ 937} 938PRE_SYSCALL(compat_43_orecv) 939(long long s_, void *buf_, long long len_, long long flags_) { 940 /* TODO */ 941} 942POST_SYSCALL(compat_43_orecv) 943(long long res, long long s_, void *buf_, long long len_, long long flags_) { 944 /* TODO */ 945} 946PRE_SYSCALL(compat_13_sigreturn13)(void *sigcntxp_) { /* TODO */ } 947POST_SYSCALL(compat_13_sigreturn13)(long long res, void *sigcntxp_) { 948 /* TODO */ 949} 950PRE_SYSCALL(bind)(long long s_, void *name_, long long namelen_) { 951 PRE_READ(name_, namelen_); 952} 953POST_SYSCALL(bind) 954(long long res, long long s_, void *name_, long long namelen_) { 955 if (res == 0) { 956 PRE_READ(name_, namelen_); 957 } 958} 959PRE_SYSCALL(setsockopt) 960(long long s_, long long level_, long long name_, void *val_, 961 long long valsize_) { 962 if (val_) { 963 PRE_READ(val_, valsize_); 964 } 965} 966POST_SYSCALL(setsockopt) 967(long long res, long long s_, long long level_, long long name_, void *val_, 968 long long valsize_) { 969 if (res == 0) { 970 if (val_) { 971 POST_READ(val_, valsize_); 972 } 973 } 974} 975PRE_SYSCALL(listen)(long long s_, long long backlog_) { /* Nothing to do */ } 976POST_SYSCALL(listen)(long long res, long long s_, long long backlog_) { 977 /* Nothing to do */ 978} 979/* syscall 107 has been skipped */ 980PRE_SYSCALL(compat_43_osigvec)(long long signum_, void *nsv_, void *osv_) { 981 /* TODO */ 982} 983POST_SYSCALL(compat_43_osigvec) 984(long long res, long long signum_, void *nsv_, void *osv_) { 985 /* TODO */ 986} 987PRE_SYSCALL(compat_43_osigblock)(long long mask_) { /* TODO */ } 988POST_SYSCALL(compat_43_osigblock)(long long res, long long mask_) { /* TODO */ } 989PRE_SYSCALL(compat_43_osigsetmask)(long long mask_) { /* TODO */ } 990POST_SYSCALL(compat_43_osigsetmask)(long long res, long long mask_) { 991 /* TODO */ 992} 993PRE_SYSCALL(compat_13_sigsuspend13)(long long mask_) { /* TODO */ } 994POST_SYSCALL(compat_13_sigsuspend13)(long long res, long long mask_) { 995 /* TODO */ 996} 997PRE_SYSCALL(compat_43_osigstack)(void *nss_, void *oss_) { /* TODO */ } 998POST_SYSCALL(compat_43_osigstack)(long long res, void *nss_, void *oss_) { 999 /* TODO */ 1000} 1001PRE_SYSCALL(compat_43_orecvmsg)(long long s_, void *msg_, long long flags_) { 1002 /* TODO */ 1003} 1004POST_SYSCALL(compat_43_orecvmsg) 1005(long long res, long long s_, void *msg_, long long flags_) { 1006 /* TODO */ 1007} 1008PRE_SYSCALL(compat_43_osendmsg)(long long s_, void *msg_, long long flags_) { 1009 /* TODO */ 1010} 1011POST_SYSCALL(compat_43_osendmsg) 1012(long long res, long long s_, void *msg_, long long flags_) { 1013 /* TODO */ 1014} 1015/* syscall 115 has been skipped */ 1016PRE_SYSCALL(compat_50_gettimeofday)(void *tp_, void *tzp_) { /* TODO */ } 1017POST_SYSCALL(compat_50_gettimeofday)(long long res, void *tp_, void *tzp_) { 1018 /* TODO */ 1019} 1020PRE_SYSCALL(compat_50_getrusage)(long long who_, void *rusage_) { /* TODO */ } 1021POST_SYSCALL(compat_50_getrusage) 1022(long long res, long long who_, void *rusage_) { 1023 /* TODO */ 1024} 1025PRE_SYSCALL(getsockopt) 1026(long long s_, long long level_, long long name_, void *val_, void *avalsize_) { 1027 /* TODO */ 1028} 1029POST_SYSCALL(getsockopt) 1030(long long res, long long s_, long long level_, long long name_, void *val_, 1031 void *avalsize_) { 1032 /* TODO */ 1033} 1034/* syscall 119 has been skipped */ 1035PRE_SYSCALL(readv)(long long fd_, void *iovp_, long long iovcnt_) { 1036 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_; 1037 int i; 1038 if (iovp) { 1039 PRE_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_); 1040 for (i = 0; i < iovcnt_; i++) { 1041 PRE_WRITE(iovp[i].iov_base, iovp[i].iov_len); 1042 } 1043 } 1044} 1045POST_SYSCALL(readv) 1046(long long res, long long fd_, void *iovp_, long long iovcnt_) { 1047 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_; 1048 int i; 1049 uptr m, n = res; 1050 if (res > 0) { 1051 if (iovp) { 1052 POST_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_); 1053 for (i = 0; i < iovcnt_ && n > 0; i++) { 1054 m = n > iovp[i].iov_len ? iovp[i].iov_len : n; 1055 POST_WRITE(iovp[i].iov_base, m); 1056 n -= m; 1057 } 1058 } 1059 } 1060} 1061PRE_SYSCALL(writev)(long long fd_, void *iovp_, long long iovcnt_) { 1062 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_; 1063 int i; 1064 if (iovp) { 1065 PRE_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_); 1066 for (i = 0; i < iovcnt_; i++) { 1067 PRE_READ(iovp[i].iov_base, iovp[i].iov_len); 1068 } 1069 } 1070} 1071POST_SYSCALL(writev) 1072(long long res, long long fd_, void *iovp_, long long iovcnt_) { 1073 struct __sanitizer_iovec *iovp = (struct __sanitizer_iovec *)iovp_; 1074 int i; 1075 uptr m, n = res; 1076 if (res > 0) { 1077 if (iovp) { 1078 POST_READ(iovp, sizeof(struct __sanitizer_iovec) * iovcnt_); 1079 for (i = 0; i < iovcnt_ && n > 0; i++) { 1080 m = n > iovp[i].iov_len ? iovp[i].iov_len : n; 1081 POST_READ(iovp[i].iov_base, m); 1082 n -= m; 1083 } 1084 } 1085 } 1086} 1087PRE_SYSCALL(compat_50_settimeofday)(void *tv_, void *tzp_) { /* TODO */ } 1088POST_SYSCALL(compat_50_settimeofday)(long long res, void *tv_, void *tzp_) { 1089 /* TODO */ 1090} 1091PRE_SYSCALL(fchown)(long long fd_, long long uid_, long long gid_) { 1092 /* Nothing to do */ 1093} 1094POST_SYSCALL(fchown) 1095(long long res, long long fd_, long long uid_, long long gid_) { 1096 /* Nothing to do */ 1097} 1098PRE_SYSCALL(fchmod)(long long fd_, long long mode_) { /* Nothing to do */ } 1099POST_SYSCALL(fchmod)(long long res, long long fd_, long long mode_) { 1100 /* Nothing to do */ 1101} 1102PRE_SYSCALL(compat_43_orecvfrom) 1103(long long s_, void *buf_, long long len_, long long flags_, void *from_, 1104 void *fromlenaddr_) { 1105 /* TODO */ 1106} 1107POST_SYSCALL(compat_43_orecvfrom) 1108(long long res, long long s_, void *buf_, long long len_, long long flags_, 1109 void *from_, void *fromlenaddr_) { 1110 /* TODO */ 1111} 1112PRE_SYSCALL(setreuid)(long long ruid_, long long euid_) { /* Nothing to do */ } 1113POST_SYSCALL(setreuid)(long long res, long long ruid_, long long euid_) { 1114 /* Nothing to do */ 1115} 1116PRE_SYSCALL(setregid)(long long rgid_, long long egid_) { /* Nothing to do */ } 1117POST_SYSCALL(setregid)(long long res, long long rgid_, long long egid_) { 1118 /* Nothing to do */ 1119} 1120PRE_SYSCALL(rename)(void *from_, void *to_) { 1121 const char *from = (const char *)from_; 1122 const char *to = (const char *)to_; 1123 if (from) { 1124 PRE_READ(from, __sanitizer::internal_strlen(from) + 1); 1125 } 1126 if (to) { 1127 PRE_READ(to, __sanitizer::internal_strlen(to) + 1); 1128 } 1129} 1130POST_SYSCALL(rename)(long long res, void *from_, void *to_) { 1131 if (res == 0) { 1132 const char *from = (const char *)from_; 1133 const char *to = (const char *)to_; 1134 if (from) { 1135 POST_READ(from, __sanitizer::internal_strlen(from) + 1); 1136 } 1137 if (to) { 1138 POST_READ(to, __sanitizer::internal_strlen(to) + 1); 1139 } 1140 } 1141} 1142PRE_SYSCALL(compat_43_otruncate)(void *path_, long long length_) { /* TODO */ } 1143POST_SYSCALL(compat_43_otruncate) 1144(long long res, void *path_, long long length_) { 1145 /* TODO */ 1146} 1147PRE_SYSCALL(compat_43_oftruncate)(long long fd_, long long length_) { 1148 /* TODO */ 1149} 1150POST_SYSCALL(compat_43_oftruncate) 1151(long long res, long long fd_, long long length_) { 1152 /* TODO */ 1153} 1154PRE_SYSCALL(flock)(long long fd_, long long how_) { /* Nothing to do */ } 1155POST_SYSCALL(flock)(long long res, long long fd_, long long how_) { 1156 /* Nothing to do */ 1157} 1158PRE_SYSCALL(mkfifo)(void *path_, long long mode_) { 1159 const char *path = (const char *)path_; 1160 if (path) { 1161 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 1162 } 1163} 1164POST_SYSCALL(mkfifo)(long long res, void *path_, long long mode_) { 1165 if (res == 0) { 1166 const char *path = (const char *)path_; 1167 if (path) { 1168 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 1169 } 1170 } 1171} 1172PRE_SYSCALL(sendto) 1173(long long s_, void *buf_, long long len_, long long flags_, void *to_, 1174 long long tolen_) { 1175 PRE_READ(buf_, len_); 1176 PRE_READ(to_, tolen_); 1177} 1178POST_SYSCALL(sendto) 1179(long long res, long long s_, void *buf_, long long len_, long long flags_, 1180 void *to_, long long tolen_) { 1181 if (res >= 0) { 1182 POST_READ(buf_, len_); 1183 POST_READ(to_, tolen_); 1184 } 1185} 1186PRE_SYSCALL(shutdown)(long long s_, long long how_) { /* Nothing to do */ } 1187POST_SYSCALL(shutdown)(long long res, long long s_, long long how_) { 1188 /* Nothing to do */ 1189} 1190PRE_SYSCALL(socketpair) 1191(long long domain_, long long type_, long long protocol_, void *rsv_) { 1192 PRE_WRITE(rsv_, 2 * sizeof(int)); 1193} 1194POST_SYSCALL(socketpair) 1195(long long res, long long domain_, long long type_, long long protocol_, 1196 void *rsv_) { 1197 if (res == 0) { 1198 POST_WRITE(rsv_, 2 * sizeof(int)); 1199 } 1200} 1201PRE_SYSCALL(mkdir)(void *path_, long long mode_) { 1202 const char *path = (const char *)path_; 1203 if (path) { 1204 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 1205 } 1206} 1207POST_SYSCALL(mkdir)(long long res, void *path_, long long mode_) { 1208 if (res == 0) { 1209 const char *path = (const char *)path_; 1210 if (path) { 1211 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 1212 } 1213 } 1214} 1215PRE_SYSCALL(rmdir)(void *path_) { 1216 const char *path = (const char *)path_; 1217 if (path) { 1218 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 1219 } 1220} 1221POST_SYSCALL(rmdir)(long long res, void *path_) { 1222 if (res == 0) { 1223 const char *path = (const char *)path_; 1224 if (path) { 1225 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 1226 } 1227 } 1228} 1229PRE_SYSCALL(compat_50_utimes)(void *path_, void *tptr_) { /* TODO */ } 1230POST_SYSCALL(compat_50_utimes)(long long res, void *path_, void *tptr_) { 1231 /* TODO */ 1232} 1233/* syscall 139 has been skipped */ 1234PRE_SYSCALL(compat_50_adjtime)(void *delta_, void *olddelta_) { /* TODO */ } 1235POST_SYSCALL(compat_50_adjtime)(long long res, void *delta_, void *olddelta_) { 1236 /* TODO */ 1237} 1238PRE_SYSCALL(compat_43_ogetpeername)(long long fdes_, void *asa_, void *alen_) { 1239 /* TODO */ 1240} 1241POST_SYSCALL(compat_43_ogetpeername) 1242(long long res, long long fdes_, void *asa_, void *alen_) { 1243 /* TODO */ 1244} 1245PRE_SYSCALL(compat_43_ogethostid)(void) { /* TODO */ } 1246POST_SYSCALL(compat_43_ogethostid)(long long res) { /* TODO */ } 1247PRE_SYSCALL(compat_43_osethostid)(long long hostid_) { /* TODO */ } 1248POST_SYSCALL(compat_43_osethostid)(long long res, long long hostid_) { 1249 /* TODO */ 1250} 1251PRE_SYSCALL(compat_43_ogetrlimit)(long long which_, void *rlp_) { /* TODO */ } 1252POST_SYSCALL(compat_43_ogetrlimit) 1253(long long res, long long which_, void *rlp_) { 1254 /* TODO */ 1255} 1256PRE_SYSCALL(compat_43_osetrlimit)(long long which_, void *rlp_) { /* TODO */ } 1257POST_SYSCALL(compat_43_osetrlimit) 1258(long long res, long long which_, void *rlp_) { 1259 /* TODO */ 1260} 1261PRE_SYSCALL(compat_43_okillpg)(long long pgid_, long long signum_) { 1262 /* TODO */ 1263} 1264POST_SYSCALL(compat_43_okillpg) 1265(long long res, long long pgid_, long long signum_) { 1266 /* TODO */ 1267} 1268PRE_SYSCALL(setsid)(void) { /* Nothing to do */ } 1269POST_SYSCALL(setsid)(long long res) { /* Nothing to do */ } 1270PRE_SYSCALL(compat_50_quotactl) 1271(void *path_, long long cmd_, long long uid_, void *arg_) { 1272 /* TODO */ 1273} 1274POST_SYSCALL(compat_50_quotactl) 1275(long long res, void *path_, long long cmd_, long long uid_, void *arg_) { 1276 /* TODO */ 1277} 1278PRE_SYSCALL(compat_43_oquota)(void) { /* TODO */ } 1279POST_SYSCALL(compat_43_oquota)(long long res) { /* TODO */ } 1280PRE_SYSCALL(compat_43_ogetsockname)(long long fdec_, void *asa_, void *alen_) { 1281 /* TODO */ 1282} 1283POST_SYSCALL(compat_43_ogetsockname) 1284(long long res, long long fdec_, void *asa_, void *alen_) { 1285 /* TODO */ 1286} 1287/* syscall 151 has been skipped */ 1288/* syscall 152 has been skipped */ 1289/* syscall 153 has been skipped */ 1290/* syscall 154 has been skipped */ 1291PRE_SYSCALL(nfssvc)(long long flag_, void *argp_) { /* Nothing to do */ } 1292POST_SYSCALL(nfssvc)(long long res, long long flag_, void *argp_) { 1293 /* Nothing to do */ 1294} 1295PRE_SYSCALL(compat_43_ogetdirentries) 1296(long long fd_, void *buf_, long long count_, void *basep_) { 1297 /* TODO */ 1298} 1299POST_SYSCALL(compat_43_ogetdirentries) 1300(long long res, long long fd_, void *buf_, long long count_, void *basep_) { 1301 /* TODO */ 1302} 1303PRE_SYSCALL(compat_20_statfs)(void *path_, void *buf_) { /* TODO */ } 1304POST_SYSCALL(compat_20_statfs)(long long res, void *path_, void *buf_) { 1305 /* TODO */ 1306} 1307PRE_SYSCALL(compat_20_fstatfs)(long long fd_, void *buf_) { /* TODO */ } 1308POST_SYSCALL(compat_20_fstatfs)(long long res, long long fd_, void *buf_) { 1309 /* TODO */ 1310} 1311/* syscall 159 has been skipped */ 1312/* syscall 160 has been skipped */ 1313PRE_SYSCALL(compat_30_getfh)(void *fname_, void *fhp_) { /* TODO */ } 1314POST_SYSCALL(compat_30_getfh)(long long res, void *fname_, void *fhp_) { 1315 /* TODO */ 1316} 1317PRE_SYSCALL(compat_09_ogetdomainname)(void *domainname_, long long len_) { 1318 /* TODO */ 1319} 1320POST_SYSCALL(compat_09_ogetdomainname) 1321(long long res, void *domainname_, long long len_) { 1322 /* TODO */ 1323} 1324PRE_SYSCALL(compat_09_osetdomainname)(void *domainname_, long long len_) { 1325 /* TODO */ 1326} 1327POST_SYSCALL(compat_09_osetdomainname) 1328(long long res, void *domainname_, long long len_) { 1329 /* TODO */ 1330} 1331PRE_SYSCALL(compat_09_ouname)(void *name_) { /* TODO */ } 1332POST_SYSCALL(compat_09_ouname)(long long res, void *name_) { /* TODO */ } 1333PRE_SYSCALL(sysarch)(long long op_, void *parms_) { /* TODO */ } 1334POST_SYSCALL(sysarch)(long long res, long long op_, void *parms_) { /* TODO */ } 1335/* syscall 166 has been skipped */ 1336/* syscall 167 has been skipped */ 1337/* syscall 168 has been skipped */ 1338#if !defined(_LP64) 1339PRE_SYSCALL(compat_10_osemsys) 1340(long long which_, long long a2_, long long a3_, long long a4_, long long a5_) { 1341 /* TODO */ 1342} 1343POST_SYSCALL(compat_10_osemsys) 1344(long long res, long long which_, long long a2_, long long a3_, long long a4_, 1345 long long a5_) { 1346 /* TODO */ 1347} 1348#else 1349/* syscall 169 has been skipped */ 1350#endif 1351#if !defined(_LP64) 1352PRE_SYSCALL(compat_10_omsgsys) 1353(long long which_, long long a2_, long long a3_, long long a4_, long long a5_, 1354 long long a6_) { 1355 /* TODO */ 1356} 1357POST_SYSCALL(compat_10_omsgsys) 1358(long long res, long long which_, long long a2_, long long a3_, long long a4_, 1359 long long a5_, long long a6_) { 1360 /* TODO */ 1361} 1362#else 1363/* syscall 170 has been skipped */ 1364#endif 1365#if !defined(_LP64) 1366PRE_SYSCALL(compat_10_oshmsys) 1367(long long which_, long long a2_, long long a3_, long long a4_) { 1368 /* TODO */ 1369} 1370POST_SYSCALL(compat_10_oshmsys) 1371(long long res, long long which_, long long a2_, long long a3_, long long a4_) { 1372 /* TODO */ 1373} 1374#else 1375/* syscall 171 has been skipped */ 1376#endif 1377/* syscall 172 has been skipped */ 1378PRE_SYSCALL(pread) 1379(long long fd_, void *buf_, long long nbyte_, long long PAD_, 1380 long long offset_) { 1381 if (buf_) { 1382 PRE_WRITE(buf_, nbyte_); 1383 } 1384} 1385POST_SYSCALL(pread) 1386(long long res, long long fd_, void *buf_, long long nbyte_, long long PAD_, 1387 long long offset_) { 1388 if (res > 0) { 1389 POST_WRITE(buf_, res); 1390 } 1391} 1392PRE_SYSCALL(pwrite) 1393(long long fd_, void *buf_, long long nbyte_, long long PAD_, 1394 long long offset_) { 1395 if (buf_) { 1396 PRE_READ(buf_, nbyte_); 1397 } 1398} 1399POST_SYSCALL(pwrite) 1400(long long res, long long fd_, void *buf_, long long nbyte_, long long PAD_, 1401 long long offset_) { 1402 if (res > 0) { 1403 POST_READ(buf_, res); 1404 } 1405} 1406PRE_SYSCALL(compat_30_ntp_gettime)(void *ntvp_) { /* TODO */ } 1407POST_SYSCALL(compat_30_ntp_gettime)(long long res, void *ntvp_) { /* TODO */ } 1408#if defined(NTP) || !defined(_KERNEL_OPT) 1409PRE_SYSCALL(ntp_adjtime)(void *tp_) { /* Nothing to do */ } 1410POST_SYSCALL(ntp_adjtime)(long long res, void *tp_) { /* Nothing to do */ } 1411#else 1412/* syscall 176 has been skipped */ 1413#endif 1414/* syscall 177 has been skipped */ 1415/* syscall 178 has been skipped */ 1416/* syscall 179 has been skipped */ 1417/* syscall 180 has been skipped */ 1418PRE_SYSCALL(setgid)(long long gid_) { /* Nothing to do */ } 1419POST_SYSCALL(setgid)(long long res, long long gid_) { /* Nothing to do */ } 1420PRE_SYSCALL(setegid)(long long egid_) { /* Nothing to do */ } 1421POST_SYSCALL(setegid)(long long res, long long egid_) { /* Nothing to do */ } 1422PRE_SYSCALL(seteuid)(long long euid_) { /* Nothing to do */ } 1423POST_SYSCALL(seteuid)(long long res, long long euid_) { /* Nothing to do */ } 1424PRE_SYSCALL(lfs_bmapv)(void *fsidp_, void *blkiov_, long long blkcnt_) { 1425 /* TODO */ 1426} 1427POST_SYSCALL(lfs_bmapv) 1428(long long res, void *fsidp_, void *blkiov_, long long blkcnt_) { 1429 /* TODO */ 1430} 1431PRE_SYSCALL(lfs_markv)(void *fsidp_, void *blkiov_, long long blkcnt_) { 1432 /* TODO */ 1433} 1434POST_SYSCALL(lfs_markv) 1435(long long res, void *fsidp_, void *blkiov_, long long blkcnt_) { 1436 /* TODO */ 1437} 1438PRE_SYSCALL(lfs_segclean)(void *fsidp_, long long segment_) { /* TODO */ } 1439POST_SYSCALL(lfs_segclean)(long long res, void *fsidp_, long long segment_) { 1440 /* TODO */ 1441} 1442PRE_SYSCALL(compat_50_lfs_segwait)(void *fsidp_, void *tv_) { /* TODO */ } 1443POST_SYSCALL(compat_50_lfs_segwait)(long long res, void *fsidp_, void *tv_) { 1444 /* TODO */ 1445} 1446PRE_SYSCALL(compat_12_stat12)(void *path_, void *ub_) { /* TODO */ } 1447POST_SYSCALL(compat_12_stat12)(long long res, void *path_, void *ub_) { 1448 /* TODO */ 1449} 1450PRE_SYSCALL(compat_12_fstat12)(long long fd_, void *sb_) { /* TODO */ } 1451POST_SYSCALL(compat_12_fstat12)(long long res, long long fd_, void *sb_) { 1452 /* TODO */ 1453} 1454PRE_SYSCALL(compat_12_lstat12)(void *path_, void *ub_) { /* TODO */ } 1455POST_SYSCALL(compat_12_lstat12)(long long res, void *path_, void *ub_) { 1456 /* TODO */ 1457} 1458PRE_SYSCALL(pathconf)(void *path_, long long name_) { 1459 const char *path = (const char *)path_; 1460 if (path) { 1461 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 1462 } 1463} 1464POST_SYSCALL(pathconf)(long long res, void *path_, long long name_) { 1465 if (res != -1) { 1466 const char *path = (const char *)path_; 1467 if (path) { 1468 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 1469 } 1470 } 1471} 1472PRE_SYSCALL(fpathconf)(long long fd_, long long name_) { /* Nothing to do */ } 1473POST_SYSCALL(fpathconf)(long long res, long long fd_, long long name_) { 1474 /* Nothing to do */ 1475} 1476PRE_SYSCALL(getsockopt2) 1477(long long s_, long long level_, long long name_, void *val_, void *avalsize_) { 1478 /* TODO */ 1479} 1480POST_SYSCALL(getsockopt2) 1481(long long res, long long s_, long long level_, long long name_, void *val_, 1482 void *avalsize_) { 1483 /* TODO */ 1484} 1485PRE_SYSCALL(getrlimit)(long long which_, void *rlp_) { 1486 PRE_WRITE(rlp_, struct_rlimit_sz); 1487} 1488POST_SYSCALL(getrlimit)(long long res, long long which_, void *rlp_) { 1489 if (res == 0) { 1490 POST_WRITE(rlp_, struct_rlimit_sz); 1491 } 1492} 1493PRE_SYSCALL(setrlimit)(long long which_, void *rlp_) { 1494 PRE_READ(rlp_, struct_rlimit_sz); 1495} 1496POST_SYSCALL(setrlimit)(long long res, long long which_, void *rlp_) { 1497 if (res == 0) { 1498 POST_READ(rlp_, struct_rlimit_sz); 1499 } 1500} 1501PRE_SYSCALL(compat_12_getdirentries) 1502(long long fd_, void *buf_, long long count_, void *basep_) { 1503 /* TODO */ 1504} 1505POST_SYSCALL(compat_12_getdirentries) 1506(long long res, long long fd_, void *buf_, long long count_, void *basep_) { 1507 /* TODO */ 1508} 1509PRE_SYSCALL(mmap) 1510(void *addr_, long long len_, long long prot_, long long flags_, long long fd_, 1511 long long PAD_, long long pos_) { 1512 /* Nothing to do */ 1513} 1514POST_SYSCALL(mmap) 1515(long long res, void *addr_, long long len_, long long prot_, long long flags_, 1516 long long fd_, long long PAD_, long long pos_) { 1517 /* Nothing to do */ 1518} 1519PRE_SYSCALL(__syscall)(long long code_, long long args_[SYS_MAXSYSARGS]) { 1520 /* Nothing to do */ 1521} 1522POST_SYSCALL(__syscall) 1523(long long res, long long code_, long long args_[SYS_MAXSYSARGS]) { 1524 /* Nothing to do */ 1525} 1526PRE_SYSCALL(lseek) 1527(long long fd_, long long PAD_, long long offset_, long long whence_) { 1528 /* Nothing to do */ 1529} 1530POST_SYSCALL(lseek) 1531(long long res, long long fd_, long long PAD_, long long offset_, 1532 long long whence_) { 1533 /* Nothing to do */ 1534} 1535PRE_SYSCALL(truncate)(void *path_, long long PAD_, long long length_) { 1536 const char *path = (const char *)path_; 1537 if (path) { 1538 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 1539 } 1540} 1541POST_SYSCALL(truncate) 1542(long long res, void *path_, long long PAD_, long long length_) { 1543 if (res == 0) { 1544 const char *path = (const char *)path_; 1545 if (path) { 1546 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 1547 } 1548 } 1549} 1550PRE_SYSCALL(ftruncate)(long long fd_, long long PAD_, long long length_) { 1551 /* Nothing to do */ 1552} 1553POST_SYSCALL(ftruncate) 1554(long long res, long long fd_, long long PAD_, long long length_) { 1555 /* Nothing to do */ 1556} 1557PRE_SYSCALL(__sysctl) 1558(void *name_, long long namelen_, void *oldv_, void *oldlenp_, void *newv_, 1559 long long newlen_) { 1560 const int *name = (const int *)name_; 1561 if (name) { 1562 PRE_READ(name, namelen_ * sizeof(*name)); 1563 } 1564 if (newv_) { 1565 PRE_READ(name, newlen_); 1566 } 1567} 1568POST_SYSCALL(__sysctl) 1569(long long res, void *name_, long long namelen_, void *oldv_, void *oldlenp_, 1570 void *newv_, long long newlen_) { 1571 if (res == 0) { 1572 const int *name = (const int *)name_; 1573 if (name) { 1574 POST_READ(name, namelen_ * sizeof(*name)); 1575 } 1576 if (newv_) { 1577 POST_READ(name, newlen_); 1578 } 1579 } 1580} 1581PRE_SYSCALL(mlock)(void *addr_, long long len_) { /* Nothing to do */ } 1582POST_SYSCALL(mlock)(long long res, void *addr_, long long len_) { 1583 /* Nothing to do */ 1584} 1585PRE_SYSCALL(munlock)(void *addr_, long long len_) { /* Nothing to do */ } 1586POST_SYSCALL(munlock)(long long res, void *addr_, long long len_) { 1587 /* Nothing to do */ 1588} 1589PRE_SYSCALL(undelete)(void *path_) { 1590 const char *path = (const char *)path_; 1591 if (path) { 1592 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 1593 } 1594} 1595POST_SYSCALL(undelete)(long long res, void *path_) { 1596 if (res == 0) { 1597 const char *path = (const char *)path_; 1598 if (path) { 1599 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 1600 } 1601 } 1602} 1603PRE_SYSCALL(compat_50_futimes)(long long fd_, void *tptr_) { /* TODO */ } 1604POST_SYSCALL(compat_50_futimes)(long long res, long long fd_, void *tptr_) { 1605 /* TODO */ 1606} 1607PRE_SYSCALL(getpgid)(long long pid_) { /* Nothing to do */ } 1608POST_SYSCALL(getpgid)(long long res, long long pid_) { /* Nothing to do */ } 1609PRE_SYSCALL(reboot)(long long opt_, void *bootstr_) { 1610 const char *bootstr = (const char *)bootstr_; 1611 if (bootstr) { 1612 PRE_READ(bootstr, __sanitizer::internal_strlen(bootstr) + 1); 1613 } 1614} 1615POST_SYSCALL(reboot)(long long res, long long opt_, void *bootstr_) { 1616 /* This call should never return */ 1617 const char *bootstr = (const char *)bootstr_; 1618 if (bootstr) { 1619 POST_READ(bootstr, __sanitizer::internal_strlen(bootstr) + 1); 1620 } 1621} 1622PRE_SYSCALL(poll)(void *fds_, long long nfds_, long long timeout_) { 1623 /* Nothing to do */ 1624} 1625POST_SYSCALL(poll) 1626(long long res, void *fds_, long long nfds_, long long timeout_) { 1627 /* Nothing to do */ 1628} 1629PRE_SYSCALL(afssys) 1630(long long id_, long long a1_, long long a2_, long long a3_, long long a4_, 1631 long long a5_, long long a6_) { 1632 /* TODO */ 1633} 1634POST_SYSCALL(afssys) 1635(long long res, long long id_, long long a1_, long long a2_, long long a3_, 1636 long long a4_, long long a5_, long long a6_) { 1637 /* TODO */ 1638} 1639/* syscall 211 has been skipped */ 1640/* syscall 212 has been skipped */ 1641/* syscall 213 has been skipped */ 1642/* syscall 214 has been skipped */ 1643/* syscall 215 has been skipped */ 1644/* syscall 216 has been skipped */ 1645/* syscall 217 has been skipped */ 1646/* syscall 218 has been skipped */ 1647/* syscall 219 has been skipped */ 1648PRE_SYSCALL(compat_14___semctl) 1649(long long semid_, long long semnum_, long long cmd_, void *arg_) { 1650 /* TODO */ 1651} 1652POST_SYSCALL(compat_14___semctl) 1653(long long res, long long semid_, long long semnum_, long long cmd_, 1654 void *arg_) { 1655 /* TODO */ 1656} 1657PRE_SYSCALL(semget)(long long key_, long long nsems_, long long semflg_) { 1658 /* Nothing to do */ 1659} 1660POST_SYSCALL(semget) 1661(long long res, long long key_, long long nsems_, long long semflg_) { 1662 /* Nothing to do */ 1663} 1664PRE_SYSCALL(semop)(long long semid_, void *sops_, long long nsops_) { 1665 if (sops_) { 1666 PRE_READ(sops_, nsops_ * struct_sembuf_sz); 1667 } 1668} 1669POST_SYSCALL(semop) 1670(long long res, long long semid_, void *sops_, long long nsops_) { 1671 if (res == 0) { 1672 if (sops_) { 1673 POST_READ(sops_, nsops_ * struct_sembuf_sz); 1674 } 1675 } 1676} 1677PRE_SYSCALL(semconfig)(long long flag_) { /* Nothing to do */ } 1678POST_SYSCALL(semconfig)(long long res, long long flag_) { /* Nothing to do */ } 1679PRE_SYSCALL(compat_14_msgctl)(long long msqid_, long long cmd_, void *buf_) { 1680 /* TODO */ 1681} 1682POST_SYSCALL(compat_14_msgctl) 1683(long long res, long long msqid_, long long cmd_, void *buf_) { 1684 /* TODO */ 1685} 1686PRE_SYSCALL(msgget)(long long key_, long long msgflg_) { /* Nothing to do */ } 1687POST_SYSCALL(msgget)(long long res, long long key_, long long msgflg_) { 1688 /* Nothing to do */ 1689} 1690PRE_SYSCALL(msgsnd) 1691(long long msqid_, void *msgp_, long long msgsz_, long long msgflg_) { 1692 if (msgp_) { 1693 PRE_READ(msgp_, msgsz_); 1694 } 1695} 1696POST_SYSCALL(msgsnd) 1697(long long res, long long msqid_, void *msgp_, long long msgsz_, 1698 long long msgflg_) { 1699 if (res == 0) { 1700 if (msgp_) { 1701 POST_READ(msgp_, msgsz_); 1702 } 1703 } 1704} 1705PRE_SYSCALL(msgrcv) 1706(long long msqid_, void *msgp_, long long msgsz_, long long msgtyp_, 1707 long long msgflg_) { 1708 /* Nothing to do */ 1709} 1710POST_SYSCALL(msgrcv) 1711(long long res, long long msqid_, void *msgp_, long long msgsz_, 1712 long long msgtyp_, long long msgflg_) { 1713 /* Nothing to do */ 1714} 1715PRE_SYSCALL(shmat)(long long shmid_, void *shmaddr_, long long shmflg_) { 1716 /* Nothing to do */ 1717} 1718POST_SYSCALL(shmat) 1719(long long res, long long shmid_, void *shmaddr_, long long shmflg_) { 1720 /* Nothing to do */ 1721} 1722PRE_SYSCALL(compat_14_shmctl)(long long shmid_, long long cmd_, void *buf_) { 1723 /* TODO */ 1724} 1725POST_SYSCALL(compat_14_shmctl) 1726(long long res, long long shmid_, long long cmd_, void *buf_) { 1727 /* TODO */ 1728} 1729PRE_SYSCALL(shmdt)(void *shmaddr_) { /* Nothing to do */ } 1730POST_SYSCALL(shmdt)(long long res, void *shmaddr_) { /* Nothing to do */ } 1731PRE_SYSCALL(shmget)(long long key_, long long size_, long long shmflg_) { 1732 /* Nothing to do */ 1733} 1734POST_SYSCALL(shmget) 1735(long long res, long long key_, long long size_, long long shmflg_) { 1736 /* Nothing to do */ 1737} 1738PRE_SYSCALL(compat_50_clock_gettime)(long long clock_id_, void *tp_) { 1739 /* TODO */ 1740} 1741POST_SYSCALL(compat_50_clock_gettime) 1742(long long res, long long clock_id_, void *tp_) { 1743 /* TODO */ 1744} 1745PRE_SYSCALL(compat_50_clock_settime)(long long clock_id_, void *tp_) { 1746 /* TODO */ 1747} 1748POST_SYSCALL(compat_50_clock_settime) 1749(long long res, long long clock_id_, void *tp_) { 1750 /* TODO */ 1751} 1752PRE_SYSCALL(compat_50_clock_getres)(long long clock_id_, void *tp_) { 1753 /* TODO */ 1754} 1755POST_SYSCALL(compat_50_clock_getres) 1756(long long res, long long clock_id_, void *tp_) { 1757 /* TODO */ 1758} 1759PRE_SYSCALL(timer_create)(long long clock_id_, void *evp_, void *timerid_) { 1760 /* Nothing to do */ 1761} 1762POST_SYSCALL(timer_create) 1763(long long res, long long clock_id_, void *evp_, void *timerid_) { 1764 /* Nothing to do */ 1765} 1766PRE_SYSCALL(timer_delete)(long long timerid_) { /* Nothing to do */ } 1767POST_SYSCALL(timer_delete)(long long res, long long timerid_) { 1768 /* Nothing to do */ 1769} 1770PRE_SYSCALL(compat_50_timer_settime) 1771(long long timerid_, long long flags_, void *value_, void *ovalue_) { 1772 /* TODO */ 1773} 1774POST_SYSCALL(compat_50_timer_settime) 1775(long long res, long long timerid_, long long flags_, void *value_, 1776 void *ovalue_) { 1777 /* TODO */ 1778} 1779PRE_SYSCALL(compat_50_timer_gettime)(long long timerid_, void *value_) { 1780 /* TODO */ 1781} 1782POST_SYSCALL(compat_50_timer_gettime) 1783(long long res, long long timerid_, void *value_) { 1784 /* TODO */ 1785} 1786PRE_SYSCALL(timer_getoverrun)(long long timerid_) { /* Nothing to do */ } 1787POST_SYSCALL(timer_getoverrun)(long long res, long long timerid_) { 1788 /* Nothing to do */ 1789} 1790PRE_SYSCALL(compat_50_nanosleep)(void *rqtp_, void *rmtp_) { /* TODO */ } 1791POST_SYSCALL(compat_50_nanosleep)(long long res, void *rqtp_, void *rmtp_) { 1792 /* TODO */ 1793} 1794PRE_SYSCALL(fdatasync)(long long fd_) { /* Nothing to do */ } 1795POST_SYSCALL(fdatasync)(long long res, long long fd_) { /* Nothing to do */ } 1796PRE_SYSCALL(mlockall)(long long flags_) { /* Nothing to do */ } 1797POST_SYSCALL(mlockall)(long long res, long long flags_) { /* Nothing to do */ } 1798PRE_SYSCALL(munlockall)(void) { /* Nothing to do */ } 1799POST_SYSCALL(munlockall)(long long res) { /* Nothing to do */ } 1800PRE_SYSCALL(compat_50___sigtimedwait)(void *set_, void *info_, void *timeout_) { 1801 /* TODO */ 1802} 1803POST_SYSCALL(compat_50___sigtimedwait) 1804(long long res, void *set_, void *info_, void *timeout_) { 1805 /* TODO */ 1806} 1807PRE_SYSCALL(sigqueueinfo)(long long pid_, void *info_) { 1808 if (info_) { 1809 PRE_READ(info_, siginfo_t_sz); 1810 } 1811} 1812POST_SYSCALL(sigqueueinfo)(long long res, long long pid_, void *info_) {} 1813PRE_SYSCALL(modctl)(long long cmd_, void *arg_) { /* TODO */ } 1814POST_SYSCALL(modctl)(long long res, long long cmd_, void *arg_) { /* TODO */ } 1815PRE_SYSCALL(_ksem_init)(long long value_, void *idp_) { /* Nothing to do */ } 1816POST_SYSCALL(_ksem_init)(long long res, long long value_, void *idp_) { 1817 /* Nothing to do */ 1818} 1819PRE_SYSCALL(_ksem_open) 1820(void *name_, long long oflag_, long long mode_, long long value_, void *idp_) { 1821 const char *name = (const char *)name_; 1822 if (name) { 1823 PRE_READ(name, __sanitizer::internal_strlen(name) + 1); 1824 } 1825} 1826POST_SYSCALL(_ksem_open) 1827(long long res, void *name_, long long oflag_, long long mode_, 1828 long long value_, void *idp_) { 1829 const char *name = (const char *)name_; 1830 if (name) { 1831 POST_READ(name, __sanitizer::internal_strlen(name) + 1); 1832 } 1833} 1834PRE_SYSCALL(_ksem_unlink)(void *name_) { 1835 const char *name = (const char *)name_; 1836 if (name) { 1837 PRE_READ(name, __sanitizer::internal_strlen(name) + 1); 1838 } 1839} 1840POST_SYSCALL(_ksem_unlink)(long long res, void *name_) { 1841 const char *name = (const char *)name_; 1842 if (name) { 1843 POST_READ(name, __sanitizer::internal_strlen(name) + 1); 1844 } 1845} 1846PRE_SYSCALL(_ksem_close)(long long id_) { /* Nothing to do */ } 1847POST_SYSCALL(_ksem_close)(long long res, long long id_) { /* Nothing to do */ } 1848PRE_SYSCALL(_ksem_post)(long long id_) { /* Nothing to do */ } 1849POST_SYSCALL(_ksem_post)(long long res, long long id_) { /* Nothing to do */ } 1850PRE_SYSCALL(_ksem_wait)(long long id_) { /* Nothing to do */ } 1851POST_SYSCALL(_ksem_wait)(long long res, long long id_) { /* Nothing to do */ } 1852PRE_SYSCALL(_ksem_trywait)(long long id_) { /* Nothing to do */ } 1853POST_SYSCALL(_ksem_trywait)(long long res, long long id_) { 1854 /* Nothing to do */ 1855} 1856PRE_SYSCALL(_ksem_getvalue)(long long id_, void *value_) { /* Nothing to do */ } 1857POST_SYSCALL(_ksem_getvalue)(long long res, long long id_, void *value_) { 1858 /* Nothing to do */ 1859} 1860PRE_SYSCALL(_ksem_destroy)(long long id_) { /* Nothing to do */ } 1861POST_SYSCALL(_ksem_destroy)(long long res, long long id_) { 1862 /* Nothing to do */ 1863} 1864PRE_SYSCALL(_ksem_timedwait)(long long id_, void *abstime_) { 1865 if (abstime_) { 1866 PRE_READ(abstime_, struct_timespec_sz); 1867 } 1868} 1869POST_SYSCALL(_ksem_timedwait)(long long res, long long id_, void *abstime_) {} 1870PRE_SYSCALL(mq_open) 1871(void *name_, long long oflag_, long long mode_, void *attr_) { 1872 const char *name = (const char *)name_; 1873 if (name) { 1874 PRE_READ(name, __sanitizer::internal_strlen(name) + 1); 1875 } 1876} 1877POST_SYSCALL(mq_open) 1878(long long res, void *name_, long long oflag_, long long mode_, void *attr_) { 1879 const char *name = (const char *)name_; 1880 if (name) { 1881 POST_READ(name, __sanitizer::internal_strlen(name) + 1); 1882 } 1883} 1884PRE_SYSCALL(mq_close)(long long mqdes_) { /* Nothing to do */ } 1885POST_SYSCALL(mq_close)(long long res, long long mqdes_) { /* Nothing to do */ } 1886PRE_SYSCALL(mq_unlink)(void *name_) { 1887 const char *name = (const char *)name_; 1888 if (name) { 1889 PRE_READ(name, __sanitizer::internal_strlen(name) + 1); 1890 } 1891} 1892POST_SYSCALL(mq_unlink)(long long res, void *name_) { 1893 const char *name = (const char *)name_; 1894 if (name) { 1895 POST_READ(name, __sanitizer::internal_strlen(name) + 1); 1896 } 1897} 1898PRE_SYSCALL(mq_getattr)(long long mqdes_, void *mqstat_) { /* Nothing to do */ } 1899POST_SYSCALL(mq_getattr)(long long res, long long mqdes_, void *mqstat_) { 1900 /* Nothing to do */ 1901} 1902PRE_SYSCALL(mq_setattr)(long long mqdes_, void *mqstat_, void *omqstat_) { 1903 if (mqstat_) { 1904 PRE_READ(mqstat_, struct_mq_attr_sz); 1905 } 1906} 1907POST_SYSCALL(mq_setattr) 1908(long long res, long long mqdes_, void *mqstat_, void *omqstat_) {} 1909PRE_SYSCALL(mq_notify)(long long mqdes_, void *notification_) { 1910 if (notification_) { 1911 PRE_READ(notification_, struct_sigevent_sz); 1912 } 1913} 1914POST_SYSCALL(mq_notify)(long long res, long long mqdes_, void *notification_) {} 1915PRE_SYSCALL(mq_send) 1916(long long mqdes_, void *msg_ptr_, long long msg_len_, long long msg_prio_) { 1917 if (msg_ptr_) { 1918 PRE_READ(msg_ptr_, msg_len_); 1919 } 1920} 1921POST_SYSCALL(mq_send) 1922(long long res, long long mqdes_, void *msg_ptr_, long long msg_len_, 1923 long long msg_prio_) {} 1924PRE_SYSCALL(mq_receive) 1925(long long mqdes_, void *msg_ptr_, long long msg_len_, void *msg_prio_) { 1926 /* Nothing to do */ 1927} 1928POST_SYSCALL(mq_receive) 1929(long long res, long long mqdes_, void *msg_ptr_, long long msg_len_, 1930 void *msg_prio_) { 1931 /* Nothing to do */ 1932} 1933PRE_SYSCALL(compat_50_mq_timedsend) 1934(long long mqdes_, void *msg_ptr_, long long msg_len_, long long msg_prio_, 1935 void *abs_timeout_) { 1936 /* TODO */ 1937} 1938POST_SYSCALL(compat_50_mq_timedsend) 1939(long long res, long long mqdes_, void *msg_ptr_, long long msg_len_, 1940 long long msg_prio_, void *abs_timeout_) { 1941 /* TODO */ 1942} 1943PRE_SYSCALL(compat_50_mq_timedreceive) 1944(long long mqdes_, void *msg_ptr_, long long msg_len_, void *msg_prio_, 1945 void *abs_timeout_) { 1946 /* TODO */ 1947} 1948POST_SYSCALL(compat_50_mq_timedreceive) 1949(long long res, long long mqdes_, void *msg_ptr_, long long msg_len_, 1950 void *msg_prio_, void *abs_timeout_) { 1951 /* TODO */ 1952} 1953/* syscall 267 has been skipped */ 1954/* syscall 268 has been skipped */ 1955/* syscall 269 has been skipped */ 1956PRE_SYSCALL(__posix_rename)(void *from_, void *to_) { 1957 const char *from = (const char *)from_; 1958 const char *to = (const char *)to_; 1959 if (from_) { 1960 PRE_READ(from, __sanitizer::internal_strlen(from) + 1); 1961 } 1962 if (to) { 1963 PRE_READ(to, __sanitizer::internal_strlen(to) + 1); 1964 } 1965} 1966POST_SYSCALL(__posix_rename)(long long res, void *from_, void *to_) { 1967 const char *from = (const char *)from_; 1968 const char *to = (const char *)to_; 1969 if (from) { 1970 POST_READ(from, __sanitizer::internal_strlen(from) + 1); 1971 } 1972 if (to) { 1973 POST_READ(to, __sanitizer::internal_strlen(to) + 1); 1974 } 1975} 1976PRE_SYSCALL(swapctl)(long long cmd_, void *arg_, long long misc_) { /* TODO */ } 1977POST_SYSCALL(swapctl) 1978(long long res, long long cmd_, void *arg_, long long misc_) { 1979 /* TODO */ 1980} 1981PRE_SYSCALL(compat_30_getdents)(long long fd_, void *buf_, long long count_) { 1982 /* TODO */ 1983} 1984POST_SYSCALL(compat_30_getdents) 1985(long long res, long long fd_, void *buf_, long long count_) { 1986 /* TODO */ 1987} 1988PRE_SYSCALL(minherit)(void *addr_, long long len_, long long inherit_) { 1989 /* Nothing to do */ 1990} 1991POST_SYSCALL(minherit) 1992(long long res, void *addr_, long long len_, long long inherit_) { 1993 /* Nothing to do */ 1994} 1995PRE_SYSCALL(lchmod)(void *path_, long long mode_) { 1996 const char *path = (const char *)path_; 1997 if (path) { 1998 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 1999 } 2000} 2001POST_SYSCALL(lchmod)(long long res, void *path_, long long mode_) { 2002 const char *path = (const char *)path_; 2003 if (path) { 2004 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2005 } 2006} 2007PRE_SYSCALL(lchown)(void *path_, long long uid_, long long gid_) { 2008 const char *path = (const char *)path_; 2009 if (path) { 2010 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2011 } 2012} 2013POST_SYSCALL(lchown) 2014(long long res, void *path_, long long uid_, long long gid_) { 2015 const char *path = (const char *)path_; 2016 if (path) { 2017 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2018 } 2019} 2020PRE_SYSCALL(compat_50_lutimes)(void *path_, void *tptr_) { /* TODO */ } 2021POST_SYSCALL(compat_50_lutimes)(long long res, void *path_, void *tptr_) { 2022 /* TODO */ 2023} 2024PRE_SYSCALL(__msync13)(void *addr_, long long len_, long long flags_) { 2025 /* Nothing to do */ 2026} 2027POST_SYSCALL(__msync13) 2028(long long res, void *addr_, long long len_, long long flags_) { 2029 /* Nothing to do */ 2030} 2031PRE_SYSCALL(compat_30___stat13)(void *path_, void *ub_) { /* TODO */ } 2032POST_SYSCALL(compat_30___stat13)(long long res, void *path_, void *ub_) { 2033 /* TODO */ 2034} 2035PRE_SYSCALL(compat_30___fstat13)(long long fd_, void *sb_) { /* TODO */ } 2036POST_SYSCALL(compat_30___fstat13)(long long res, long long fd_, void *sb_) { 2037 /* TODO */ 2038} 2039PRE_SYSCALL(compat_30___lstat13)(void *path_, void *ub_) { /* TODO */ } 2040POST_SYSCALL(compat_30___lstat13)(long long res, void *path_, void *ub_) { 2041 /* TODO */ 2042} 2043PRE_SYSCALL(__sigaltstack14)(void *nss_, void *oss_) { 2044 if (nss_) { 2045 PRE_READ(nss_, struct_sigaltstack_sz); 2046 } 2047 if (oss_) { 2048 PRE_READ(oss_, struct_sigaltstack_sz); 2049 } 2050} 2051POST_SYSCALL(__sigaltstack14)(long long res, void *nss_, void *oss_) {} 2052PRE_SYSCALL(__vfork14)(void) { /* Nothing to do */ } 2053POST_SYSCALL(__vfork14)(long long res) { /* Nothing to do */ } 2054PRE_SYSCALL(__posix_chown)(void *path_, long long uid_, long long gid_) { 2055 const char *path = (const char *)path_; 2056 if (path) { 2057 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2058 } 2059} 2060POST_SYSCALL(__posix_chown) 2061(long long res, void *path_, long long uid_, long long gid_) { 2062 const char *path = (const char *)path_; 2063 if (path) { 2064 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2065 } 2066} 2067PRE_SYSCALL(__posix_fchown)(long long fd_, long long uid_, long long gid_) { 2068 /* Nothing to do */ 2069} 2070POST_SYSCALL(__posix_fchown) 2071(long long res, long long fd_, long long uid_, long long gid_) { 2072 /* Nothing to do */ 2073} 2074PRE_SYSCALL(__posix_lchown)(void *path_, long long uid_, long long gid_) { 2075 const char *path = (const char *)path_; 2076 if (path) { 2077 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2078 } 2079} 2080POST_SYSCALL(__posix_lchown) 2081(long long res, void *path_, long long uid_, long long gid_) { 2082 const char *path = (const char *)path_; 2083 if (path) { 2084 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2085 } 2086} 2087PRE_SYSCALL(getsid)(long long pid_) { /* Nothing to do */ } 2088POST_SYSCALL(getsid)(long long res, long long pid_) { /* Nothing to do */ } 2089PRE_SYSCALL(__clone)(long long flags_, void *stack_) { /* Nothing to do */ } 2090POST_SYSCALL(__clone)(long long res, long long flags_, void *stack_) { 2091 /* Nothing to do */ 2092} 2093PRE_SYSCALL(fktrace) 2094(long long fd_, long long ops_, long long facs_, long long pid_) { 2095 /* Nothing to do */ 2096} 2097POST_SYSCALL(fktrace) 2098(long long res, long long fd_, long long ops_, long long facs_, 2099 long long pid_) { 2100 /* Nothing to do */ 2101} 2102PRE_SYSCALL(preadv) 2103(long long fd_, void *iovp_, long long iovcnt_, long long PAD_, 2104 long long offset_) { 2105 /* Nothing to do */ 2106} 2107POST_SYSCALL(preadv) 2108(long long res, long long fd_, void *iovp_, long long iovcnt_, long long PAD_, 2109 long long offset_) { 2110 /* Nothing to do */ 2111} 2112PRE_SYSCALL(pwritev) 2113(long long fd_, void *iovp_, long long iovcnt_, long long PAD_, 2114 long long offset_) { 2115 /* Nothing to do */ 2116} 2117POST_SYSCALL(pwritev) 2118(long long res, long long fd_, void *iovp_, long long iovcnt_, long long PAD_, 2119 long long offset_) { 2120 /* Nothing to do */ 2121} 2122PRE_SYSCALL(compat_16___sigaction14) 2123(long long signum_, void *nsa_, void *osa_) { 2124 /* TODO */ 2125} 2126POST_SYSCALL(compat_16___sigaction14) 2127(long long res, long long signum_, void *nsa_, void *osa_) { 2128 /* TODO */ 2129} 2130PRE_SYSCALL(__sigpending14)(void *set_) { /* Nothing to do */ } 2131POST_SYSCALL(__sigpending14)(long long res, void *set_) { /* Nothing to do */ } 2132PRE_SYSCALL(__sigprocmask14)(long long how_, void *set_, void *oset_) { 2133 /* Nothing to do */ 2134} 2135POST_SYSCALL(__sigprocmask14) 2136(long long res, long long how_, void *set_, void *oset_) { 2137 /* Nothing to do */ 2138} 2139PRE_SYSCALL(__sigsuspend14)(void *set_) { 2140 if (set_) { 2141 PRE_READ(set_, sizeof(__sanitizer_sigset_t)); 2142 } 2143} 2144POST_SYSCALL(__sigsuspend14)(long long res, void *set_) { 2145 if (set_) { 2146 PRE_READ(set_, sizeof(__sanitizer_sigset_t)); 2147 } 2148} 2149PRE_SYSCALL(compat_16___sigreturn14)(void *sigcntxp_) { /* TODO */ } 2150POST_SYSCALL(compat_16___sigreturn14)(long long res, void *sigcntxp_) { 2151 /* TODO */ 2152} 2153PRE_SYSCALL(__getcwd)(void *bufp_, long long length_) { /* Nothing to do */ } 2154POST_SYSCALL(__getcwd)(long long res, void *bufp_, long long length_) { 2155 /* Nothing to do */ 2156} 2157PRE_SYSCALL(fchroot)(long long fd_) { /* Nothing to do */ } 2158POST_SYSCALL(fchroot)(long long res, long long fd_) { /* Nothing to do */ } 2159PRE_SYSCALL(compat_30_fhopen)(void *fhp_, long long flags_) { /* TODO */ } 2160POST_SYSCALL(compat_30_fhopen)(long long res, void *fhp_, long long flags_) { 2161 /* TODO */ 2162} 2163PRE_SYSCALL(compat_30_fhstat)(void *fhp_, void *sb_) { /* TODO */ } 2164POST_SYSCALL(compat_30_fhstat)(long long res, void *fhp_, void *sb_) { 2165 /* TODO */ 2166} 2167PRE_SYSCALL(compat_20_fhstatfs)(void *fhp_, void *buf_) { /* TODO */ } 2168POST_SYSCALL(compat_20_fhstatfs)(long long res, void *fhp_, void *buf_) { 2169 /* TODO */ 2170} 2171PRE_SYSCALL(compat_50_____semctl13) 2172(long long semid_, long long semnum_, long long cmd_, void *arg_) { 2173 /* TODO */ 2174} 2175POST_SYSCALL(compat_50_____semctl13) 2176(long long res, long long semid_, long long semnum_, long long cmd_, 2177 void *arg_) { 2178 /* TODO */ 2179} 2180PRE_SYSCALL(compat_50___msgctl13) 2181(long long msqid_, long long cmd_, void *buf_) { 2182 /* TODO */ 2183} 2184POST_SYSCALL(compat_50___msgctl13) 2185(long long res, long long msqid_, long long cmd_, void *buf_) { 2186 /* TODO */ 2187} 2188PRE_SYSCALL(compat_50___shmctl13) 2189(long long shmid_, long long cmd_, void *buf_) { 2190 /* TODO */ 2191} 2192POST_SYSCALL(compat_50___shmctl13) 2193(long long res, long long shmid_, long long cmd_, void *buf_) { 2194 /* TODO */ 2195} 2196PRE_SYSCALL(lchflags)(void *path_, long long flags_) { 2197 const char *path = (const char *)path_; 2198 if (path) { 2199 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2200 } 2201} 2202POST_SYSCALL(lchflags)(long long res, void *path_, long long flags_) { 2203 const char *path = (const char *)path_; 2204 if (path) { 2205 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2206 } 2207} 2208PRE_SYSCALL(issetugid)(void) { /* Nothing to do */ } 2209POST_SYSCALL(issetugid)(long long res) { /* Nothing to do */ } 2210PRE_SYSCALL(utrace)(void *label_, void *addr_, long long len_) { 2211 const char *label = (const char *)label_; 2212 if (label) { 2213 PRE_READ(label, __sanitizer::internal_strlen(label) + 1); 2214 } 2215 if (addr_) { 2216 PRE_READ(addr_, len_); 2217 } 2218} 2219POST_SYSCALL(utrace)(long long res, void *label_, void *addr_, long long len_) { 2220 const char *label = (const char *)label_; 2221 if (label) { 2222 POST_READ(label, __sanitizer::internal_strlen(label) + 1); 2223 } 2224 if (addr_) { 2225 POST_READ(addr_, len_); 2226 } 2227} 2228PRE_SYSCALL(getcontext)(void *ucp_) { /* Nothing to do */ } 2229POST_SYSCALL(getcontext)(long long res, void *ucp_) { /* Nothing to do */ } 2230PRE_SYSCALL(setcontext)(void *ucp_) { 2231 if (ucp_) { 2232 PRE_READ(ucp_, ucontext_t_sz); 2233 } 2234} 2235POST_SYSCALL(setcontext)(long long res, void *ucp_) {} 2236PRE_SYSCALL(_lwp_create)(void *ucp_, long long flags_, void *new_lwp_) { 2237 if (ucp_) { 2238 PRE_READ(ucp_, ucontext_t_sz); 2239 } 2240} 2241POST_SYSCALL(_lwp_create) 2242(long long res, void *ucp_, long long flags_, void *new_lwp_) {} 2243PRE_SYSCALL(_lwp_exit)(void) { /* Nothing to do */ } 2244POST_SYSCALL(_lwp_exit)(long long res) { /* Nothing to do */ } 2245PRE_SYSCALL(_lwp_self)(void) { /* Nothing to do */ } 2246POST_SYSCALL(_lwp_self)(long long res) { /* Nothing to do */ } 2247PRE_SYSCALL(_lwp_wait)(long long wait_for_, void *departed_) { 2248 /* Nothing to do */ 2249} 2250POST_SYSCALL(_lwp_wait)(long long res, long long wait_for_, void *departed_) { 2251 /* Nothing to do */ 2252} 2253PRE_SYSCALL(_lwp_suspend)(long long target_) { /* Nothing to do */ } 2254POST_SYSCALL(_lwp_suspend)(long long res, long long target_) { 2255 /* Nothing to do */ 2256} 2257PRE_SYSCALL(_lwp_continue)(long long target_) { /* Nothing to do */ } 2258POST_SYSCALL(_lwp_continue)(long long res, long long target_) { 2259 /* Nothing to do */ 2260} 2261PRE_SYSCALL(_lwp_wakeup)(long long target_) { /* Nothing to do */ } 2262POST_SYSCALL(_lwp_wakeup)(long long res, long long target_) { 2263 /* Nothing to do */ 2264} 2265PRE_SYSCALL(_lwp_getprivate)(void) { /* Nothing to do */ } 2266POST_SYSCALL(_lwp_getprivate)(long long res) { /* Nothing to do */ } 2267PRE_SYSCALL(_lwp_setprivate)(void *ptr_) { /* Nothing to do */ } 2268POST_SYSCALL(_lwp_setprivate)(long long res, void *ptr_) { /* Nothing to do */ } 2269PRE_SYSCALL(_lwp_kill)(long long target_, long long signo_) { 2270 /* Nothing to do */ 2271} 2272POST_SYSCALL(_lwp_kill)(long long res, long long target_, long long signo_) { 2273 /* Nothing to do */ 2274} 2275PRE_SYSCALL(_lwp_detach)(long long target_) { /* Nothing to do */ } 2276POST_SYSCALL(_lwp_detach)(long long res, long long target_) { 2277 /* Nothing to do */ 2278} 2279PRE_SYSCALL(compat_50__lwp_park) 2280(void *ts_, long long unpark_, void *hint_, void *unparkhint_) { 2281 /* TODO */ 2282} 2283POST_SYSCALL(compat_50__lwp_park) 2284(long long res, void *ts_, long long unpark_, void *hint_, void *unparkhint_) { 2285 /* TODO */ 2286} 2287PRE_SYSCALL(_lwp_unpark)(long long target_, void *hint_) { /* Nothing to do */ } 2288POST_SYSCALL(_lwp_unpark)(long long res, long long target_, void *hint_) { 2289 /* Nothing to do */ 2290} 2291PRE_SYSCALL(_lwp_unpark_all)(void *targets_, long long ntargets_, void *hint_) { 2292 if (targets_) { 2293 PRE_READ(targets_, ntargets_ * sizeof(__sanitizer_lwpid_t)); 2294 } 2295} 2296POST_SYSCALL(_lwp_unpark_all) 2297(long long res, void *targets_, long long ntargets_, void *hint_) {} 2298PRE_SYSCALL(_lwp_setname)(long long target_, void *name_) { 2299 const char *name = (const char *)name_; 2300 if (name) { 2301 PRE_READ(name, __sanitizer::internal_strlen(name) + 1); 2302 } 2303} 2304POST_SYSCALL(_lwp_setname)(long long res, long long target_, void *name_) { 2305 const char *name = (const char *)name_; 2306 if (name) { 2307 POST_READ(name, __sanitizer::internal_strlen(name) + 1); 2308 } 2309} 2310PRE_SYSCALL(_lwp_getname)(long long target_, void *name_, long long len_) { 2311 /* Nothing to do */ 2312} 2313POST_SYSCALL(_lwp_getname) 2314(long long res, long long target_, void *name_, long long len_) { 2315 /* Nothing to do */ 2316} 2317PRE_SYSCALL(_lwp_ctl)(long long features_, void **address_) { 2318 /* Nothing to do */ 2319} 2320POST_SYSCALL(_lwp_ctl)(long long res, long long features_, void **address_) { 2321 /* Nothing to do */ 2322} 2323/* syscall 326 has been skipped */ 2324/* syscall 327 has been skipped */ 2325/* syscall 328 has been skipped */ 2326/* syscall 329 has been skipped */ 2327PRE_SYSCALL(compat_60_sa_register) 2328(void *newv_, void **oldv_, long long flags_, long long stackinfo_offset_) { 2329 /* TODO */ 2330} 2331POST_SYSCALL(compat_60_sa_register) 2332(long long res, void *newv_, void **oldv_, long long flags_, 2333 long long stackinfo_offset_) { 2334 /* TODO */ 2335} 2336PRE_SYSCALL(compat_60_sa_stacks)(long long num_, void *stacks_) { /* TODO */ } 2337POST_SYSCALL(compat_60_sa_stacks) 2338(long long res, long long num_, void *stacks_) { 2339 /* TODO */ 2340} 2341PRE_SYSCALL(compat_60_sa_enable)(void) { /* TODO */ } 2342POST_SYSCALL(compat_60_sa_enable)(long long res) { /* TODO */ } 2343PRE_SYSCALL(compat_60_sa_setconcurrency)(long long concurrency_) { /* TODO */ } 2344POST_SYSCALL(compat_60_sa_setconcurrency) 2345(long long res, long long concurrency_) { 2346 /* TODO */ 2347} 2348PRE_SYSCALL(compat_60_sa_yield)(void) { /* TODO */ } 2349POST_SYSCALL(compat_60_sa_yield)(long long res) { /* TODO */ } 2350PRE_SYSCALL(compat_60_sa_preempt)(long long sa_id_) { /* TODO */ } 2351POST_SYSCALL(compat_60_sa_preempt)(long long res, long long sa_id_) { 2352 /* TODO */ 2353} 2354/* syscall 336 has been skipped */ 2355/* syscall 337 has been skipped */ 2356/* syscall 338 has been skipped */ 2357/* syscall 339 has been skipped */ 2358PRE_SYSCALL(__sigaction_sigtramp) 2359(long long signum_, void *nsa_, void *osa_, void *tramp_, long long vers_) { 2360 if (nsa_) { 2361 PRE_READ(nsa_, sizeof(__sanitizer_sigaction)); 2362 } 2363} 2364POST_SYSCALL(__sigaction_sigtramp) 2365(long long res, long long signum_, void *nsa_, void *osa_, void *tramp_, 2366 long long vers_) { 2367 if (nsa_) { 2368 PRE_READ(nsa_, sizeof(__sanitizer_sigaction)); 2369 } 2370} 2371/* syscall 341 has been skipped */ 2372/* syscall 342 has been skipped */ 2373PRE_SYSCALL(rasctl)(void *addr_, long long len_, long long op_) { 2374 /* Nothing to do */ 2375} 2376POST_SYSCALL(rasctl) 2377(long long res, void *addr_, long long len_, long long op_) { 2378 /* Nothing to do */ 2379} 2380PRE_SYSCALL(kqueue)(void) { /* Nothing to do */ } 2381POST_SYSCALL(kqueue)(long long res) { /* Nothing to do */ } 2382PRE_SYSCALL(compat_50_kevent) 2383(long long fd_, void *changelist_, long long nchanges_, void *eventlist_, 2384 long long nevents_, void *timeout_) { 2385 /* TODO */ 2386} 2387POST_SYSCALL(compat_50_kevent) 2388(long long res, long long fd_, void *changelist_, long long nchanges_, 2389 void *eventlist_, long long nevents_, void *timeout_) { 2390 /* TODO */ 2391} 2392PRE_SYSCALL(_sched_setparam) 2393(long long pid_, long long lid_, long long policy_, void *params_) { 2394 if (params_) { 2395 PRE_READ(params_, struct_sched_param_sz); 2396 } 2397} 2398POST_SYSCALL(_sched_setparam) 2399(long long res, long long pid_, long long lid_, long long policy_, 2400 void *params_) { 2401 if (params_) { 2402 PRE_READ(params_, struct_sched_param_sz); 2403 } 2404} 2405PRE_SYSCALL(_sched_getparam) 2406(long long pid_, long long lid_, void *policy_, void *params_) { 2407 /* Nothing to do */ 2408} 2409POST_SYSCALL(_sched_getparam) 2410(long long res, long long pid_, long long lid_, void *policy_, void *params_) { 2411 /* Nothing to do */ 2412} 2413PRE_SYSCALL(_sched_setaffinity) 2414(long long pid_, long long lid_, long long size_, void *cpuset_) { 2415 if (cpuset_) { 2416 PRE_READ(cpuset_, size_); 2417 } 2418} 2419POST_SYSCALL(_sched_setaffinity) 2420(long long res, long long pid_, long long lid_, long long size_, 2421 void *cpuset_) { 2422 if (cpuset_) { 2423 PRE_READ(cpuset_, size_); 2424 } 2425} 2426PRE_SYSCALL(_sched_getaffinity) 2427(long long pid_, long long lid_, long long size_, void *cpuset_) { 2428 /* Nothing to do */ 2429} 2430POST_SYSCALL(_sched_getaffinity) 2431(long long res, long long pid_, long long lid_, long long size_, 2432 void *cpuset_) { 2433 /* Nothing to do */ 2434} 2435PRE_SYSCALL(sched_yield)(void) { /* Nothing to do */ } 2436POST_SYSCALL(sched_yield)(long long res) { /* Nothing to do */ } 2437PRE_SYSCALL(_sched_protect)(long long priority_) { /* Nothing to do */ } 2438POST_SYSCALL(_sched_protect)(long long res, long long priority_) { 2439 /* Nothing to do */ 2440} 2441/* syscall 352 has been skipped */ 2442/* syscall 353 has been skipped */ 2443PRE_SYSCALL(fsync_range) 2444(long long fd_, long long flags_, long long start_, long long length_) { 2445 /* Nothing to do */ 2446} 2447POST_SYSCALL(fsync_range) 2448(long long res, long long fd_, long long flags_, long long start_, 2449 long long length_) { 2450 /* Nothing to do */ 2451} 2452PRE_SYSCALL(uuidgen)(void *store_, long long count_) { /* Nothing to do */ } 2453POST_SYSCALL(uuidgen)(long long res, void *store_, long long count_) { 2454 /* Nothing to do */ 2455} 2456PRE_SYSCALL(compat_90_getvfsstat) 2457(void *buf_, long long bufsize_, long long flags_) { 2458 /* Nothing to do */ 2459} 2460POST_SYSCALL(compat_90_getvfsstat) 2461(long long res, void *buf_, long long bufsize_, long long flags_) { 2462 /* Nothing to do */ 2463} 2464PRE_SYSCALL(compat_90_statvfs1)(void *path_, void *buf_, long long flags_) { 2465 const char *path = (const char *)path_; 2466 if (path) { 2467 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2468 } 2469} 2470POST_SYSCALL(compat_90_statvfs1) 2471(long long res, void *path_, void *buf_, long long flags_) { 2472 const char *path = (const char *)path_; 2473 if (path) { 2474 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2475 } 2476} 2477PRE_SYSCALL(compat_90_fstatvfs1)(long long fd_, void *buf_, long long flags_) { 2478 /* Nothing to do */ 2479} 2480POST_SYSCALL(compat_90_fstatvfs1) 2481(long long res, long long fd_, void *buf_, long long flags_) { 2482 /* Nothing to do */ 2483} 2484PRE_SYSCALL(compat_30_fhstatvfs1)(void *fhp_, void *buf_, long long flags_) { 2485 /* TODO */ 2486} 2487POST_SYSCALL(compat_30_fhstatvfs1) 2488(long long res, void *fhp_, void *buf_, long long flags_) { 2489 /* TODO */ 2490} 2491PRE_SYSCALL(extattrctl) 2492(void *path_, long long cmd_, void *filename_, long long attrnamespace_, 2493 void *attrname_) { 2494 const char *path = (const char *)path_; 2495 if (path) { 2496 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2497 } 2498} 2499POST_SYSCALL(extattrctl) 2500(long long res, void *path_, long long cmd_, void *filename_, 2501 long long attrnamespace_, void *attrname_) { 2502 const char *path = (const char *)path_; 2503 if (path) { 2504 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2505 } 2506} 2507PRE_SYSCALL(extattr_set_file) 2508(void *path_, long long attrnamespace_, void *attrname_, void *data_, 2509 long long nbytes_) { 2510 const char *path = (const char *)path_; 2511 if (path) { 2512 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2513 } 2514} 2515POST_SYSCALL(extattr_set_file) 2516(long long res, void *path_, long long attrnamespace_, void *attrname_, 2517 void *data_, long long nbytes_) { 2518 const char *path = (const char *)path_; 2519 if (path) { 2520 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2521 } 2522} 2523PRE_SYSCALL(extattr_get_file) 2524(void *path_, long long attrnamespace_, void *attrname_, void *data_, 2525 long long nbytes_) { 2526 const char *path = (const char *)path_; 2527 if (path) { 2528 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2529 } 2530} 2531POST_SYSCALL(extattr_get_file) 2532(long long res, void *path_, long long attrnamespace_, void *attrname_, 2533 void *data_, long long nbytes_) { 2534 const char *path = (const char *)path_; 2535 if (path) { 2536 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2537 } 2538} 2539PRE_SYSCALL(extattr_delete_file) 2540(void *path_, long long attrnamespace_, void *attrname_) { 2541 const char *path = (const char *)path_; 2542 if (path) { 2543 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2544 } 2545} 2546POST_SYSCALL(extattr_delete_file) 2547(long long res, void *path_, long long attrnamespace_, void *attrname_) { 2548 const char *path = (const char *)path_; 2549 if (path) { 2550 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2551 } 2552} 2553PRE_SYSCALL(extattr_set_fd) 2554(long long fd_, long long attrnamespace_, void *attrname_, void *data_, 2555 long long nbytes_) { 2556 /* TODO */ 2557} 2558POST_SYSCALL(extattr_set_fd) 2559(long long res, long long fd_, long long attrnamespace_, void *attrname_, 2560 void *data_, long long nbytes_) { 2561 /* TODO */ 2562} 2563PRE_SYSCALL(extattr_get_fd) 2564(long long fd_, long long attrnamespace_, void *attrname_, void *data_, 2565 long long nbytes_) { 2566 /* TODO */ 2567} 2568POST_SYSCALL(extattr_get_fd) 2569(long long res, long long fd_, long long attrnamespace_, void *attrname_, 2570 void *data_, long long nbytes_) { 2571 /* TODO */ 2572} 2573PRE_SYSCALL(extattr_delete_fd) 2574(long long fd_, long long attrnamespace_, void *attrname_) { 2575 /* TODO */ 2576} 2577POST_SYSCALL(extattr_delete_fd) 2578(long long res, long long fd_, long long attrnamespace_, void *attrname_) { 2579 /* TODO */ 2580} 2581PRE_SYSCALL(extattr_set_link) 2582(void *path_, long long attrnamespace_, void *attrname_, void *data_, 2583 long long nbytes_) { 2584 const char *path = (const char *)path_; 2585 if (path) { 2586 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2587 } 2588} 2589POST_SYSCALL(extattr_set_link) 2590(long long res, void *path_, long long attrnamespace_, void *attrname_, 2591 void *data_, long long nbytes_) { 2592 const char *path = (const char *)path_; 2593 if (path) { 2594 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2595 } 2596} 2597PRE_SYSCALL(extattr_get_link) 2598(void *path_, long long attrnamespace_, void *attrname_, void *data_, 2599 long long nbytes_) { 2600 const char *path = (const char *)path_; 2601 if (path) { 2602 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2603 } 2604} 2605POST_SYSCALL(extattr_get_link) 2606(long long res, void *path_, long long attrnamespace_, void *attrname_, 2607 void *data_, long long nbytes_) { 2608 const char *path = (const char *)path_; 2609 if (path) { 2610 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2611 } 2612} 2613PRE_SYSCALL(extattr_delete_link) 2614(void *path_, long long attrnamespace_, void *attrname_) { 2615 const char *path = (const char *)path_; 2616 if (path) { 2617 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2618 } 2619} 2620POST_SYSCALL(extattr_delete_link) 2621(long long res, void *path_, long long attrnamespace_, void *attrname_) { 2622 const char *path = (const char *)path_; 2623 if (path) { 2624 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2625 } 2626} 2627PRE_SYSCALL(extattr_list_fd) 2628(long long fd_, long long attrnamespace_, void *data_, long long nbytes_) { 2629 /* TODO */ 2630} 2631POST_SYSCALL(extattr_list_fd) 2632(long long res, long long fd_, long long attrnamespace_, void *data_, 2633 long long nbytes_) { 2634 /* TODO */ 2635} 2636PRE_SYSCALL(extattr_list_file) 2637(void *path_, long long attrnamespace_, void *data_, long long nbytes_) { 2638 const char *path = (const char *)path_; 2639 if (path) { 2640 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2641 } 2642} 2643POST_SYSCALL(extattr_list_file) 2644(long long res, void *path_, long long attrnamespace_, void *data_, 2645 long long nbytes_) { 2646 const char *path = (const char *)path_; 2647 if (path) { 2648 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2649 } 2650} 2651PRE_SYSCALL(extattr_list_link) 2652(void *path_, long long attrnamespace_, void *data_, long long nbytes_) { 2653 const char *path = (const char *)path_; 2654 if (path) { 2655 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2656 } 2657} 2658POST_SYSCALL(extattr_list_link) 2659(long long res, void *path_, long long attrnamespace_, void *data_, 2660 long long nbytes_) { 2661 const char *path = (const char *)path_; 2662 if (path) { 2663 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2664 } 2665} 2666PRE_SYSCALL(compat_50_pselect) 2667(long long nd_, void *in_, void *ou_, void *ex_, void *ts_, void *mask_) { 2668 /* TODO */ 2669} 2670POST_SYSCALL(compat_50_pselect) 2671(long long res, long long nd_, void *in_, void *ou_, void *ex_, void *ts_, 2672 void *mask_) { 2673 /* TODO */ 2674} 2675PRE_SYSCALL(compat_50_pollts) 2676(void *fds_, long long nfds_, void *ts_, void *mask_) { 2677 /* TODO */ 2678} 2679POST_SYSCALL(compat_50_pollts) 2680(long long res, void *fds_, long long nfds_, void *ts_, void *mask_) { 2681 /* TODO */ 2682} 2683PRE_SYSCALL(setxattr) 2684(void *path_, void *name_, void *value_, long long size_, long long flags_) { 2685 const char *path = (const char *)path_; 2686 if (path) { 2687 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2688 } 2689} 2690POST_SYSCALL(setxattr) 2691(long long res, void *path_, void *name_, void *value_, long long size_, 2692 long long flags_) { 2693 const char *path = (const char *)path_; 2694 if (path) { 2695 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2696 } 2697} 2698PRE_SYSCALL(lsetxattr) 2699(void *path_, void *name_, void *value_, long long size_, long long flags_) { 2700 const char *path = (const char *)path_; 2701 if (path) { 2702 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2703 } 2704} 2705POST_SYSCALL(lsetxattr) 2706(long long res, void *path_, void *name_, void *value_, long long size_, 2707 long long flags_) { 2708 const char *path = (const char *)path_; 2709 if (path) { 2710 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2711 } 2712} 2713PRE_SYSCALL(fsetxattr) 2714(long long fd_, void *name_, void *value_, long long size_, long long flags_) { 2715 /* Nothing to do */ 2716} 2717POST_SYSCALL(fsetxattr) 2718(long long res, long long fd_, void *name_, void *value_, long long size_, 2719 long long flags_) { 2720 /* Nothing to do */ 2721} 2722PRE_SYSCALL(getxattr)(void *path_, void *name_, void *value_, long long size_) { 2723 const char *path = (const char *)path_; 2724 if (path) { 2725 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2726 } 2727} 2728POST_SYSCALL(getxattr) 2729(long long res, void *path_, void *name_, void *value_, long long size_) { 2730 const char *path = (const char *)path_; 2731 if (path) { 2732 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2733 } 2734} 2735PRE_SYSCALL(lgetxattr) 2736(void *path_, void *name_, void *value_, long long size_) { 2737 const char *path = (const char *)path_; 2738 if (path) { 2739 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2740 } 2741} 2742POST_SYSCALL(lgetxattr) 2743(long long res, void *path_, void *name_, void *value_, long long size_) { 2744 const char *path = (const char *)path_; 2745 if (path) { 2746 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2747 } 2748} 2749PRE_SYSCALL(fgetxattr) 2750(long long fd_, void *name_, void *value_, long long size_) { 2751 /* Nothing to do */ 2752} 2753POST_SYSCALL(fgetxattr) 2754(long long res, long long fd_, void *name_, void *value_, long long size_) { 2755 /* Nothing to do */ 2756} 2757PRE_SYSCALL(listxattr)(void *path_, void *list_, long long size_) { 2758 const char *path = (const char *)path_; 2759 if (path) { 2760 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2761 } 2762} 2763POST_SYSCALL(listxattr) 2764(long long res, void *path_, void *list_, long long size_) { 2765 const char *path = (const char *)path_; 2766 if (path) { 2767 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2768 } 2769} 2770PRE_SYSCALL(llistxattr)(void *path_, void *list_, long long size_) { 2771 const char *path = (const char *)path_; 2772 if (path) { 2773 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2774 } 2775} 2776POST_SYSCALL(llistxattr) 2777(long long res, void *path_, void *list_, long long size_) { 2778 const char *path = (const char *)path_; 2779 if (path) { 2780 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2781 } 2782} 2783PRE_SYSCALL(flistxattr)(long long fd_, void *list_, long long size_) { 2784 /* TODO */ 2785} 2786POST_SYSCALL(flistxattr) 2787(long long res, long long fd_, void *list_, long long size_) { 2788 /* TODO */ 2789} 2790PRE_SYSCALL(removexattr)(void *path_, void *name_) { 2791 const char *path = (const char *)path_; 2792 if (path) { 2793 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2794 } 2795} 2796POST_SYSCALL(removexattr)(long long res, void *path_, void *name_) { 2797 const char *path = (const char *)path_; 2798 if (path) { 2799 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2800 } 2801} 2802PRE_SYSCALL(lremovexattr)(void *path_, void *name_) { 2803 const char *path = (const char *)path_; 2804 if (path) { 2805 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2806 } 2807} 2808POST_SYSCALL(lremovexattr)(long long res, void *path_, void *name_) { 2809 const char *path = (const char *)path_; 2810 if (path) { 2811 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2812 } 2813} 2814PRE_SYSCALL(fremovexattr)(long long fd_, void *name_) { /* TODO */ } 2815POST_SYSCALL(fremovexattr)(long long res, long long fd_, void *name_) { 2816 /* TODO */ 2817} 2818PRE_SYSCALL(compat_50___stat30)(void *path_, void *ub_) { /* TODO */ } 2819POST_SYSCALL(compat_50___stat30)(long long res, void *path_, void *ub_) { 2820 /* TODO */ 2821} 2822PRE_SYSCALL(compat_50___fstat30)(long long fd_, void *sb_) { /* TODO */ } 2823POST_SYSCALL(compat_50___fstat30)(long long res, long long fd_, void *sb_) { 2824 /* TODO */ 2825} 2826PRE_SYSCALL(compat_50___lstat30)(void *path_, void *ub_) { /* TODO */ } 2827POST_SYSCALL(compat_50___lstat30)(long long res, void *path_, void *ub_) { 2828 /* TODO */ 2829} 2830PRE_SYSCALL(__getdents30)(long long fd_, void *buf_, long long count_) { 2831 /* Nothing to do */ 2832} 2833POST_SYSCALL(__getdents30) 2834(long long res, long long fd_, void *buf_, long long count_) { 2835 /* Nothing to do */ 2836} 2837PRE_SYSCALL(posix_fadvise)(long long) { /* Nothing to do */ } 2838POST_SYSCALL(posix_fadvise)(long long res, long long) { /* Nothing to do */ } 2839PRE_SYSCALL(compat_30___fhstat30)(void *fhp_, void *sb_) { /* TODO */ } 2840POST_SYSCALL(compat_30___fhstat30)(long long res, void *fhp_, void *sb_) { 2841 /* TODO */ 2842} 2843PRE_SYSCALL(compat_50___ntp_gettime30)(void *ntvp_) { /* TODO */ } 2844POST_SYSCALL(compat_50___ntp_gettime30)(long long res, void *ntvp_) { 2845 /* TODO */ 2846} 2847PRE_SYSCALL(__socket30) 2848(long long domain_, long long type_, long long protocol_) { 2849 /* Nothing to do */ 2850} 2851POST_SYSCALL(__socket30) 2852(long long res, long long domain_, long long type_, long long protocol_) { 2853 /* Nothing to do */ 2854} 2855PRE_SYSCALL(__getfh30)(void *fname_, void *fhp_, void *fh_size_) { 2856 const char *fname = (const char *)fname_; 2857 if (fname) { 2858 PRE_READ(fname, __sanitizer::internal_strlen(fname) + 1); 2859 } 2860} 2861POST_SYSCALL(__getfh30) 2862(long long res, void *fname_, void *fhp_, void *fh_size_) { 2863 const char *fname = (const char *)fname_; 2864 if (res == 0) { 2865 if (fname) { 2866 POST_READ(fname, __sanitizer::internal_strlen(fname) + 1); 2867 } 2868 } 2869} 2870PRE_SYSCALL(__fhopen40)(void *fhp_, long long fh_size_, long long flags_) { 2871 if (fhp_) { 2872 PRE_READ(fhp_, fh_size_); 2873 } 2874} 2875POST_SYSCALL(__fhopen40) 2876(long long res, void *fhp_, long long fh_size_, long long flags_) {} 2877PRE_SYSCALL(compat_90_fhstatvfs1) 2878(void *fhp_, long long fh_size_, void *buf_, long long flags_) { 2879 if (fhp_) { 2880 PRE_READ(fhp_, fh_size_); 2881 } 2882} 2883POST_SYSCALL(compat_90_fhstatvfs1) 2884(long long res, void *fhp_, long long fh_size_, void *buf_, long long flags_) {} 2885PRE_SYSCALL(compat_50___fhstat40)(void *fhp_, long long fh_size_, void *sb_) { 2886 if (fhp_) { 2887 PRE_READ(fhp_, fh_size_); 2888 } 2889} 2890POST_SYSCALL(compat_50___fhstat40) 2891(long long res, void *fhp_, long long fh_size_, void *sb_) {} 2892PRE_SYSCALL(aio_cancel)(long long fildes_, void *aiocbp_) { 2893 if (aiocbp_) { 2894 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb)); 2895 } 2896} 2897POST_SYSCALL(aio_cancel)(long long res, long long fildes_, void *aiocbp_) {} 2898PRE_SYSCALL(aio_error)(void *aiocbp_) { 2899 if (aiocbp_) { 2900 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb)); 2901 } 2902} 2903POST_SYSCALL(aio_error)(long long res, void *aiocbp_) {} 2904PRE_SYSCALL(aio_fsync)(long long op_, void *aiocbp_) { 2905 if (aiocbp_) { 2906 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb)); 2907 } 2908} 2909POST_SYSCALL(aio_fsync)(long long res, long long op_, void *aiocbp_) {} 2910PRE_SYSCALL(aio_read)(void *aiocbp_) { 2911 if (aiocbp_) { 2912 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb)); 2913 } 2914} 2915POST_SYSCALL(aio_read)(long long res, void *aiocbp_) {} 2916PRE_SYSCALL(aio_return)(void *aiocbp_) { 2917 if (aiocbp_) { 2918 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb)); 2919 } 2920} 2921POST_SYSCALL(aio_return)(long long res, void *aiocbp_) {} 2922PRE_SYSCALL(compat_50_aio_suspend) 2923(void *list_, long long nent_, void *timeout_) { 2924 /* TODO */ 2925} 2926POST_SYSCALL(compat_50_aio_suspend) 2927(long long res, void *list_, long long nent_, void *timeout_) { 2928 /* TODO */ 2929} 2930PRE_SYSCALL(aio_write)(void *aiocbp_) { 2931 if (aiocbp_) { 2932 PRE_READ(aiocbp_, sizeof(struct __sanitizer_aiocb)); 2933 } 2934} 2935POST_SYSCALL(aio_write)(long long res, void *aiocbp_) {} 2936PRE_SYSCALL(lio_listio) 2937(long long mode_, void *list_, long long nent_, void *sig_) { 2938 /* Nothing to do */ 2939} 2940POST_SYSCALL(lio_listio) 2941(long long res, long long mode_, void *list_, long long nent_, void *sig_) { 2942 /* Nothing to do */ 2943} 2944/* syscall 407 has been skipped */ 2945/* syscall 408 has been skipped */ 2946/* syscall 409 has been skipped */ 2947PRE_SYSCALL(__mount50) 2948(void *type_, void *path_, long long flags_, void *data_, long long data_len_) { 2949 const char *type = (const char *)type_; 2950 const char *path = (const char *)path_; 2951 if (type) { 2952 PRE_READ(type, __sanitizer::internal_strlen(type) + 1); 2953 } 2954 if (path) { 2955 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 2956 } 2957 if (data_) { 2958 PRE_READ(data_, data_len_); 2959 } 2960} 2961POST_SYSCALL(__mount50) 2962(long long res, void *type_, void *path_, long long flags_, void *data_, 2963 long long data_len_) { 2964 const char *type = (const char *)type_; 2965 const char *path = (const char *)path_; 2966 if (type) { 2967 POST_READ(type, __sanitizer::internal_strlen(type) + 1); 2968 } 2969 if (path) { 2970 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 2971 } 2972 if (data_) { 2973 POST_READ(data_, data_len_); 2974 } 2975} 2976PRE_SYSCALL(mremap) 2977(void *old_address_, long long old_size_, void *new_address_, 2978 long long new_size_, long long flags_) { 2979 /* Nothing to do */ 2980} 2981POST_SYSCALL(mremap) 2982(long long res, void *old_address_, long long old_size_, void *new_address_, 2983 long long new_size_, long long flags_) { 2984 /* Nothing to do */ 2985} 2986PRE_SYSCALL(pset_create)(void *psid_) { /* Nothing to do */ } 2987POST_SYSCALL(pset_create)(long long res, void *psid_) { /* Nothing to do */ } 2988PRE_SYSCALL(pset_destroy)(long long psid_) { /* Nothing to do */ } 2989POST_SYSCALL(pset_destroy)(long long res, long long psid_) { 2990 /* Nothing to do */ 2991} 2992PRE_SYSCALL(pset_assign)(long long psid_, long long cpuid_, void *opsid_) { 2993 /* Nothing to do */ 2994} 2995POST_SYSCALL(pset_assign) 2996(long long res, long long psid_, long long cpuid_, void *opsid_) { 2997 /* Nothing to do */ 2998} 2999PRE_SYSCALL(_pset_bind) 3000(long long idtype_, long long first_id_, long long second_id_, long long psid_, 3001 void *opsid_) { 3002 /* Nothing to do */ 3003} 3004POST_SYSCALL(_pset_bind) 3005(long long res, long long idtype_, long long first_id_, long long second_id_, 3006 long long psid_, void *opsid_) { 3007 /* Nothing to do */ 3008} 3009PRE_SYSCALL(__posix_fadvise50) 3010(long long fd_, long long PAD_, long long offset_, long long len_, 3011 long long advice_) { 3012 /* Nothing to do */ 3013} 3014POST_SYSCALL(__posix_fadvise50) 3015(long long res, long long fd_, long long PAD_, long long offset_, 3016 long long len_, long long advice_) { 3017 /* Nothing to do */ 3018} 3019PRE_SYSCALL(__select50) 3020(long long nd_, void *in_, void *ou_, void *ex_, void *tv_) { 3021 /* Nothing to do */ 3022} 3023POST_SYSCALL(__select50) 3024(long long res, long long nd_, void *in_, void *ou_, void *ex_, void *tv_) { 3025 /* Nothing to do */ 3026} 3027PRE_SYSCALL(__gettimeofday50)(void *tp_, void *tzp_) { /* Nothing to do */ } 3028POST_SYSCALL(__gettimeofday50)(long long res, void *tp_, void *tzp_) { 3029 /* Nothing to do */ 3030} 3031PRE_SYSCALL(__settimeofday50)(void *tv_, void *tzp_) { 3032 if (tv_) { 3033 PRE_READ(tv_, timeval_sz); 3034 } 3035 if (tzp_) { 3036 PRE_READ(tzp_, struct_timezone_sz); 3037 } 3038} 3039POST_SYSCALL(__settimeofday50)(long long res, void *tv_, void *tzp_) {} 3040PRE_SYSCALL(__utimes50)(void *path_, void *tptr_) { 3041 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_; 3042 const char *path = (const char *)path_; 3043 if (path) { 3044 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3045 } 3046 if (tptr) { 3047 PRE_READ(tptr[0], struct_timespec_sz); 3048 PRE_READ(tptr[1], struct_timespec_sz); 3049 } 3050} 3051POST_SYSCALL(__utimes50)(long long res, void *path_, void *tptr_) {} 3052PRE_SYSCALL(__adjtime50)(void *delta_, void *olddelta_) { 3053 if (delta_) { 3054 PRE_READ(delta_, timeval_sz); 3055 } 3056} 3057POST_SYSCALL(__adjtime50)(long long res, void *delta_, void *olddelta_) {} 3058PRE_SYSCALL(__lfs_segwait50)(void *fsidp_, void *tv_) { /* TODO */ } 3059POST_SYSCALL(__lfs_segwait50)(long long res, void *fsidp_, void *tv_) { 3060 /* TODO */ 3061} 3062PRE_SYSCALL(__futimes50)(long long fd_, void *tptr_) { 3063 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_; 3064 if (tptr) { 3065 PRE_READ(tptr[0], struct_timespec_sz); 3066 PRE_READ(tptr[1], struct_timespec_sz); 3067 } 3068} 3069POST_SYSCALL(__futimes50)(long long res, long long fd_, void *tptr_) {} 3070PRE_SYSCALL(__lutimes50)(void *path_, void *tptr_) { 3071 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_; 3072 const char *path = (const char *)path_; 3073 if (path) { 3074 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3075 } 3076 if (tptr) { 3077 PRE_READ(tptr[0], struct_timespec_sz); 3078 PRE_READ(tptr[1], struct_timespec_sz); 3079 } 3080} 3081POST_SYSCALL(__lutimes50)(long long res, void *path_, void *tptr_) { 3082 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_; 3083 const char *path = (const char *)path_; 3084 if (path) { 3085 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3086 } 3087 if (tptr) { 3088 POST_READ(tptr[0], struct_timespec_sz); 3089 POST_READ(tptr[1], struct_timespec_sz); 3090 } 3091} 3092PRE_SYSCALL(__setitimer50)(long long which_, void *itv_, void *oitv_) { 3093 struct __sanitizer_itimerval *itv = (struct __sanitizer_itimerval *)itv_; 3094 if (itv) { 3095 PRE_READ(&itv->it_interval.tv_sec, sizeof(__sanitizer_time_t)); 3096 PRE_READ(&itv->it_interval.tv_usec, sizeof(__sanitizer_suseconds_t)); 3097 PRE_READ(&itv->it_value.tv_sec, sizeof(__sanitizer_time_t)); 3098 PRE_READ(&itv->it_value.tv_usec, sizeof(__sanitizer_suseconds_t)); 3099 } 3100} 3101POST_SYSCALL(__setitimer50) 3102(long long res, long long which_, void *itv_, void *oitv_) {} 3103PRE_SYSCALL(__getitimer50)(long long which_, void *itv_) { /* Nothing to do */ } 3104POST_SYSCALL(__getitimer50)(long long res, long long which_, void *itv_) { 3105 /* Nothing to do */ 3106} 3107PRE_SYSCALL(__clock_gettime50)(long long clock_id_, void *tp_) { 3108 /* Nothing to do */ 3109} 3110POST_SYSCALL(__clock_gettime50)(long long res, long long clock_id_, void *tp_) { 3111 /* Nothing to do */ 3112} 3113PRE_SYSCALL(__clock_settime50)(long long clock_id_, void *tp_) { 3114 if (tp_) { 3115 PRE_READ(tp_, struct_timespec_sz); 3116 } 3117} 3118POST_SYSCALL(__clock_settime50) 3119(long long res, long long clock_id_, void *tp_) {} 3120PRE_SYSCALL(__clock_getres50)(long long clock_id_, void *tp_) { 3121 /* Nothing to do */ 3122} 3123POST_SYSCALL(__clock_getres50)(long long res, long long clock_id_, void *tp_) { 3124 /* Nothing to do */ 3125} 3126PRE_SYSCALL(__nanosleep50)(void *rqtp_, void *rmtp_) { 3127 if (rqtp_) { 3128 PRE_READ(rqtp_, struct_timespec_sz); 3129 } 3130} 3131POST_SYSCALL(__nanosleep50)(long long res, void *rqtp_, void *rmtp_) {} 3132PRE_SYSCALL(____sigtimedwait50)(void *set_, void *info_, void *timeout_) { 3133 if (set_) { 3134 PRE_READ(set_, sizeof(__sanitizer_sigset_t)); 3135 } 3136 if (timeout_) { 3137 PRE_READ(timeout_, struct_timespec_sz); 3138 } 3139} 3140POST_SYSCALL(____sigtimedwait50) 3141(long long res, void *set_, void *info_, void *timeout_) {} 3142PRE_SYSCALL(__mq_timedsend50) 3143(long long mqdes_, void *msg_ptr_, long long msg_len_, long long msg_prio_, 3144 void *abs_timeout_) { 3145 if (msg_ptr_) { 3146 PRE_READ(msg_ptr_, msg_len_); 3147 } 3148 if (abs_timeout_) { 3149 PRE_READ(abs_timeout_, struct_timespec_sz); 3150 } 3151} 3152POST_SYSCALL(__mq_timedsend50) 3153(long long res, long long mqdes_, void *msg_ptr_, long long msg_len_, 3154 long long msg_prio_, void *abs_timeout_) {} 3155PRE_SYSCALL(__mq_timedreceive50) 3156(long long mqdes_, void *msg_ptr_, long long msg_len_, void *msg_prio_, 3157 void *abs_timeout_) { 3158 if (msg_ptr_) { 3159 PRE_READ(msg_ptr_, msg_len_); 3160 } 3161 if (abs_timeout_) { 3162 PRE_READ(abs_timeout_, struct_timespec_sz); 3163 } 3164} 3165POST_SYSCALL(__mq_timedreceive50) 3166(long long res, long long mqdes_, void *msg_ptr_, long long msg_len_, 3167 void *msg_prio_, void *abs_timeout_) {} 3168PRE_SYSCALL(compat_60__lwp_park) 3169(void *ts_, long long unpark_, void *hint_, void *unparkhint_) { 3170 /* TODO */ 3171} 3172POST_SYSCALL(compat_60__lwp_park) 3173(long long res, void *ts_, long long unpark_, void *hint_, void *unparkhint_) { 3174 /* TODO */ 3175} 3176PRE_SYSCALL(__kevent50) 3177(long long fd_, void *changelist_, long long nchanges_, void *eventlist_, 3178 long long nevents_, void *timeout_) { 3179 if (changelist_) { 3180 PRE_READ(changelist_, nchanges_ * struct_kevent_sz); 3181 } 3182 if (timeout_) { 3183 PRE_READ(timeout_, struct_timespec_sz); 3184 } 3185} 3186POST_SYSCALL(__kevent50) 3187(long long res, long long fd_, void *changelist_, long long nchanges_, 3188 void *eventlist_, long long nevents_, void *timeout_) {} 3189PRE_SYSCALL(__pselect50) 3190(long long nd_, void *in_, void *ou_, void *ex_, void *ts_, void *mask_) { 3191 if (ts_) { 3192 PRE_READ(ts_, struct_timespec_sz); 3193 } 3194 if (mask_) { 3195 PRE_READ(mask_, sizeof(struct __sanitizer_sigset_t)); 3196 } 3197} 3198POST_SYSCALL(__pselect50) 3199(long long res, long long nd_, void *in_, void *ou_, void *ex_, void *ts_, 3200 void *mask_) {} 3201PRE_SYSCALL(__pollts50)(void *fds_, long long nfds_, void *ts_, void *mask_) { 3202 if (ts_) { 3203 PRE_READ(ts_, struct_timespec_sz); 3204 } 3205 if (mask_) { 3206 PRE_READ(mask_, sizeof(struct __sanitizer_sigset_t)); 3207 } 3208} 3209POST_SYSCALL(__pollts50) 3210(long long res, void *fds_, long long nfds_, void *ts_, void *mask_) {} 3211PRE_SYSCALL(__aio_suspend50)(void *list_, long long nent_, void *timeout_) { 3212 int i; 3213 const struct aiocb *const *list = (const struct aiocb *const *)list_; 3214 if (list) { 3215 for (i = 0; i < nent_; i++) { 3216 if (list[i]) { 3217 PRE_READ(list[i], sizeof(struct __sanitizer_aiocb)); 3218 } 3219 } 3220 } 3221 if (timeout_) { 3222 PRE_READ(timeout_, struct_timespec_sz); 3223 } 3224} 3225POST_SYSCALL(__aio_suspend50) 3226(long long res, void *list_, long long nent_, void *timeout_) {} 3227PRE_SYSCALL(__stat50)(void *path_, void *ub_) { 3228 const char *path = (const char *)path_; 3229 if (path) { 3230 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3231 } 3232} 3233POST_SYSCALL(__stat50)(long long res, void *path_, void *ub_) { 3234 const char *path = (const char *)path_; 3235 if (res == 0) { 3236 if (path) { 3237 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3238 } 3239 } 3240} 3241PRE_SYSCALL(__fstat50)(long long fd_, void *sb_) { /* Nothing to do */ } 3242POST_SYSCALL(__fstat50)(long long res, long long fd_, void *sb_) { 3243 /* Nothing to do */ 3244} 3245PRE_SYSCALL(__lstat50)(void *path_, void *ub_) { 3246 const char *path = (const char *)path_; 3247 if (path) { 3248 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3249 } 3250} 3251POST_SYSCALL(__lstat50)(long long res, void *path_, void *ub_) { 3252 const char *path = (const char *)path_; 3253 if (res == 0) { 3254 if (path) { 3255 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3256 } 3257 } 3258} 3259PRE_SYSCALL(____semctl50) 3260(long long semid_, long long semnum_, long long cmd_, void *arg_) { 3261 /* Nothing to do */ 3262} 3263POST_SYSCALL(____semctl50) 3264(long long res, long long semid_, long long semnum_, long long cmd_, 3265 void *arg_) { 3266 /* Nothing to do */ 3267} 3268PRE_SYSCALL(__shmctl50)(long long shmid_, long long cmd_, void *buf_) { 3269 /* Nothing to do */ 3270} 3271POST_SYSCALL(__shmctl50) 3272(long long res, long long shmid_, long long cmd_, void *buf_) { 3273 /* Nothing to do */ 3274} 3275PRE_SYSCALL(__msgctl50)(long long msqid_, long long cmd_, void *buf_) { 3276 /* Nothing to do */ 3277} 3278POST_SYSCALL(__msgctl50) 3279(long long res, long long msqid_, long long cmd_, void *buf_) { 3280 /* Nothing to do */ 3281} 3282PRE_SYSCALL(__getrusage50)(long long who_, void *rusage_) { 3283 /* Nothing to do */ 3284} 3285POST_SYSCALL(__getrusage50)(long long res, long long who_, void *rusage_) { 3286 /* Nothing to do */ 3287} 3288PRE_SYSCALL(__timer_settime50) 3289(long long timerid_, long long flags_, void *value_, void *ovalue_) { 3290 struct __sanitizer_itimerval *value = (struct __sanitizer_itimerval *)value_; 3291 if (value) { 3292 PRE_READ(&value->it_interval.tv_sec, sizeof(__sanitizer_time_t)); 3293 PRE_READ(&value->it_interval.tv_usec, sizeof(__sanitizer_suseconds_t)); 3294 PRE_READ(&value->it_value.tv_sec, sizeof(__sanitizer_time_t)); 3295 PRE_READ(&value->it_value.tv_usec, sizeof(__sanitizer_suseconds_t)); 3296 } 3297} 3298POST_SYSCALL(__timer_settime50) 3299(long long res, long long timerid_, long long flags_, void *value_, 3300 void *ovalue_) { 3301 struct __sanitizer_itimerval *value = (struct __sanitizer_itimerval *)value_; 3302 if (res == 0) { 3303 if (value) { 3304 POST_READ(&value->it_interval.tv_sec, sizeof(__sanitizer_time_t)); 3305 POST_READ(&value->it_interval.tv_usec, sizeof(__sanitizer_suseconds_t)); 3306 POST_READ(&value->it_value.tv_sec, sizeof(__sanitizer_time_t)); 3307 POST_READ(&value->it_value.tv_usec, sizeof(__sanitizer_suseconds_t)); 3308 } 3309 } 3310} 3311PRE_SYSCALL(__timer_gettime50)(long long timerid_, void *value_) { 3312 /* Nothing to do */ 3313} 3314POST_SYSCALL(__timer_gettime50) 3315(long long res, long long timerid_, void *value_) { 3316 /* Nothing to do */ 3317} 3318#if defined(NTP) || !defined(_KERNEL_OPT) 3319PRE_SYSCALL(__ntp_gettime50)(void *ntvp_) { /* Nothing to do */ } 3320POST_SYSCALL(__ntp_gettime50)(long long res, void *ntvp_) { 3321 /* Nothing to do */ 3322} 3323#else 3324/* syscall 448 has been skipped */ 3325#endif 3326PRE_SYSCALL(__wait450) 3327(long long pid_, void *status_, long long options_, void *rusage_) { 3328 /* Nothing to do */ 3329} 3330POST_SYSCALL(__wait450) 3331(long long res, long long pid_, void *status_, long long options_, 3332 void *rusage_) { 3333 /* Nothing to do */ 3334} 3335PRE_SYSCALL(__mknod50)(void *path_, long long mode_, long long dev_) { 3336 const char *path = (const char *)path_; 3337 if (path) { 3338 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3339 } 3340} 3341POST_SYSCALL(__mknod50) 3342(long long res, void *path_, long long mode_, long long dev_) { 3343 const char *path = (const char *)path_; 3344 if (res == 0) { 3345 if (path) { 3346 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3347 } 3348 } 3349} 3350PRE_SYSCALL(__fhstat50)(void *fhp_, long long fh_size_, void *sb_) { 3351 if (fhp_) { 3352 PRE_READ(fhp_, fh_size_); 3353 } 3354} 3355POST_SYSCALL(__fhstat50) 3356(long long res, void *fhp_, long long fh_size_, void *sb_) { 3357 if (res == 0) { 3358 if (fhp_) { 3359 POST_READ(fhp_, fh_size_); 3360 } 3361 } 3362} 3363/* syscall 452 has been skipped */ 3364PRE_SYSCALL(pipe2)(void *fildes_, long long flags_) { /* Nothing to do */ } 3365POST_SYSCALL(pipe2)(long long res, void *fildes_, long long flags_) { 3366 /* Nothing to do */ 3367} 3368PRE_SYSCALL(dup3)(long long from_, long long to_, long long flags_) { 3369 /* Nothing to do */ 3370} 3371POST_SYSCALL(dup3) 3372(long long res, long long from_, long long to_, long long flags_) { 3373 /* Nothing to do */ 3374} 3375PRE_SYSCALL(kqueue1)(long long flags_) { /* Nothing to do */ } 3376POST_SYSCALL(kqueue1)(long long res, long long flags_) { /* Nothing to do */ } 3377PRE_SYSCALL(paccept) 3378(long long s_, void *name_, void *anamelen_, void *mask_, long long flags_) { 3379 if (mask_) { 3380 PRE_READ(mask_, sizeof(__sanitizer_sigset_t)); 3381 } 3382} 3383POST_SYSCALL(paccept) 3384(long long res, long long s_, void *name_, void *anamelen_, void *mask_, 3385 long long flags_) { 3386 if (res >= 0) { 3387 if (mask_) { 3388 PRE_READ(mask_, sizeof(__sanitizer_sigset_t)); 3389 } 3390 } 3391} 3392PRE_SYSCALL(linkat) 3393(long long fd1_, void *name1_, long long fd2_, void *name2_, long long flags_) { 3394 const char *name1 = (const char *)name1_; 3395 const char *name2 = (const char *)name2_; 3396 if (name1) { 3397 PRE_READ(name1, __sanitizer::internal_strlen(name1) + 1); 3398 } 3399 if (name2) { 3400 PRE_READ(name2, __sanitizer::internal_strlen(name2) + 1); 3401 } 3402} 3403POST_SYSCALL(linkat) 3404(long long res, long long fd1_, void *name1_, long long fd2_, void *name2_, 3405 long long flags_) { 3406 const char *name1 = (const char *)name1_; 3407 const char *name2 = (const char *)name2_; 3408 if (res == 0) { 3409 if (name1) { 3410 POST_READ(name1, __sanitizer::internal_strlen(name1) + 1); 3411 } 3412 if (name2) { 3413 POST_READ(name2, __sanitizer::internal_strlen(name2) + 1); 3414 } 3415 } 3416} 3417PRE_SYSCALL(renameat) 3418(long long fromfd_, void *from_, long long tofd_, void *to_) { 3419 const char *from = (const char *)from_; 3420 const char *to = (const char *)to_; 3421 if (from) { 3422 PRE_READ(from, __sanitizer::internal_strlen(from) + 1); 3423 } 3424 if (to) { 3425 PRE_READ(to, __sanitizer::internal_strlen(to) + 1); 3426 } 3427} 3428POST_SYSCALL(renameat) 3429(long long res, long long fromfd_, void *from_, long long tofd_, void *to_) { 3430 const char *from = (const char *)from_; 3431 const char *to = (const char *)to_; 3432 if (res == 0) { 3433 if (from) { 3434 POST_READ(from, __sanitizer::internal_strlen(from) + 1); 3435 } 3436 if (to) { 3437 POST_READ(to, __sanitizer::internal_strlen(to) + 1); 3438 } 3439 } 3440} 3441PRE_SYSCALL(mkfifoat)(long long fd_, void *path_, long long mode_) { 3442 const char *path = (const char *)path_; 3443 if (path) { 3444 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3445 } 3446} 3447POST_SYSCALL(mkfifoat) 3448(long long res, long long fd_, void *path_, long long mode_) { 3449 const char *path = (const char *)path_; 3450 if (res == 0) { 3451 if (path) { 3452 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3453 } 3454 } 3455} 3456PRE_SYSCALL(mknodat) 3457(long long fd_, void *path_, long long mode_, long long PAD_, long long dev_) { 3458 const char *path = (const char *)path_; 3459 if (path) { 3460 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3461 } 3462} 3463POST_SYSCALL(mknodat) 3464(long long res, long long fd_, void *path_, long long mode_, long long PAD_, 3465 long long dev_) { 3466 const char *path = (const char *)path_; 3467 if (res == 0) { 3468 if (path) { 3469 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3470 } 3471 } 3472} 3473PRE_SYSCALL(mkdirat)(long long fd_, void *path_, long long mode_) { 3474 const char *path = (const char *)path_; 3475 if (path) { 3476 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3477 } 3478} 3479POST_SYSCALL(mkdirat) 3480(long long res, long long fd_, void *path_, long long mode_) { 3481 const char *path = (const char *)path_; 3482 if (res == 0) { 3483 if (path) { 3484 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3485 } 3486 } 3487} 3488PRE_SYSCALL(faccessat) 3489(long long fd_, void *path_, long long amode_, long long flag_) { 3490 const char *path = (const char *)path_; 3491 if (path) { 3492 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3493 } 3494} 3495POST_SYSCALL(faccessat) 3496(long long res, long long fd_, void *path_, long long amode_, long long flag_) { 3497 const char *path = (const char *)path_; 3498 if (res == 0) { 3499 if (path) { 3500 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3501 } 3502 } 3503} 3504PRE_SYSCALL(fchmodat) 3505(long long fd_, void *path_, long long mode_, long long flag_) { 3506 const char *path = (const char *)path_; 3507 if (path) { 3508 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3509 } 3510} 3511POST_SYSCALL(fchmodat) 3512(long long res, long long fd_, void *path_, long long mode_, long long flag_) { 3513 const char *path = (const char *)path_; 3514 if (res == 0) { 3515 if (path) { 3516 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3517 } 3518 } 3519} 3520PRE_SYSCALL(fchownat) 3521(long long fd_, void *path_, long long owner_, long long group_, 3522 long long flag_) { 3523 const char *path = (const char *)path_; 3524 if (path) { 3525 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3526 } 3527} 3528POST_SYSCALL(fchownat) 3529(long long res, long long fd_, void *path_, long long owner_, long long group_, 3530 long long flag_) { 3531 const char *path = (const char *)path_; 3532 if (res == 0) { 3533 if (path) { 3534 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3535 } 3536 } 3537} 3538PRE_SYSCALL(fexecve)(long long fd_, void *argp_, void *envp_) { /* TODO */ } 3539POST_SYSCALL(fexecve)(long long res, long long fd_, void *argp_, void *envp_) { 3540 /* TODO */ 3541} 3542PRE_SYSCALL(fstatat)(long long fd_, void *path_, void *buf_, long long flag_) { 3543 const char *path = (const char *)path_; 3544 if (path) { 3545 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3546 } 3547} 3548POST_SYSCALL(fstatat) 3549(long long res, long long fd_, void *path_, void *buf_, long long flag_) { 3550 const char *path = (const char *)path_; 3551 if (path) { 3552 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3553 } 3554} 3555PRE_SYSCALL(utimensat) 3556(long long fd_, void *path_, void *tptr_, long long flag_) { 3557 const char *path = (const char *)path_; 3558 if (path) { 3559 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3560 } 3561 if (tptr_) { 3562 PRE_READ(tptr_, struct_timespec_sz); 3563 } 3564} 3565POST_SYSCALL(utimensat) 3566(long long res, long long fd_, void *path_, void *tptr_, long long flag_) { 3567 const char *path = (const char *)path_; 3568 if (res > 0) { 3569 if (path) { 3570 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3571 } 3572 if (tptr_) { 3573 POST_READ(tptr_, struct_timespec_sz); 3574 } 3575 } 3576} 3577PRE_SYSCALL(openat) 3578(long long fd_, void *path_, long long oflags_, long long mode_) { 3579 const char *path = (const char *)path_; 3580 if (path) { 3581 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3582 } 3583} 3584POST_SYSCALL(openat) 3585(long long res, long long fd_, void *path_, long long oflags_, 3586 long long mode_) { 3587 const char *path = (const char *)path_; 3588 if (res > 0) { 3589 if (path) { 3590 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3591 } 3592 } 3593} 3594PRE_SYSCALL(readlinkat) 3595(long long fd_, void *path_, void *buf_, long long bufsize_) { 3596 const char *path = (const char *)path_; 3597 if (path) { 3598 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3599 } 3600} 3601POST_SYSCALL(readlinkat) 3602(long long res, long long fd_, void *path_, void *buf_, long long bufsize_) { 3603 const char *path = (const char *)path_; 3604 if (res > 0) { 3605 if (path) { 3606 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3607 } 3608 } 3609} 3610PRE_SYSCALL(symlinkat)(void *path1_, long long fd_, void *path2_) { 3611 const char *path1 = (const char *)path1_; 3612 const char *path2 = (const char *)path2_; 3613 if (path1) { 3614 PRE_READ(path1, __sanitizer::internal_strlen(path1) + 1); 3615 } 3616 if (path2) { 3617 PRE_READ(path2, __sanitizer::internal_strlen(path2) + 1); 3618 } 3619} 3620POST_SYSCALL(symlinkat) 3621(long long res, void *path1_, long long fd_, void *path2_) { 3622 const char *path1 = (const char *)path1_; 3623 const char *path2 = (const char *)path2_; 3624 if (res == 0) { 3625 if (path1) { 3626 POST_READ(path1, __sanitizer::internal_strlen(path1) + 1); 3627 } 3628 if (path2) { 3629 POST_READ(path2, __sanitizer::internal_strlen(path2) + 1); 3630 } 3631 } 3632} 3633PRE_SYSCALL(unlinkat)(long long fd_, void *path_, long long flag_) { 3634 const char *path = (const char *)path_; 3635 if (path) { 3636 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3637 } 3638} 3639POST_SYSCALL(unlinkat) 3640(long long res, long long fd_, void *path_, long long flag_) { 3641 const char *path = (const char *)path_; 3642 if (res == 0) { 3643 if (path) { 3644 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3645 } 3646 } 3647} 3648PRE_SYSCALL(futimens)(long long fd_, void *tptr_) { 3649 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_; 3650 if (tptr) { 3651 PRE_READ(tptr[0], struct_timespec_sz); 3652 PRE_READ(tptr[1], struct_timespec_sz); 3653 } 3654} 3655POST_SYSCALL(futimens)(long long res, long long fd_, void *tptr_) { 3656 struct __sanitizer_timespec **tptr = (struct __sanitizer_timespec **)tptr_; 3657 if (res == 0) { 3658 if (tptr) { 3659 POST_READ(tptr[0], struct_timespec_sz); 3660 POST_READ(tptr[1], struct_timespec_sz); 3661 } 3662 } 3663} 3664PRE_SYSCALL(__quotactl)(void *path_, void *args_) { 3665 const char *path = (const char *)path_; 3666 if (path) { 3667 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3668 } 3669} 3670POST_SYSCALL(__quotactl)(long long res, void *path_, void *args_) { 3671 const char *path = (const char *)path_; 3672 if (res == 0) { 3673 if (path) { 3674 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3675 } 3676 } 3677} 3678PRE_SYSCALL(posix_spawn) 3679(void *pid_, void *path_, void *file_actions_, void *attrp_, void *argv_, 3680 void *envp_) { 3681 const char *path = (const char *)path_; 3682 if (path) { 3683 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3684 } 3685} 3686POST_SYSCALL(posix_spawn) 3687(long long res, void *pid_, void *path_, void *file_actions_, void *attrp_, 3688 void *argv_, void *envp_) { 3689 const char *path = (const char *)path_; 3690 if (pid_) { 3691 if (path) { 3692 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3693 } 3694 } 3695} 3696PRE_SYSCALL(recvmmsg) 3697(long long s_, void *mmsg_, long long vlen_, long long flags_, void *timeout_) { 3698 if (timeout_) { 3699 PRE_READ(timeout_, struct_timespec_sz); 3700 } 3701} 3702POST_SYSCALL(recvmmsg) 3703(long long res, long long s_, void *mmsg_, long long vlen_, long long flags_, 3704 void *timeout_) { 3705 if (res >= 0) { 3706 if (timeout_) { 3707 POST_READ(timeout_, struct_timespec_sz); 3708 } 3709 } 3710} 3711PRE_SYSCALL(sendmmsg) 3712(long long s_, void *mmsg_, long long vlen_, long long flags_) { 3713 struct __sanitizer_mmsghdr *mmsg = (struct __sanitizer_mmsghdr *)mmsg_; 3714 if (mmsg) { 3715 PRE_READ(mmsg, sizeof(struct __sanitizer_mmsghdr) * 3716 (vlen_ > 1024 ? 1024 : vlen_)); 3717 } 3718} 3719POST_SYSCALL(sendmmsg) 3720(long long res, long long s_, void *mmsg_, long long vlen_, long long flags_) { 3721 struct __sanitizer_mmsghdr *mmsg = (struct __sanitizer_mmsghdr *)mmsg_; 3722 if (res >= 0) { 3723 if (mmsg) { 3724 POST_READ(mmsg, sizeof(struct __sanitizer_mmsghdr) * 3725 (vlen_ > 1024 ? 1024 : vlen_)); 3726 } 3727 } 3728} 3729PRE_SYSCALL(clock_nanosleep) 3730(long long clock_id_, long long flags_, void *rqtp_, void *rmtp_) { 3731 if (rqtp_) { 3732 PRE_READ(rqtp_, struct_timespec_sz); 3733 } 3734} 3735POST_SYSCALL(clock_nanosleep) 3736(long long res, long long clock_id_, long long flags_, void *rqtp_, 3737 void *rmtp_) { 3738 if (rqtp_) { 3739 POST_READ(rqtp_, struct_timespec_sz); 3740 } 3741} 3742PRE_SYSCALL(___lwp_park60) 3743(long long clock_id_, long long flags_, void *ts_, long long unpark_, 3744 void *hint_, void *unparkhint_) { 3745 if (ts_) { 3746 PRE_READ(ts_, struct_timespec_sz); 3747 } 3748} 3749POST_SYSCALL(___lwp_park60) 3750(long long res, long long clock_id_, long long flags_, void *ts_, 3751 long long unpark_, void *hint_, void *unparkhint_) { 3752 if (res == 0) { 3753 if (ts_) { 3754 POST_READ(ts_, struct_timespec_sz); 3755 } 3756 } 3757} 3758PRE_SYSCALL(posix_fallocate) 3759(long long fd_, long long PAD_, long long pos_, long long len_) { 3760 /* Nothing to do */ 3761} 3762POST_SYSCALL(posix_fallocate) 3763(long long res, long long fd_, long long PAD_, long long pos_, long long len_) { 3764 /* Nothing to do */ 3765} 3766PRE_SYSCALL(fdiscard) 3767(long long fd_, long long PAD_, long long pos_, long long len_) { 3768 /* Nothing to do */ 3769} 3770POST_SYSCALL(fdiscard) 3771(long long res, long long fd_, long long PAD_, long long pos_, long long len_) { 3772 /* Nothing to do */ 3773} 3774PRE_SYSCALL(wait6) 3775(long long idtype_, long long id_, void *status_, long long options_, 3776 void *wru_, void *info_) { 3777 /* Nothing to do */ 3778} 3779POST_SYSCALL(wait6) 3780(long long res, long long idtype_, long long id_, void *status_, 3781 long long options_, void *wru_, void *info_) { 3782 /* Nothing to do */ 3783} 3784PRE_SYSCALL(clock_getcpuclockid2) 3785(long long idtype_, long long id_, void *clock_id_) { 3786 /* Nothing to do */ 3787} 3788POST_SYSCALL(clock_getcpuclockid2) 3789(long long res, long long idtype_, long long id_, void *clock_id_) { 3790 /* Nothing to do */ 3791} 3792PRE_SYSCALL(__getvfsstat90)(void *buf_, long long bufsize_, long long flags_) { 3793 /* Nothing to do */ 3794} 3795POST_SYSCALL(__getvfsstat90) 3796(long long res, void *buf_, long long bufsize_, long long flags_) { 3797 /* Nothing to do */ 3798} 3799PRE_SYSCALL(__statvfs190)(void *path_, void *buf_, long long flags_) { 3800 const char *path = (const char *)path_; 3801 if (path) { 3802 PRE_READ(path, __sanitizer::internal_strlen(path) + 1); 3803 } 3804} 3805POST_SYSCALL(__statvfs190) 3806(long long res, void *path_, void *buf_, long long flags_) { 3807 const char *path = (const char *)path_; 3808 if (path) { 3809 POST_READ(path, __sanitizer::internal_strlen(path) + 1); 3810 } 3811} 3812PRE_SYSCALL(__fstatvfs190)(long long fd_, void *buf_, long long flags_) { 3813 /* Nothing to do */ 3814} 3815POST_SYSCALL(__fstatvfs190) 3816(long long res, long long fd_, void *buf_, long long flags_) { 3817 /* Nothing to do */ 3818} 3819PRE_SYSCALL(__fhstatvfs190) 3820(void *fhp_, long long fh_size_, void *buf_, long long flags_) { 3821 if (fhp_) { 3822 PRE_READ(fhp_, fh_size_); 3823 } 3824} 3825POST_SYSCALL(__fhstatvfs190) 3826(long long res, void *fhp_, long long fh_size_, void *buf_, long long flags_) {} 3827#undef SYS_MAXSYSARGS 3828} // extern "C" 3829 3830#undef PRE_SYSCALL 3831#undef PRE_READ 3832#undef PRE_WRITE 3833#undef POST_SYSCALL 3834#undef POST_READ 3835#undef POST_WRITE 3836 3837#endif // SANITIZER_NETBSD 3838