summaryrefslogtreecommitdiff
path: root/include/sys
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/cdefs.h27
-rw-r--r--include/sys/inotify.h1
-rw-r--r--include/sys/mount.h3
-rw-r--r--include/sys/select.h7
-rw-r--r--include/sys/socket.h34
-rw-r--r--include/sys/time.h3
6 files changed, 44 insertions, 31 deletions
diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index bbb12fb2..50fe0c19 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -20,11 +20,32 @@
#define __malloc __attribute__((__malloc__))
#define __pure __attribute__((__pure__))
#define __nodiscard __attribute__((__warn_unused_result__))
-#define __weak __attribute__((__weak__))
-#define __naked __attribute__((__naked__))
-#define __const __attribute__((__const__))
+#undef __weak
+#define __weak __attribute__((__weak__))
+#define __naked __attribute__((__naked__))
+#define __const __attribute__((__const__))
#define __predict_true(exp) __builtin_expect((exp) != 0, 1)
#define __predict_false(exp) __builtin_expect((exp) != 0, 0)
+#define __INT128_TYPE__ __int128
+#define __UINT128_TYPE__ unsigned __INT128_TYPE__
+
+typedef __INT8_TYPE__ i8;
+typedef __INT16_TYPE__ i16;
+typedef __INT32_TYPE__ i32;
+typedef __INT64_TYPE__ i64;
+typedef __INT128_TYPE__ i128;
+
+typedef __UINT8_TYPE__ u8;
+typedef __UINT16_TYPE__ u16;
+typedef __UINT32_TYPE__ u32;
+typedef __UINT64_TYPE__ u64;
+typedef __UINT128_TYPE__ u128;
+
+typedef _Float16 f16;
+typedef float f32;
+typedef double f64;
+typedef __float128 f128;
+
#endif
diff --git a/include/sys/inotify.h b/include/sys/inotify.h
index b7a59853..0a8ed1cd 100644
--- a/include/sys/inotify.h
+++ b/include/sys/inotify.h
@@ -1,6 +1,7 @@
#ifndef __SYS_INOTIFY_H
#define __SYS_INOTIFY_H
+#include <stdint.h>
typedef __UINT32_TYPE__ uint32_t;
#define IN_ACCESS 0x00000001
diff --git a/include/sys/mount.h b/include/sys/mount.h
index 66207be3..1864e0ef 100644
--- a/include/sys/mount.h
+++ b/include/sys/mount.h
@@ -1,8 +1,7 @@
#ifndef __SYS_MOUNT_H
#define __SYS_MOUNT_H
-int mount(const char *, const char *, const char *, unsigned long,
- const void *);
+int mount(const char *, const char *, const char *, unsigned long, const void *);
int umount(const char *);
int umount2(const char *, int);
diff --git a/include/sys/select.h b/include/sys/select.h
index 9c1edcae..1c3b3d53 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -10,9 +10,8 @@ struct timespec;
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);
-int select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
- struct timeval *restrict);
+int pselect(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, const struct timespec *restrict,
+ const sigset_t *restrict);
+int select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, struct timeval *restrict);
#endif
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 0dd4f454..ca3553ae 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -6,22 +6,18 @@
#define CMSG_DATA(cmsg) ((void *)(cmsg) + sizeof(struct cmsghdr))
-#define CMSG_NXTHDR(mhdr, cmsg) \
- ((cmsg)->cmsg_len < sizeof(struct cmsghdr) || \
- (((cmsg)->cmsg_len + sizeof(long) - 1) & \
- ~(long)(sizeof(long) - 1)) + \
- sizeof(struct cmsghdr) >= \
- ((unsigned char *)(mhdr)->msg_control + \
- (mhdr)->msg_controllen) - \
- (unsigned char *)(cmsg) ? \
- 0 : \
- (struct cmsghdr *)((unsigned char *)(cmsg) + \
- __CMSG_LEN(cmsg)))
-
-#define CMSG_FIRSTHDR(mhdr) \
- ((size_t)(mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
- (struct cmsghdr *)(mhdr)->msg_control : \
- (struct cmsghdr *)0)
+#define CMSG_NXTHDR(mhdr, cmsg) \
+ ((cmsg)->cmsg_len < sizeof(struct cmsghdr) || \
+ (((cmsg)->cmsg_len + sizeof(long) - 1) & ~(long)(sizeof(long) - 1)) + \
+ sizeof(struct cmsghdr) >= \
+ ((unsigned char *)(mhdr)->msg_control + (mhdr)->msg_controllen) - \
+ (unsigned char *)(cmsg) ? \
+ 0 : \
+ (struct cmsghdr *)((unsigned char *)(cmsg) + __CMSG_LEN(cmsg)))
+
+#define CMSG_FIRSTHDR(mhdr) \
+ ((size_t)(mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? (struct cmsghdr *)(mhdr)->msg_control : \
+ (struct cmsghdr *)0)
#define CMSG_SPACE(len) (CMSG_ALIGN(len) + CMSG_ALIGN(sizeof(struct cmsghdr)))
@@ -127,13 +123,11 @@ int getsockname(int, struct sockaddr *restrict, socklen_t *restrict);
int getsockopt(int, int, int, void *restrict, socklen_t *restrict);
int listen(int, int);
ssize_t recv(int, void *, size_t, int);
-ssize_t recvfrom(int, void *restrict, size_t, int, struct sockaddr *restrict,
- socklen_t *restrict);
+ssize_t recvfrom(int, void *restrict, size_t, int, struct sockaddr *restrict, socklen_t *restrict);
ssize_t recvmsg(int, struct msghdr *, int);
ssize_t send(int, const void *, size_t, int);
ssize_t sendmsg(int, const struct msghdr *, int);
-ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *,
- socklen_t);
+ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t);
int setsockopt(int, int, int, const void *, socklen_t);
int shutdown(int, int);
int sockatmark(int);
diff --git a/include/sys/time.h b/include/sys/time.h
index 0746f411..6940b0d7 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -6,8 +6,7 @@
struct timezone;
-int select(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
- struct timeval *restrict);
+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]);