github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/darwin/sys.txt (about)

     1  # Copyright 2021 syzkaller project authors. All rights reserved.
     2  # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  include <sys/types.h>
     5  include <sys/mman.h>
     6  include <sys/proc.h>
     7  include <sys/stat.h>
     8  include <fcntl.h>
     9  include <unistd.h>
    10  include <poll.h>
    11  include <sys/socket.h>
    12  include <sys/uio.h>
    13  include <sys/param.h>
    14  include <sys/mount.h>
    15  include <sys/resource.h>
    16  include <time.h>
    17  include <signal.h>
    18  include <sys/wait.h>
    19  
    20  syz_execute_func(text ptr[in, text[target]]) (disabled)
    21  
    22  poll(fds ptr[in, array[pollfd]], nfds len[fds], timeout int32)
    23  select(n len[inp], inp ptr[inout, fd_set], outp ptr[inout, fd_set], exp ptr[inout, fd_set], tvp ptr[inout, timeval])
    24  
    25  mincore(addr vma, size len[addr], vec buffer[out])
    26  
    27  fcntl$dupfd(fd fd, cmd flags[fcntl_dupfd], arg fd) fd
    28  fcntl$getflags(fd fd, cmd flags[fcntl_getflags])
    29  fcntl$setflags(fd fd, cmd const[F_SETFD], flags flags[fcntl_flags])
    30  fcntl$setstatus(fd fd, cmd const[F_SETFL], flags flags[fcntl_status])
    31  fcntl$lock(fd fd, cmd flags[fcntl_lock], lock ptr[in, flock])
    32  fcntl$getown(fd fd, cmd const[F_GETOWN]) pid
    33  fcntl$setown(fd fd, cmd const[F_SETOWN], pid pid)
    34  
    35  mknod(file ptr[in, filename], mode flags[mknod_mode], dev int32)
    36  chmod(file ptr[in, filename], mode flags[open_mode])
    37  fchmod(fd fd, mode flags[open_mode])
    38  fchmodat(dirfd fd_dir, file ptr[in, filename], mode flags[open_mode])
    39  chown(file ptr[in, filename], uid uid, gid gid)
    40  lchown(file ptr[in, filename], uid uid, gid gid)
    41  fchown(fd fd, uid uid, gid gid)
    42  fchownat(dirfd fd_dir, file ptr[in, filename], uid uid, gid gid, flags flags[at_flags])
    43  chflags(file ptr[in, filename], flags flags[chflags_flags])
    44  fchflags(fd fd, flags flags[chflags_flags])
    45  faccessat(dirfd fd_dir, pathname ptr[in, filename], mode flags[open_mode], flags flags[faccessat_flags])
    46  utimes(filename ptr[in, filename], times ptr[in, itimerval])
    47  
    48  execve(file ptr[in, filename], argv ptr[in, array[ptr[in, string]]], envp ptr[in, array[ptr[in, string]]])
    49  
    50  getgid() gid
    51  getegid() gid
    52  setuid(uid uid)
    53  setgid(gid gid)
    54  getuid() uid
    55  geteuid() uid
    56  setpgid(pid pid, pgid pid)
    57  getpgid(pid pid) pid
    58  getpgrp(pid pid) pid
    59  getpid() pid
    60  setreuid(ruid uid, euid uid)
    61  setregid(rgid gid, egid gid)
    62  getgroups(size len[list], list ptr[inout, array[gid]])
    63  setgroups(size len[list], list ptr[in, array[gid]])
    64  
    65  link(old ptr[in, filename], new ptr[in, filename])
    66  linkat(oldfd fd_dir, old ptr[in, filename], newfd fd_dir, new ptr[in, filename], flags flags[linkat_flags])
    67  symlinkat(old ptr[in, filename], newfd fd_dir, new ptr[in, filename])
    68  symlink(old ptr[in, filename], new ptr[in, filename])
    69  unlink(path ptr[in, filename])
    70  unlinkat(fd fd_dir, path ptr[in, filename], flags flags[unlinkat_flags])
    71  readlink(path ptr[in, filename], buf buffer[out], siz len[buf])
    72  readlinkat(fd fd_dir, path ptr[in, filename], buf buffer[out], siz len[buf])
    73  rename(old ptr[in, filename], new ptr[in, filename])
    74  renameat(oldfd fd_dir, old ptr[in, filename], newfd fd_dir, new ptr[in, filename])
    75  mkdir(path ptr[in, filename], mode flags[open_mode])
    76  mkdirat(fd fd_dir, path ptr[in, filename], mode flags[open_mode])
    77  rmdir(path ptr[in, filename])
    78  truncate(file ptr[in, filename], len intptr)
    79  ftruncate(fd fd, len intptr)
    80  flock(fd fd, op flags[flock_op])
    81  fsync(fd fd)
    82  fdatasync(fd fd)
    83  sync()
    84  chroot(dir ptr[in, filename])
    85  chdir(dir ptr[in, filename])
    86  fchdir(fd fd)
    87  undelete(path ptr[in, filename])
    88  
    89  getrusage(who flags[rusage_who], usage ptr[out, rusage])
    90  getrlimit(res flags[rlimit_type], rlim ptr[out, rlimit])
    91  setrlimit(res flags[rlimit_type], rlim ptr[in, rlimit])
    92  
    93  sigaltstack(ss vma, oss ptr[out, intptr, opt])
    94  getitimer(which flags[getitimer_which], cur ptr[out, itimerval])
    95  setitimer(which flags[getitimer_which], new ptr[in, itimerval], old ptr[out, itimerval, opt])
    96  exit(code intptr)
    97  wait4(pid pid, status ptr[out, int32, opt], options flags[wait_options], ru ptr[out, rusage, opt])
    98  
    99  pollfd {
   100  	fd	fd
   101  	events	flags[pollfd_events, int16]
   102  	revents	const[0, int16]
   103  }
   104  
   105  timespec {
   106  	sec	intptr
   107  	nsec	intptr
   108  }
   109  
   110  timeval {
   111  	sec	intptr
   112  	usec	intptr
   113  }
   114  
   115  itimerval {
   116  	interv	timeval
   117  	value	timeval
   118  }
   119  
   120  # TODO: fd_set needs to be a separate type
   121  fd_set {
   122  	mask0	int64
   123  	mask1	int64
   124  	mask2	int64
   125  	mask3	int64
   126  	mask4	int64
   127  	mask5	int64
   128  	mask6	int64
   129  	mask7	int64
   130  }
   131  
   132  rusage {
   133  	utime	timeval
   134  	stime	timeval
   135  	maxrss	intptr
   136  	ixrss	intptr
   137  	idrss	intptr
   138  	isrss	intptr
   139  	minflt	intptr
   140  	majflt	intptr
   141  	nswap	intptr
   142  	inblock	intptr
   143  	oublock	intptr
   144  	msgsnd	intptr
   145  	msgrcv	intptr
   146  	signals	intptr
   147  	nvcsw	intptr
   148  	nivcsw	intptr
   149  }
   150  
   151  rlimit {
   152  	soft	intptr
   153  	hard	intptr
   154  }
   155  
   156  flock {
   157  	type	flags[flock_type, int16]
   158  	whence	flags[seek_whence, int16]
   159  	start	intptr
   160  	len	intptr
   161  	pid	pid
   162  }
   163  
   164  linger {
   165  	onoff	int32
   166  	linger	int32
   167  }
   168  
   169  pollfd_events = POLLIN, POLLPRI, POLLOUT, POLLERR, POLLHUP, POLLNVAL, POLLRDNORM, POLLRDBAND, POLLWRNORM, POLLWRBAND
   170  mknod_mode = S_IFREG, S_IFCHR, S_IFBLK, S_IFIFO, S_IFSOCK, open_mode
   171  at_flags = AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW
   172  linkat_flags = AT_SYMLINK_FOLLOW
   173  unlinkat_flags = 0, AT_REMOVEDIR
   174  flock_op = LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB
   175  faccessat_flags = AT_EACCESS, AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW, AT_REMOVEDIR
   176  rusage_who = RUSAGE_SELF, RUSAGE_CHILDREN
   177  rlimit_type = RLIMIT_AS, RLIMIT_CORE, RLIMIT_CPU, RLIMIT_DATA, RLIMIT_FSIZE, RLIMIT_MEMLOCK, RLIMIT_NOFILE, RLIMIT_NPROC, RLIMIT_RSS, RLIMIT_STACK
   178  getitimer_which = ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF
   179  wait_options = WNOHANG, WUNTRACED, WCONTINUED, WEXITED, WSTOPPED, WCONTINUED, WNOHANG, WNOWAIT
   180  fcntl_dupfd = F_DUPFD, F_DUPFD_CLOEXEC
   181  fcntl_getflags = F_GETFD, F_GETFL
   182  fcntl_lock = F_SETLK, F_SETLKW, F_GETLK
   183  fcntl_flags = FD_CLOEXEC
   184  fcntl_status = O_APPEND, FASYNC, O_NONBLOCK
   185  flock_type = F_RDLCK, F_WRLCK, F_UNLCK
   186  chflags_flags = SF_APPEND, SF_ARCHIVED, SF_IMMUTABLE, SF_NOUNLINK