libc: add linux headers

Yeah

Signed-off-by: kaguya <vpshinomiya@protonmail.com>
This commit is contained in:
kaguya
2026-05-03 00:48:24 -04:00
parent ef14a52b49
commit f7aa6f913a
43 changed files with 1550 additions and 3 deletions
+66
View File
@@ -0,0 +1,66 @@
#ifndef _SYS_EPOLL_H
#define _SYS_EPOLL_H
#include <stdint.h>
#include <abi-bits/signal.h>
#include <abi-bits/epoll.h>
#include <abi-bits/fcntl.h>
#define EPOLL_NONBLOCK O_NONBLOCK
/* These constants match the Linux definitions. */
#define EPOLLIN 0x001
#define EPOLLPRI 0x002
#define EPOLLOUT 0x004
#define EPOLLRDNORM 0x040
#define EPOLLRDBAND 0x080
#define EPOLLWRNORM 0x100
#define EPOLLWRBAND 0x200
#define EPOLLMSG 0x400
#define EPOLLERR 0x008
#define EPOLLHUP 0x010
#define EPOLLRDHUP 0x2000
#define EPOLLEXCLUSIVE (1U << 28)
#define EPOLLWAKEUP (1U << 29)
#define EPOLLONESHOT (1U << 30)
#define EPOLLET (1U << 31)
#define EPOLL_CTL_ADD 1
#define EPOLL_CTL_DEL 2
#define EPOLL_CTL_MOD 3
#ifdef __cplusplus
extern "C" {
#endif
typedef union epoll_data {
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
struct epoll_event {
uint32_t events;
epoll_data_t data;
}
#ifdef __x86_64__
__attribute__((__packed__))
#endif
;
#ifndef __MLIBC_ABI_ONLY
int epoll_create(int __flags);
int epoll_create1(int __flags);
int epoll_ctl(int __epfd, int __mode, int __fd, struct epoll_event *__ev);
int epoll_wait(int __epfd, struct epoll_event *__events, int __maxevents, int __timeout);
int epoll_pwait(int __epfd, struct epoll_event *__events, int __maxevents, int __timeout, const sigset_t *__sigmask);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_EPOLL_H */
+29
View File
@@ -0,0 +1,29 @@
#ifndef _SYS_EVENTFD_H
#define _SYS_EVENTFD_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <fcntl.h>
typedef uint64_t eventfd_t;
#define EFD_SEMAPHORE 1
#define EFD_CLOEXEC O_CLOEXEC
#define EFD_NONBLOCK O_NONBLOCK
#ifndef __MLIBC_ABI_ONLY
int eventfd(unsigned int __initval, int __flags);
int eventfd_read(int __fd, eventfd_t *__value);
int eventfd_write(int __fd, eventfd_t __value);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_EVENTFD_H */
+22
View File
@@ -0,0 +1,22 @@
#ifndef _SYS_FSUID_H
#define _SYS_FSUID_H
#include <abi-bits/uid_t.h>
#include <abi-bits/gid_t.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MLIBC_ABI_ONLY
int setfsuid(uid_t __uid);
int setfsgid(gid_t __gid);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FSUID_H */
+71
View File
@@ -0,0 +1,71 @@
#ifndef _SYS_INOTIFY_H
#define _SYS_INOTIFY_H
#include <stdint.h>
#include <abi-bits/fcntl.h>
#include <abi-bits/inotify.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IN_ACCESS 0x1
#define IN_ATTRIB 0x4
#define IN_CLOSE_WRITE 0x8
#define IN_CLOSE_NOWRITE 0x10
#define IN_CREATE 0x100
#define IN_DELETE 0x200
#define IN_DELETE_SELF 0x400
#define IN_MODIFY 0x2
#define IN_MOVE_SELF 0x800
#define IN_MOVED_FROM 0x40
#define IN_MOVED_TO 0x80
#define IN_OPEN 0x20
#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO)
#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)
#define IN_DONT_FOLLOW 0x2000000
#define IN_EXCL_UNLINK 0x4000000
#define IN_MASK_ADD 0x20000000
#define IN_ONESHOT 0x80000000
#define IN_ONLYDIR 0x1000000
#define IN_IGNORED 0x8000
#define IN_ISDIR 0x40000000
#define IN_Q_OVERFLOW 0x4000
#define IN_UNMOUNT 0x2000
#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
IN_MOVE_SELF)
struct inotify_event {
int wd;
unsigned int mask;
unsigned int cookie;
unsigned int len;
/*
* glibc uses a flexible array member here, but we get a warning and they don't:
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117241
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
char name[];
#pragma GCC diagnostic pop
};
#ifndef __MLIBC_ABI_ONLY
int inotify_init(void);
int inotify_init1(int __flags);
int inotify_add_watch(int __ifd, const char *__path, uint32_t __mask);
int inotify_rm_watch(int __ifd, int __wd);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /*_SYS_INOTIFY_H */
+18
View File
@@ -0,0 +1,18 @@
#ifndef _SYS_KLOG_H
#define _SYS_KLOG_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MLIBC_ABI_ONLY
int klogctl(int __type, char *__bufp, int __len);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_KLOG_H */
+90
View File
@@ -0,0 +1,90 @@
#ifndef _SYS_MOUNT_H
#define _SYS_MOUNT_H
#include <sys/ioctl.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MS_RDONLY 1
#define MS_NOSUID 2
#define MS_NODEV 4
#define MS_NOEXEC 8
#define MS_SYNCHRONOUS 16
#define MS_REMOUNT 32
#define MS_MANDLOCK 64
#define MS_DIRSYNC 128
#define MS_NOSYMFOLLOW 256
#define MS_NOATIME 1024
#define MS_NODIRATIME 2048
#define MS_BIND 4096
#define MS_MOVE 8192
#define MS_REC 16384
#define MS_SILENT 32768
#define MS_POSIXACL (1 << 16)
#define MS_UNBINDABLE (1 << 17)
#define MS_PRIVATE (1 << 18)
#define MS_SLAVE (1 << 19)
#define MS_SHARED (1 << 20)
#define MS_RELATIME (1 << 21)
#define MS_KERNMOUNT (1 << 22)
#define MS_I_VERSION (1 << 23)
#define MS_STRICTATIME (1 << 24)
#define MS_LAZYTIME (1 << 25)
#define MS_NOREMOTELOCK (1 << 27)
#define MS_NOSEC (1 << 28)
#define MS_BORN (1 << 29)
#define MS_ACTIVE (1 << 30)
#define MS_NOUSER (1 << 31)
#define MNT_FORCE 1
#define MNT_DETACH 2
#define MNT_EXPIRE 4
#define UMOUNT_NOFOLLOW 8
#undef BLKROSET
#define BLKROSET _IO(0x12, 93)
#undef BLKROGET
#define BLKROGET _IO(0x12, 94)
#undef BLKRRPART
#define BLKRRPART _IO(0x12, 95)
#undef BLKGETSIZE
#define BLKGETSIZE _IO(0x12, 96)
#undef BLKFLSBUF
#define BLKFLSBUF _IO(0x12, 97)
#undef BLKRASET
#define BLKRASET _IO(0x12, 98)
#undef BLKRAGET
#define BLKRAGET _IO(0x12, 99)
#undef BLKFRASET
#define BLKFRASET _IO(0x12, 100)
#undef BLKFRAGET
#define BLKFRAGET _IO(0x12, 101)
#undef BLKSECTSET
#define BLKSECTSET _IO(0x12, 102)
#undef BLKSECTGET
#define BLKSECTGET _IO(0x12, 103)
#undef BLKSSZGET
#define BLKSSZGET _IO(0x12, 104)
#undef BLKBSZGET
#define BLKBSZGET _IOR(0x12, 112, size_t)
#undef BLKBSZSET
#define BLKBSZSET _IOW(0x12, 113, size_t)
#undef BLKGETSIZE64
#define BLKGETSIZE64 _IOR(0x12, 114, size_t)
#ifndef __MLIBC_ABI_ONLY
int mount(const char *__source, const char *__target,
const char *__fstype, unsigned long __flags, const void *__data);
int umount(const char *__target);
int umount2(const char *__target, int __flags);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_MOUNT_H */
+26
View File
@@ -0,0 +1,26 @@
#ifndef _SYS_PIDFD_H
#define _SYS_PIDFD_H
#include <abi-bits/fcntl.h>
#include <abi-bits/pid_t.h>
#include <abi-bits/signal.h>
#define PIDFD_NONBLOCK O_NONBLOCK
#ifndef __MLIBC_ABI_ONLY
#ifdef __cplusplus
extern "C" {
#endif
int pidfd_open(pid_t __pid, unsigned int __flags);
pid_t pidfd_getpid(int __fd);
int pidfd_send_signal(int __pidfd, int __sig, siginfo_t *__info, unsigned int __flags);
#ifdef __cplusplus
}
#endif
#endif /* !__MLIBC_ABI_ONLY */
#endif /* _SYS_PIDFD_H */
+128
View File
@@ -0,0 +1,128 @@
#ifndef _SYS_PRCTL_H
#define _SYS_PRCTL_H
#include <stdint.h>
#define PR_SET_PDEATHSIG 1
#define PR_GET_PDEATHSIG 2
#define PR_GET_DUMPABLE 3
#define PR_SET_DUMPABLE 4
#define PR_GET_UNALIGN 5
#define PR_SET_UNALIGN 6
#define PR_UNALIGN_NOPRINT 1
#define PR_UNALIGN_SIGBUS 2
#define PR_GET_KEEPCAPS 7
#define PR_SET_KEEPCAPS 8
#define PR_GET_FPEMU 9
#define PR_SET_FPEMU 10
#define PR_FPEMU_NOPRINT 1
#define PR_FPEMU_SIGFPE 2
#define PR_GET_FPEXC 11
#define PR_SET_FPEXC 12
#define PR_FP_EXC_SW_ENABLE 0x80
#define PR_FP_EXC_DIV 0x010000
#define PR_FP_EXC_OVF 0x020000
#define PR_FP_EXC_UND 0x040000
#define PR_FP_EXC_RES 0x080000
#define PR_FP_EXC_INV 0x100000
#define PR_FP_EXC_DISABLED 0
#define PR_FP_EXC_NONRECOV 1
#define PR_FP_EXC_ASYNC 2
#define PR_FP_EXC_PRECISE 3
#define PR_GET_TIMING 13
#define PR_SET_TIMING 14
#define PR_TIMING_STATISTICAL 0
#define PR_TIMING_TIMESTAMP 1
#define PR_SET_NAME 15
#define PR_GET_NAME 16
#define PR_GET_ENDIAN 19
#define PR_SET_ENDIAN 20
#define PR_ENDIAN_BIG 0
#define PR_ENDIAN_LITTLE 1
#define PR_ENDIAN_PPC_LITTLE 2
#define PR_GET_SECCOMP 21
#define PR_SET_SECCOMP 22
#define PR_CAPBSET_READ 23
#define PR_CAPBSET_DROP 24
#define PR_GET_TSC 25
#define PR_SET_TSC 26
#define PR_TSC_ENABLE 1
#define PR_TSC_SIGSEGV 2
#define PR_GET_SECUREBITS 27
#define PR_SET_SECUREBITS 28
#define PR_SET_TIMERSLACK 29
#define PR_GET_TIMERSLACK 30
#define PR_TASK_PERF_EVENTS_DISABLE 31
#define PR_TASK_PERF_EVENTS_ENABLE 32
#define PR_MCE_KILL 33
#define PR_MCE_KILL_CLEAR 0
#define PR_MCE_KILL_SET 1
#define PR_MCE_KILL_LATE 0
#define PR_MCE_KILL_EARLY 1
#define PR_MCE_KILL_DEFAULT 2
#define PR_MCE_KILL_GET 34
#define PR_SET_MM 35
#define PR_SET_MM_START_CODE 1
#define PR_SET_MM_END_CODE 2
#define PR_SET_MM_START_DATA 3
#define PR_SET_MM_END_DATA 4
#define PR_SET_MM_START_STACK 5
#define PR_SET_MM_START_BRK 6
#define PR_SET_MM_BRK 7
#define PR_SET_MM_ARG_START 8
#define PR_SET_MM_ARG_END 9
#define PR_SET_MM_ENV_START 10
#define PR_SET_MM_ENV_END 11
#define PR_SET_MM_AUXV 12
#define PR_SET_MM_EXE_FILE 13
#define PR_SET_MM_MAP 14
#define PR_SET_MM_MAP_SIZE 15
#define PR_SET_PTRACER 0x59616d61
#define PR_SET_PTRACER_ANY (-1UL)
#define PR_SET_CHILD_SUBREAPER 36
#define PR_GET_CHILD_SUBREAPER 37
#define PR_SET_NO_NEW_PRIVS 38
#define PR_GET_NO_NEW_PRIVS 39
#define PR_GET_TID_ADDRESS 40
#define PR_SET_THP_DISABLE 41
#define PR_GET_THP_DISABLE 42
#define PR_MPX_ENABLE_MANAGEMENT 43
#define PR_MPX_DISABLE_MANAGEMENT 44
#define PR_SET_FP_MODE 45
#define PR_GET_FP_MODE 46
#define PR_FP_MODE_FR (1 << 0)
#define PR_FP_MODE_FRE (1 << 1)
#define PR_CAP_AMBIENT 47
#define PR_CAP_AMBIENT_IS_SET 1
#define PR_CAP_AMBIENT_RAISE 2
#define PR_CAP_AMBIENT_LOWER 3
#define PR_CAP_AMBIENT_CLEAR_ALL 4
#ifndef __MLIBC_ABI_ONLY
#ifdef __cplusplus
extern "C" {
#endif
int prctl(int __op, ...);
#ifdef __cplusplus
}
#endif
#endif /* !__MLIBC_ABI_ONLY */
#endif /* _SYS_PRCTL_H */
+55
View File
@@ -0,0 +1,55 @@
#ifndef _SYS_PTRACE_H
#define _SYS_PTRACE_H
#include <abi-bits/ptrace.h>
#include <stdint.h>
#define PTRACE_TRACEME 0
#define PT_TRACE_ME PTRACE_TRACEME
#define PT_READ_I PTRACE_PEEKTEXT
#define PT_READ_D PTRACE_PEEKDATA
#define PT_READ_U PTRACE_PEEKUSER
#define PT_WRITE_I PTRACE_POKETEXT
#define PT_WRITE_D PTRACE_POKEDATA
#define PT_WRITE_U PTRACE_POKEUSER
#define PT_CONTINUE PTRACE_CONT
#define PT_KILL PTRACE_KILL
#define PT_STEP PTRACE_SINGLESTEP
#define PT_GETREGS PTRACE_GETREGS
#define PT_SETREGS PTRACE_SETREGS
#define PT_GETFPREGS PTRACE_GETFPREGS
#define PT_SETFPREGS PTRACE_SETFPREGS
#define PT_ATTACH PTRACE_ATTACH
#define PT_DETACH PTRACE_DETACH
#define PT_GETFPXREGS PTRACE_GETFPXREGS
#define PT_SETFPXREGS PTRACE_SETFPXREGS
#define PT_SYSCALL PTRACE_SYSCALL
#define PT_SETOPTIONS PTRACE_SETOPTIONS
#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
#define PT_GETSIGINFO PTRACE_GETSIGINFO
#define PT_SETSIGINFO PTRACE_SETSIGINFO
#ifdef __cplusplus
extern "C" {
#endif
struct ptrace_peeksiginfo_args {
uint64_t offset;
uint32_t flags;
int32_t nr;
};
#ifndef __MLIBC_ABI_ONLY
long ptrace(int __op, ...);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PTRACE_H */
+24
View File
@@ -0,0 +1,24 @@
#ifndef _SYS_QUOTA_H
#define _SYS_QUOTA_H
#include <sys/types.h>
#define SUBCMDMASK 0x00ff
#define SUBCMDSHIFT 8
#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MLIBC_ABI_ONLY
int quotactl(int __cmd, const char *__special, int __id, caddr_t __addr);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_QUOTA_H */
+24
View File
@@ -0,0 +1,24 @@
#ifndef _SYS_RANDOM_H
#define _SYS_RANDOM_H
#ifdef __cplusplus
extern "C" {
#endif
#include <abi-bits/random.h>
#include <bits/ssize_t.h>
#include <bits/size_t.h>
#ifndef __MLIBC_ABI_ONLY
ssize_t getrandom(void *__buffer, size_t __max_size, unsigned int __flags);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /*_SYS_RANDOM_H */
+20
View File
@@ -0,0 +1,20 @@
#ifndef MLIBC_SYS_REBOOT_H
#define MLIBC_SYS_REBOOT_H
#include <abi-bits/reboot.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MLIBC_ABI_ONLY
int reboot(int __arg);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* MLIBC_SYS_REBOOT_H */
+22
View File
@@ -0,0 +1,22 @@
#ifndef _SYS_SENDFILE_H_
#define _SYS_SENDFILE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <unistd.h>
#ifndef __MLIBC_ABI_ONLY
ssize_t sendfile(int __out_fd, int __in_fd, off_t *__offset, size_t __size);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SENDFILE_H_ */
+48
View File
@@ -0,0 +1,48 @@
#ifndef _SYS_SIGNALFD_H
#define _SYS_SIGNALFD_H
/* TODO: Define sigset separately and remove this include. */
#include <signal.h>
/* musl includes those. Restructure this so we do not need them? */
#include <stdint.h>
#include <fcntl.h>
#define SFD_CLOEXEC O_CLOEXEC
#define SFD_NONBLOCK O_NONBLOCK
#ifdef __cplusplus
extern "C" {
#endif
struct signalfd_siginfo {
uint32_t ssi_signo;
int32_t ssi_errno;
int32_t ssi_code;
uint32_t ssi_pid;
uint32_t ssi_uid;
int32_t ssi_fd;
uint32_t ssi_tid;
uint32_t ssi_band;
uint32_t ssi_overrun;
uint32_t ssi_trapno;
int32_t ssi_status;
int32_t ssi_int;
uint64_t ssi_ptr;
uint64_t ssi_utime;
uint64_t ssi_stime;
uint64_t ssi_addr;
uint16_t ssi_addr_lsb;
uint8_t pad[128-12*4-4*8-2];
};
#ifndef __MLIBC_ABI_ONLY
int signalfd(int __fd, const sigset_t *__mask, int __flags);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SIGNALFD_H */
+23
View File
@@ -0,0 +1,23 @@
#ifndef _SYS_STATFS_H
#define _SYS_STATFS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <abi-bits/statfs.h>
#ifndef __MLIBC_ABI_ONLY
int statfs(const char *__path, struct statfs *__buf);
int fstatfs(int __fd, struct statfs *__buf);
int fstatfs64(int __fd, struct statfs64 *__buf);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_STATFS_H */
+24
View File
@@ -0,0 +1,24 @@
#ifndef _SYS_SWAP_H
#define _SYS_SWAP_H
#ifdef __cplusplus
extern "C" {
#endif
#define SWAP_FLAG_PREFER 0x8000
#define SWAP_FLAG_PRIO_MASK 0x7fff
#define SWAP_FLAG_PRIO_SHIFT 0
#define SWAP_FLAG_DISCARD 0x10000
#ifndef __MLIBC_ABI_ONLY
int swapon(const char *__path, int __flags);
int swapoff(const char *__path);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SWAP_H */
+46
View File
@@ -0,0 +1,46 @@
#ifndef _SYS_SYSINFO_H
#define _SYS_SYSINFO_H
#ifdef __cplusplus
extern "C" {
#endif
/* TODO: This is from the Linux ABI. Make this an abi-bit. */
struct sysinfo {
long uptime;
unsigned long loads[3];
unsigned long totalram;
unsigned long freeram;
unsigned long sharedram;
unsigned long bufferram;
unsigned long totalswap;
unsigned long freeswap;
unsigned short procs;
unsigned long totalhigh;
unsigned long freehigh;
unsigned int mem_unit;
/* This is how the kernel header defines it, so suppress the warning. */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding to 64 bytes according to my man page */
#pragma GCC diagnostic pop
};
#define SI_LOAD_SHIFT 16
#ifndef __MLIBC_ABI_ONLY
int sysinfo(struct sysinfo *__info);
int get_nprocs(void);
int get_nprocs_conf(void);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SYSINFO_H */
+35
View File
@@ -0,0 +1,35 @@
#ifndef _SYS_SYSMACROS_H
#define _SYS_SYSMACROS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <bits/inline-definition.h>
__MLIBC_INLINE_DEFINITION unsigned int __mlibc_dev_major(
unsigned long long int __dev) {
return ((__dev >> 8) & 0xfff) | ((unsigned int)(__dev >> 32) & ~0xfff);
}
__MLIBC_INLINE_DEFINITION unsigned int __mlibc_dev_minor(
unsigned long long int __dev) {
return (__dev & 0xff) | ((unsigned int)(__dev >> 12) & ~0xff);
}
__MLIBC_INLINE_DEFINITION unsigned long long int __mlibc_dev_makedev(
unsigned int __major, unsigned int __minor) {
return ((__minor & 0xff) | ((__major & 0xfff) << 8)
| (((unsigned long long int)(__minor & ~0xff)) << 12)
| (((unsigned long long int)(__major & ~0xfff)) << 32));
}
#define major(dev) __mlibc_dev_major(dev)
#define minor(dev) __mlibc_dev_minor(dev)
#define makedev(major, minor) __mlibc_dev_makedev(major, minor)
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SYSMACROS_H */
+32
View File
@@ -0,0 +1,32 @@
#ifndef _SYS_TIMERFD_H
#define _SYS_TIMERFD_H
/* musl includes those. Refactor and remove them? */
#include <time.h>
#include <fcntl.h>
#define TFD_NONBLOCK O_NONBLOCK
#define TFD_CLOEXEC O_CLOEXEC
#define TFD_TIMER_ABSTIME 1
#define TFD_TIMER_CANCEL_ON_SET (1 << 1)
#ifdef __cplusplus
extern "C" {
#endif
struct itimerspec;
#ifndef __MLIBC_ABI_ONLY
int timerfd_create(int __clockid, int __flags);
int timerfd_settime(int __fd, int __flags, const struct itimerspec *__value, struct itimerspec *__oldvalue);
int timerfd_gettime(int __fd, struct itimerspec *__value);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TIMERFD_H */
+16
View File
@@ -0,0 +1,16 @@
#ifndef _SYS_VFS_H
#define _SYS_VFS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/statfs.h>
#ifdef __cplusplus
}
#endif
#endif /* _SYS_VFS_H */
+6
View File
@@ -0,0 +1,6 @@
#ifndef _SYS_VT_H
#define _SYS_VT_H
#include <abi-bits/vt.h>
#endif /* _SYS_VT_H */
+38
View File
@@ -0,0 +1,38 @@
#ifndef _MLIBC_LINUX_SYS_XATTR_H
#define _MLIBC_LINUX_SYS_XATTR_H
#include <sys/types.h>
#include <abi-bits/xattr.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __MLIBC_ABI_ONLY
int setxattr(const char *__path, const char *__name, const void *__val, size_t __size,
int __flags);
int lsetxattr(const char *__path, const char *__name, const void *__val, size_t __size,
int __flags);
int fsetxattr(int __fd, const char *__name, const void *__val, size_t __size,
int __flags);
ssize_t getxattr(const char *__path, const char *__name, void *__val, size_t __size);
ssize_t lgetxattr(const char *__path, const char *__name, void *__val, size_t __size);
ssize_t fgetxattr(int __fd, const char *__name, void *__val, size_t __size);
ssize_t listxattr(const char *__path, char *__list, size_t __size);
ssize_t llistxattr(const char *__path, char *__list, size_t __size);
ssize_t flistxattr(int __fd, char *__list, size_t __size);
int removexattr(const char *__path, const char *__name);
int lremovexattr(const char *__path, const char *__name);
int fremovexattr(int __fd, const char *__name);
#endif /* !__MLIBC_ABI_ONLY */
#ifdef __cplusplus
}
#endif
#endif /* _MLIBC_LINUX_SYS_XATTR_H */