# Copyright 2021 syzkaller project authors. All rights reserved. # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. include include include include resource fd[int32]: 0xffffffffffffffff, AT_FDCWD resource fd_dir[fd] resource pid[int32]: 0, 0xffffffffffffffff resource uid[int32]: 0, 0xffffffffffffffff resource gid[int32]: 0, 0xffffffffffffffff open(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd # Just so that we have something that creates fd_dir resources. open$dir(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd_dir openat(fd fd_dir[opt], file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd close(fd fd) read(fd fd, buf buffer[out], count len[buf]) readv(fd fd, vec ptr[in, array[iovec_out]], vlen len[vec]) write(fd fd, buf buffer[in], count len[buf]) writev(fd fd, vec ptr[in, array[iovec_in]], vlen len[vec]) lseek(fd fd, offset fileoff, whence flags[seek_whence]) dup(oldfd fd) fd dup2(oldfd fd, newfd fd) fd fstat(fd fd, statbuf ptr[out, stat]) pathconf(file ptr[in, filename], name flags[conf_value]) fpathconf(fd fd, name flags[conf_value]) iovec_in { addr buffer[in] len len[addr, intptr] } iovec_out { addr buffer[out] len len[addr, intptr] } stat { dev int64 ino int64 nlink int64 mode int16 __pad0 const[0, int16] uid uid gid gid __pad1 const[0, int32] rdev int64 atime int64 ansec int64 mtime int64 mnsec int64 ctime int64 cnsec int64 btime int64 bnsec int64 size int64 blocks int64 blksize int32 flags int32 gen int64 __spare array[int64, 10] } open_flags = O_RDONLY, O_WRONLY, O_RDWR, O_NONBLOCK, O_APPEND, O_CREAT, O_TRUNC, O_EXCL, O_SHLOCK, O_EXLOCK, O_NOFOLLOW, O_SYMLINK, O_EVTONLY, O_CLOEXEC, O_NOFOLLOW_ANY open_mode = S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH seek_whence = SEEK_SET, SEEK_CUR, SEEK_END, SEEK_DATA, SEEK_HOLE conf_value = _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, _PC_XATTR_SIZE_BITS, _PC_MIN_HOLE_SIZE