diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 19:20:15 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 19:20:15 +0100 |
| commit | 885f5974cdf65b59415837ae97f5a14ef1350670 (patch) | |
| tree | 66ac13de29c7f4932c5fcae11773df574e4e256a /include/bits | |
| parent | 8f9e448b2ef6db7cd905540c21f3c5b190e7a1e7 (diff) | |
feat: add gzip and new headers
Diffstat (limited to 'include/bits')
| -rw-r--r-- | include/bits/rsize.h | 12 | ||||
| -rw-r--r-- | include/bits/select.h | 27 | ||||
| -rw-r--r-- | include/bits/siginfo.h | 28 | ||||
| -rw-r--r-- | include/bits/stat.h | 4 |
4 files changed, 56 insertions, 15 deletions
diff --git a/include/bits/rsize.h b/include/bits/rsize.h new file mode 100644 index 00000000..1a552fa3 --- /dev/null +++ b/include/bits/rsize.h @@ -0,0 +1,12 @@ +#ifndef __BITS_RSIZE_H +#define __BITS_RSIZE_H + +#ifndef __BITS_RSIZE_H_ +#error "Internal header — include the public API header instead." +#else +#undef __BITS_RSIZE_H_ +#endif + +typedef __SIZE_TYPE__ rsize_t; + +#endif diff --git a/include/bits/select.h b/include/bits/select.h index f1f952ab..f5b63ccc 100644 --- a/include/bits/select.h +++ b/include/bits/select.h @@ -3,28 +3,25 @@ #ifndef __BITS_SELECT_H_ #error "Internal header — include the public API header instead." +#else +#undef __BITS_SELECT_H_ #endif #define FD_SETSIZE 1024 -#define FD_ZERO(set) \ - do { \ - for (size_t i = 0; \ - i < sizeof((set)->fds_bits) / sizeof(fd_mask); i++) \ - (set)->fds_bits[i] = 0; \ - } while (0) +#define FD_ZERO(set) __builtin_memset((set), 0, sizeof(*(set))) -#define FD_SET(fd, set) \ - ((set)->fds_bits[(fd) / (8 * sizeof(fd_mask))] |= \ - (1UL << ((fd) % (8 * sizeof(fd_mask))))) +#define FD_SET(fd, set) \ + ((set)->fds_bits[(fd) / (8 * sizeof(unsigned long))] |= \ + 1UL << ((fd) % (8 * sizeof(unsigned long)))) -#define FD_CLR(fd, set) \ - ((set)->fds_bits[(fd) / (8 * sizeof(fd_mask))] &= \ - ~(1UL << ((fd) % (8 * sizeof(fd_mask))))) +#define FD_CLR(fd, set) \ + ((set)->fds_bits[(fd) / (8 * sizeof(unsigned long))] &= \ + ~(1UL << ((fd) % (8 * sizeof(unsigned long))))) -#define FD_ISSET(fd, set) \ - (((set)->fds_bits[(fd) / (8 * sizeof(fd_mask))] & \ - (1UL << ((fd) % (8 * sizeof(fd_mask))))) != 0) +#define FD_ISSET(fd, set) \ + ((set)->fds_bits[(fd) / (8 * sizeof(unsigned long))] & \ + (1UL << ((fd) % (8 * sizeof(unsigned long))))) typedef __INT64_TYPE__ time_t; typedef __INT64_TYPE__ suseconds_t; diff --git a/include/bits/siginfo.h b/include/bits/siginfo.h new file mode 100644 index 00000000..6a254596 --- /dev/null +++ b/include/bits/siginfo.h @@ -0,0 +1,28 @@ +#ifndef __BITS_SIGINFO_H +#define __BITS_SIGINFO_H + +#ifndef __BITS_SIGINFO_H_ +#error "Internal header — include the public API header instead." +#else +#undef __BITS_SIGINFO_H_ +#endif + +#define __BITS_SIGEVENT_H_ +#include <bits/sigevent.h> + +typedef __UINT32_TYPE__ id_t; +typedef __INT64_TYPE__ pid_t; +typedef __UINT32_TYPE__ uid_t; + +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; + +#endif diff --git a/include/bits/stat.h b/include/bits/stat.h index faa23771..ba43e695 100644 --- a/include/bits/stat.h +++ b/include/bits/stat.h @@ -35,4 +35,8 @@ struct stat { blkcnt_t st_blocks; }; +#define st_atime st_atim.tv_sec +#define st_mtime st_mtim.tv_sec +#define st_ctime st_ctim.tv_sec + #endif |
