mailing list of musl libc
 help / color / mirror / code / Atom feed
ff49841bedc84481fa7acb5e45ec5e275df55bd4 blob 1033 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
#define _GNU_SOURCE
#include <sys/stat.h>
#include <syscall.h>
#include <sys/sysmacros.h>
#include <errno.h>

int statx(int dirfd, const char *restrict path, int flags, unsigned mask, struct statx *restrict stx)
{
	int ret = syscall(SYS_statx, dirfd, path, flags, mask, stx);
	if (ret == ENOSYS) {
		struct stat st;
		fstatat(dir_fd, path, &st, flags);
		stx.stx_dev_major = major(st.st_dev);
		stx.stx_dev_minor = minor(st.st_dev);
		stx.stx_ino = st.st_ino;
		stx.stx_mode = st.st_mode;
		stx.stx_nlink = st.st_nlink;
		stx.stx_uid = st.st_uid;
		stx.stx_gid = st.st_gid;
		stx.stx_size = st.st_size;
		stx.stx_blksize = st.st_blksize;
		stx.stx_blocks = st.st_blocks;
		stx.stx_atime.tv_sec = st.st_atim.tv_sec;
		stx.stx_atime.tv_nsec = st.st_atim.tv_nsec;
		stx.stx_mtime.tv_sec = st.st_mtim.tv_sec;
		stx.stx_mtime.tv_nsec = st.st_mtim.tv_nsec;
		stx.stx_ctime.tv_sec = st.st_ctim.tv_sec;
		stx.stx_ctime.tv_nsec = st.st_ctim.tv_nsec;
		stx.stx_btime = 0;
		stx.stx_mask = STATX_BASIC_STATS;
		ret = EINVAL;
	}

	return ret;
}
debug log:

solving ff49841b ...
found ff49841b in https://inbox.vuxu.org/musl/20220827145752.3133543-2-dunk@denkimushi.com/

applying [1/1] https://inbox.vuxu.org/musl/20220827145752.3133543-2-dunk@denkimushi.com/
diff --git a/src/stat/statx.c b/src/stat/statx.c
new file mode 100644
index 00000000..ff49841b

Checking patch src/stat/statx.c...
Applied patch src/stat/statx.c cleanly.

index at:
100644 ff49841bedc84481fa7acb5e45ec5e275df55bd4	src/stat/statx.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).