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