/* * Copyright (c) 2018-2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // Kernel internal options. #define O_NOFOLLOW_NOERROR (1 << 29) #define O_UNLINK_INTERNAL (1 << 30) // Avoid interference with AK/Types.h and LibC/sys/types.h by defining *separate* names: TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessID); TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ThreadID); TYPEDEF_DISTINCT_ORDERED_ID(pid_t, SessionID); TYPEDEF_DISTINCT_ORDERED_ID(pid_t, ProcessGroupID); typedef i64 off_t; typedef i64 time_t; typedef u32 blksize_t; typedef u32 blkcnt_t; typedef u32 __u32; typedef u16 __u16; typedef u8 __u8; typedef int __s32; typedef short __s16; typedef u32 useconds_t; typedef i32 suseconds_t; struct timeval { time_t tv_sec; suseconds_t tv_usec; }; struct iovec { void* iov_base; size_t iov_len; }; struct sched_param { int sched_priority; }; #define PT_TRACE_ME 1 #define PT_ATTACH 2 #define PT_CONTINUE 3 #define PT_SYSCALL 4 #define PT_GETREGS 5 #define PT_DETACH 6 #define PT_PEEK 7 #define PT_POKE 8 #define PT_SETREGS 9 #define PT_POKEDEBUG 10 #define PT_PEEKDEBUG 11 typedef uint64_t fsblkcnt_t; typedef uint64_t fsfilcnt_t; #define ST_RDONLY 0x1 #define ST_NOSUID 0x2 struct statvfs { unsigned long f_bsize; unsigned long f_frsize; fsblkcnt_t f_blocks; fsblkcnt_t f_bfree; fsblkcnt_t f_bavail; fsfilcnt_t f_files; fsfilcnt_t f_ffree; fsfilcnt_t f_favail; unsigned long f_fsid; unsigned long f_flag; unsigned long f_namemax; };