summaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-09 19:20:15 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-09 19:20:15 +0100
commit885f5974cdf65b59415837ae97f5a14ef1350670 (patch)
tree66ac13de29c7f4932c5fcae11773df574e4e256a /include/sys
parent8f9e448b2ef6db7cd905540c21f3c5b190e7a1e7 (diff)
feat: add gzip and new headers
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/cdefs.h12
-rw-r--r--include/sys/resource.h47
-rw-r--r--include/sys/select.h4
-rw-r--r--include/sys/time.h5
-rw-r--r--include/sys/wait.h26
5 files changed, 70 insertions, 24 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 0ef66647..c3bb51c1 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -4,4 +4,16 @@
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
+#define __dead __attribute__((__noreturn__))
+
+#define __used __attribute__((__used__))
+#define __unused __attribute__((__unused__))
+
+#define __packed __attribute__((__packed__))
+#define __aligned(x) __attribute__((__aligned__(x)))
+
+#define __malloc __attribute__((__malloc__))
+
+#define __pure __attribute__((__pure__))
+
#endif
diff --git a/include/sys/resource.h b/include/sys/resource.h
new file mode 100644
index 00000000..79fcf235
--- /dev/null
+++ b/include/sys/resource.h
@@ -0,0 +1,47 @@
+#ifndef __SYS_RESOURCE_H
+#define __SYS_RESOURCE_H
+
+typedef __INT64_TYPE__ time_t;
+typedef __INT64_TYPE__ suseconds_t;
+
+struct __timeval {
+ time_t tv_sec;
+ suseconds_t tv_usec;
+};
+
+#define RUSAGE_SELF 0
+#define RUSAGE_CHILDREN (-1)
+#define RUSAGE_BOTH (-2)
+#define RUSAGE_THREAD 1
+
+struct rusage {
+ struct __timeval ru_utime;
+ struct __timeval ru_stime;
+ long ru_maxrss;
+ long ru_ixrss;
+ long ru_idrss;
+ long ru_isrss;
+ long ru_minflt;
+ long ru_majflt;
+ long ru_nswap;
+ long ru_inblock;
+ long ru_oublock;
+ long ru_msgsnd;
+ long ru_msgrcv;
+ long ru_nsignals;
+ long ru_nvcsw;
+ long ru_nivcsw;
+};
+
+#define PRIO_MIN (-20)
+#define PRIO_MAX 20
+
+#define PRIO_PROCESS 0
+#define PRIO_PGRP 1
+#define PRIO_USER 2
+
+int getpriority(int, int);
+int setpriority(int, int, int);
+int getrusage(int, struct rusage *);
+
+#endif
diff --git a/include/sys/select.h b/include/sys/select.h
index 44abc2e1..13c48dda 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -3,13 +3,11 @@
#define __BITS_SELECT_H_
#include <bits/select.h>
-#undef __BITS_SELECT_H_
#define __BITS_TIMESPEC_H_
#include <bits/timespec.h>
-#undef __BITS_TIMESPEC_H_
-typedef __INT32_TYPE__ sigset_t;
+typedef __UINT64_TYPE__ sigset_t;
int pselect(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
const struct timespec *restrict, const sigset_t *restrict);
diff --git a/include/sys/time.h b/include/sys/time.h
index 5f34e744..0746f411 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -3,10 +3,13 @@
#define __BITS_SELECT_H_
#include <bits/select.h>
-#undef __BITS_SELECT_H_
+
+struct timezone;
int select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
struct timeval *restrict);
+int gettimeofday(struct timeval *, struct timezone *);
+char *strtotimeval(const char *, struct timeval *);
int utimes(const char *, const struct timeval[2]);
#endif
diff --git a/include/sys/wait.h b/include/sys/wait.h
index 2a7438d7..ad935dc8 100644
--- a/include/sys/wait.h
+++ b/include/sys/wait.h
@@ -4,34 +4,20 @@
#define __BITS_WAIT_H_
#include <bits/wait.h>
+#define __BITS_SIGINFO_H_
+#include <bits/siginfo.h>
+
+struct rusage;
+
#define WCONTINUED 0x00000008
#define WEXITED 0x00000004
#define WNOWAIT 0x01000000
#define WSTOPPED WUNTRACED
-typedef __UINT32_TYPE__ id_t;
-typedef __INT64_TYPE__ pid_t;
-typedef __UINT32_TYPE__ uid_t;
-
-union sigval {
- int sival_int;
- void *sival_ptr;
-};
-
-typedef struct {
- int si_signo;
- int si_code;
- int si_errno;
- pid_t si_pid;
- uid_t si_uid;
- void *si_addr;
- int si_status;
- union sigval si_value;
-} siginfo_t;
-
typedef enum { P_ALL = 0, P_PID = 1, P_PGID = 2 } idtype_t;
pid_t wait(int *);
+pid_t wait3(int *, int, struct rusage *);
int waitid(idtype_t, id_t, siginfo_t *, int);
pid_t waitpid(pid_t, int *, int);