From 2a3bc68ba7ff5b6d465f87cd3b096cf7b150c340 Mon Sep 17 00:00:00 2001 From: Marvin Friedrich Date: Tue, 13 Oct 2026 01:53:44 +0200 Subject: [PATCH] more uapi bits --- include/uapi/fcntl.h | 44 +++++++++++++++++++++++++++++++++++++++++++ include/uapi/ioctls.h | 7 +++++++ include/uapi/stat.h | 3 +++ include/uapi/wait.h | 12 ++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 include/uapi/ioctls.h create mode 100644 include/uapi/wait.h diff --git a/include/uapi/fcntl.h b/include/uapi/fcntl.h index 83068c1..8373d6c 100644 --- a/include/uapi/fcntl.h +++ b/include/uapi/fcntl.h @@ -2,6 +2,8 @@ #ifndef __ZINNIA_UAPI_FCNTL_H #define __ZINNIA_UAPI_FCNTL_H +#include + #define __F_OK 0 #define __X_OK 1 #define __W_OK 2 @@ -40,4 +42,46 @@ #define __AT_EACCESS (1 << 11) #define __AT_EMPTY_PATH (1 << 12) +#define __F_DUPFD 0 +#define __F_GETFD 1 +#define __F_SETFD 2 +#define __F_GETFL 3 +#define __F_SETFL 4 +#define __F_GETLK 5 +#define __F_SETLK 6 +#define __F_SETLKW 7 +#define __F_SETOWN 8 +#define __F_GETOWN 9 +#define __F_SETOWN_EX 15 +#define __F_GETOWN_EX 16 +#define __F_OFD_GETLK 36 +#define __F_OFD_SETLK 37 +#define __F_OFD_SETLKW 38 +#define __F_DUPFD_CLOEXEC 1030 + +#define __F_RDLCK 0 +#define __F_WRLCK 1 +#define __F_UNLCK 2 + +#define __FD_CLOEXEC 1 + +#define __SEEK_SET 0 +#define __SEEK_CUR 1 +#define __SEEK_END 2 + +#define __POSIX_FADV_NORMAL 0 +#define __POSIX_FADV_RANDOM 1 +#define __POSIX_FADV_SEQUENTIAL 2 +#define __POSIX_FADV_WILLNEED 3 +#define __POSIX_FADV_DONTNEED 4 +#define __POSIX_FADV_NOREUSE 5 + +struct __flock { + int16_t l_type; + int16_t l_whence; + __off_t l_start; + __off_t l_len; + __pid_t l_pid; +}; + #endif diff --git a/include/uapi/ioctls.h b/include/uapi/ioctls.h new file mode 100644 index 0000000..b838d6c --- /dev/null +++ b/include/uapi/ioctls.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: Unlicense */ +#ifndef __ZINNIA_UAPI_IOCTLS_H +#define __ZINNIA_UAPI_IOCTLS_H + +#define __FIONBIO 0x5421 + +#endif diff --git a/include/uapi/stat.h b/include/uapi/stat.h index 4a0f7b5..f3aa853 100644 --- a/include/uapi/stat.h +++ b/include/uapi/stat.h @@ -32,6 +32,9 @@ #define __S_IWRITE __S_IWUSR #define __S_IEXEC __S_IXUSR +#define __UTIME_NOW ((1l << 30) - 1l) +#define __UTIME_OMIT ((1l << 30) - 2l) + struct __stat { __dev_t st_dev; __ino_t st_ino; diff --git a/include/uapi/wait.h b/include/uapi/wait.h new file mode 100644 index 0000000..41a46ab --- /dev/null +++ b/include/uapi/wait.h @@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: Unlicense */ +#ifndef __ZINNIA_UAPI_WAIT_H +#define __ZINNIA_UAPI_WAIT_H + +#define __WNOHANG 1 +#define __WUNTRACED 2 +#define __WSTOPPED 2 +#define __WEXITED 4 +#define __WCONTINUED 8 +#define __WNOWAIT 0x01000000 + +#endif