diff options
| author | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 21:17:12 +0100 |
|---|---|---|
| committer | Kacper <kacper@mail.openlinux.dev> | 2025-12-09 21:17:12 +0100 |
| commit | b5cd18739a64c8d923a55b61c89ae3900faafd84 (patch) | |
| tree | d192f7b25257ae9a8a4760c68f5314dcbc0d9b91 /lib/libc/stat | |
| parent | 119aed5bc787ccbf23d2f151759ec1f3a80977e1 (diff) | |
Fix include paths and formatting inconsistencies
Diffstat (limited to 'lib/libc/stat')
| -rw-r--r-- | lib/libc/stat/chmod.c | 7 | ||||
| -rw-r--r-- | lib/libc/stat/fchmod.c | 7 | ||||
| -rw-r--r-- | lib/libc/stat/fchmodat.c | 7 | ||||
| -rw-r--r-- | lib/libc/stat/fstat.c | 4 | ||||
| -rw-r--r-- | lib/libc/stat/fstatat.c | 12 | ||||
| -rw-r--r-- | lib/libc/stat/futimens.c | 4 | ||||
| -rw-r--r-- | lib/libc/stat/lstat.c | 4 | ||||
| -rw-r--r-- | lib/libc/stat/mkdir.c | 8 | ||||
| -rw-r--r-- | lib/libc/stat/mkdirat.c | 8 | ||||
| -rw-r--r-- | lib/libc/stat/mkfifo.c | 3 | ||||
| -rw-r--r-- | lib/libc/stat/mkfifoat.c | 3 | ||||
| -rw-r--r-- | lib/libc/stat/mknod.c | 9 | ||||
| -rw-r--r-- | lib/libc/stat/mknodat.c | 7 | ||||
| -rw-r--r-- | lib/libc/stat/stat.c | 4 | ||||
| -rw-r--r-- | lib/libc/stat/umask.c | 7 | ||||
| -rw-r--r-- | lib/libc/stat/utimensat.c | 6 |
16 files changed, 65 insertions, 35 deletions
diff --git a/lib/libc/stat/chmod.c b/lib/libc/stat/chmod.c index 6b7283e2..f204df83 100644 --- a/lib/libc/stat/chmod.c +++ b/lib/libc/stat/chmod.c @@ -1,5 +1,8 @@ -#include <sys/stat.h> -#include <syscall.h> +#include "asm/unistd_64.h" // for __NR_chmod + +#include <sys/stat.h> // for chmod +#include <sys/types.h> // for mode_t +#include <syscall.h> // for __syscall_2, syscall int chmod(const char *path, mode_t mode) { diff --git a/lib/libc/stat/fchmod.c b/lib/libc/stat/fchmod.c index 22593fd6..c7b0b0f3 100644 --- a/lib/libc/stat/fchmod.c +++ b/lib/libc/stat/fchmod.c @@ -1,5 +1,8 @@ -#include <sys/stat.h> -#include <syscall.h> +#include "asm/unistd_64.h" // for __NR_fchmod + +#include <sys/stat.h> // for fchmod +#include <sys/types.h> // for mode_t +#include <syscall.h> // for __syscall_2, syscall int fchmod(int fildes, mode_t mode) { diff --git a/lib/libc/stat/fchmodat.c b/lib/libc/stat/fchmodat.c index 71a3c0c5..30c8230c 100644 --- a/lib/libc/stat/fchmodat.c +++ b/lib/libc/stat/fchmodat.c @@ -1,5 +1,8 @@ -#include <sys/stat.h> -#include <syscall.h> +#include "asm/unistd_64.h" // for __NR_fchmodat2 + +#include <sys/stat.h> // for fchmodat +#include <sys/types.h> // for mode_t +#include <syscall.h> // for __syscall_4, syscall int fchmodat(int fd, const char *path, mode_t mode, int flag) { diff --git a/lib/libc/stat/fstat.c b/lib/libc/stat/fstat.c index 7a9fb4e4..9c3a9df2 100644 --- a/lib/libc/stat/fstat.c +++ b/lib/libc/stat/fstat.c @@ -1,6 +1,4 @@ -#include <fcntl.h> -#include <sys/stat.h> -#include <syscall.h> +#include <sys/stat.h> // for fstatat, fstat int fstat(int fildes, struct stat *buf) { diff --git a/lib/libc/stat/fstatat.c b/lib/libc/stat/fstatat.c index d7aecbc5..c36ba3e3 100644 --- a/lib/libc/stat/fstatat.c +++ b/lib/libc/stat/fstatat.c @@ -1,8 +1,12 @@ -#include <linux/stat.h> +#include <linux/stat.h> // for statx, statx_timestamp, STATX_BASIC_STATS +#include <time.h> // for timespec + #define __BITS_STAT_H_ -#include <bits/stat.h> -#undef __BITS_STAT_H_ -#include <syscall.h> + +#include "asm/unistd_64.h" // for __NR_statx + +#include <bits/stat.h> // for stat +#include <syscall.h> // for __syscall_5, syscall #define makedev(major, minor) \ ((((major) & 0xfffff000ULL) << 32) | \ diff --git a/lib/libc/stat/futimens.c b/lib/libc/stat/futimens.c index 38c6876f..f3bb425d 100644 --- a/lib/libc/stat/futimens.c +++ b/lib/libc/stat/futimens.c @@ -1,4 +1,6 @@ -#include <sys/stat.h> +#define __BITS_STAT_H_ +#include <bits/stat.h> // for timespec +#include <sys/stat.h> // for utimensat, futimens int futimens(int fd, const struct timespec times[2]) { diff --git a/lib/libc/stat/lstat.c b/lib/libc/stat/lstat.c index a188f78d..77ded510 100644 --- a/lib/libc/stat/lstat.c +++ b/lib/libc/stat/lstat.c @@ -1,5 +1,5 @@ -#include <fcntl.h> -#include <sys/stat.h> +#include <fcntl.h> // for AT_FDCWD, AT_SYMLINK_NOFOLLOW +#include <sys/stat.h> // for fstatat, lstat int lstat(const char *restrict path, struct stat *restrict buf) { diff --git a/lib/libc/stat/mkdir.c b/lib/libc/stat/mkdir.c index 1f97fb3f..58de4a89 100644 --- a/lib/libc/stat/mkdir.c +++ b/lib/libc/stat/mkdir.c @@ -1,6 +1,8 @@ -#include <fcntl.h> -#include <syscall.h> -#include <sys/stat.h> +#include "asm/unistd_64.h" // for __NR_mkdir + +#include <sys/stat.h> // for mkdir +#include <sys/types.h> // for mode_t +#include <syscall.h> // for __syscall_2, syscall int mkdir(const char *path, mode_t mode) { diff --git a/lib/libc/stat/mkdirat.c b/lib/libc/stat/mkdirat.c index d129008b..49a4cecf 100644 --- a/lib/libc/stat/mkdirat.c +++ b/lib/libc/stat/mkdirat.c @@ -1,6 +1,8 @@ -#include <fcntl.h> -#include <syscall.h> -#include <sys/stat.h> +#include "asm/unistd_64.h" // for __NR_mkdirat + +#include <sys/stat.h> // for mkdirat +#include <sys/types.h> // for mode_t +#include <syscall.h> // for __syscall_3, syscall int mkdirat(int fd, const char *path, mode_t mode) { diff --git a/lib/libc/stat/mkfifo.c b/lib/libc/stat/mkfifo.c index 60efcf73..6c64fe35 100644 --- a/lib/libc/stat/mkfifo.c +++ b/lib/libc/stat/mkfifo.c @@ -1,4 +1,5 @@ -#include <sys/stat.h> +#include <sys/stat.h> // for mknod, S_IFIFO, mkfifo +#include <sys/types.h> // for mode_t int mkfifo(const char *path, mode_t mode) { diff --git a/lib/libc/stat/mkfifoat.c b/lib/libc/stat/mkfifoat.c index d3a1f970..d4023c63 100644 --- a/lib/libc/stat/mkfifoat.c +++ b/lib/libc/stat/mkfifoat.c @@ -1,4 +1,5 @@ -#include <sys/stat.h> +#include <sys/stat.h> // for mknodat, S_IFIFO, mkfifoat +#include <sys/types.h> // for mode_t int mkfifoat(int fd, const char *path, mode_t mode) { diff --git a/lib/libc/stat/mknod.c b/lib/libc/stat/mknod.c index 1a4a5c6c..b8efed01 100644 --- a/lib/libc/stat/mknod.c +++ b/lib/libc/stat/mknod.c @@ -1,6 +1,9 @@ -#include <fcntl.h> -#include <syscall.h> -#include <sys/stat.h> +#include "asm/unistd_64.h" // for __NR_mknodat + +#include <fcntl.h> // for AT_FDCWD +#include <sys/stat.h> // for mknod +#include <sys/types.h> // for dev_t, mode_t +#include <syscall.h> // for __syscall_4, syscall int mknod(const char *path, mode_t mode, dev_t dev) { diff --git a/lib/libc/stat/mknodat.c b/lib/libc/stat/mknodat.c index 9967248e..5ac50f5c 100644 --- a/lib/libc/stat/mknodat.c +++ b/lib/libc/stat/mknodat.c @@ -1,5 +1,8 @@ -#include <syscall.h> -#include <sys/stat.h> +#include "asm/unistd_64.h" // for __NR_mknodat + +#include <sys/stat.h> // for mknodat +#include <sys/types.h> // for dev_t, mode_t +#include <syscall.h> // for __syscall_4, syscall int mknodat(int fd, const char *path, mode_t mode, dev_t dev) { diff --git a/lib/libc/stat/stat.c b/lib/libc/stat/stat.c index 95bdf73d..d839f0eb 100644 --- a/lib/libc/stat/stat.c +++ b/lib/libc/stat/stat.c @@ -1,5 +1,5 @@ -#include <fcntl.h> -#include <sys/stat.h> +#include <fcntl.h> // for AT_FDCWD +#include <sys/stat.h> // for fstatat, stat int stat(const char *restrict path, struct stat *restrict buf) { diff --git a/lib/libc/stat/umask.c b/lib/libc/stat/umask.c index 2724317a..f9026df8 100644 --- a/lib/libc/stat/umask.c +++ b/lib/libc/stat/umask.c @@ -1,5 +1,8 @@ -#include <sys/stat.h> -#include <syscall.h> +#include "asm/unistd_64.h" // for __NR_umask + +#include <sys/stat.h> // for umask +#include <sys/types.h> // for mode_t +#include <syscall.h> // for __syscall_1, syscall mode_t umask(mode_t cmask) { diff --git a/lib/libc/stat/utimensat.c b/lib/libc/stat/utimensat.c index d51611a3..5193a819 100644 --- a/lib/libc/stat/utimensat.c +++ b/lib/libc/stat/utimensat.c @@ -1,5 +1,7 @@ -#include <time.h> -#include <syscall.h> +#include "asm/unistd_64.h" // for __NR_utimensat + +#include <syscall.h> // for __syscall_4, syscall +#include <time.h> // for timespec int utimensat(int fd, const char *path, const struct timespec times[2], int flag) |
