diff -up node-v12.10.0/deps/uv/src/unix/fs.c.orig node-v12.10.0/deps/uv/src/unix/fs.c --- node-v12.10.0/deps/uv/src/unix/fs.c.orig 2019-09-04 17:36:23.000000000 +0200 +++ node-v12.10.0/deps/uv/src/unix/fs.c 2019-10-10 12:46:10.743541964 +0200 @@ -1212,84 +1212,10 @@ static void uv__to_stat(struct stat* src } -static int uv__fs_statx(int fd, - const char* path, - int is_fstat, - int is_lstat, - uv_stat_t* buf) { - STATIC_ASSERT(UV_ENOSYS != -1); -#ifdef __linux__ - static int no_statx; - struct uv__statx statxbuf; - int dirfd; - int flags; - int mode; - int rc; - - if (no_statx) - return UV_ENOSYS; - - dirfd = AT_FDCWD; - flags = 0; /* AT_STATX_SYNC_AS_STAT */ - mode = 0xFFF; /* STATX_BASIC_STATS + STATX_BTIME */ - - if (is_fstat) { - dirfd = fd; - flags |= 0x1000; /* AT_EMPTY_PATH */ - } - - if (is_lstat) - flags |= AT_SYMLINK_NOFOLLOW; - - rc = uv__statx(dirfd, path, flags, mode, &statxbuf); - - if (rc == -1) { - /* EPERM happens when a seccomp filter rejects the system call. - * Has been observed with libseccomp < 2.3.3 and docker < 18.04. - */ - if (errno != EINVAL && errno != EPERM && errno != ENOSYS) - return -1; - - no_statx = 1; - return UV_ENOSYS; - } - - buf->st_dev = 256 * statxbuf.stx_dev_major + statxbuf.stx_dev_minor; - buf->st_mode = statxbuf.stx_mode; - buf->st_nlink = statxbuf.stx_nlink; - buf->st_uid = statxbuf.stx_uid; - buf->st_gid = statxbuf.stx_gid; - buf->st_rdev = statxbuf.stx_rdev_major; - buf->st_ino = statxbuf.stx_ino; - buf->st_size = statxbuf.stx_size; - buf->st_blksize = statxbuf.stx_blksize; - buf->st_blocks = statxbuf.stx_blocks; - buf->st_atim.tv_sec = statxbuf.stx_atime.tv_sec; - buf->st_atim.tv_nsec = statxbuf.stx_atime.tv_nsec; - buf->st_mtim.tv_sec = statxbuf.stx_mtime.tv_sec; - buf->st_mtim.tv_nsec = statxbuf.stx_mtime.tv_nsec; - buf->st_ctim.tv_sec = statxbuf.stx_ctime.tv_sec; - buf->st_ctim.tv_nsec = statxbuf.stx_ctime.tv_nsec; - buf->st_birthtim.tv_sec = statxbuf.stx_btime.tv_sec; - buf->st_birthtim.tv_nsec = statxbuf.stx_btime.tv_nsec; - buf->st_flags = 0; - buf->st_gen = 0; - - return 0; -#else - return UV_ENOSYS; -#endif /* __linux__ */ -} - - static int uv__fs_stat(const char *path, uv_stat_t *buf) { struct stat pbuf; int ret; - ret = uv__fs_statx(-1, path, /* is_fstat */ 0, /* is_lstat */ 0, buf); - if (ret != UV_ENOSYS) - return ret; - ret = stat(path, &pbuf); if (ret == 0) uv__to_stat(&pbuf, buf); @@ -1302,10 +1228,6 @@ static int uv__fs_lstat(const char *path struct stat pbuf; int ret; - ret = uv__fs_statx(-1, path, /* is_fstat */ 0, /* is_lstat */ 1, buf); - if (ret != UV_ENOSYS) - return ret; - ret = lstat(path, &pbuf); if (ret == 0) uv__to_stat(&pbuf, buf); @@ -1318,10 +1240,6 @@ static int uv__fs_fstat(int fd, uv_stat_ struct stat pbuf; int ret; - ret = uv__fs_statx(fd, "", /* is_fstat */ 1, /* is_lstat */ 0, buf); - if (ret != UV_ENOSYS) - return ret; - ret = fstat(fd, &pbuf); if (ret == 0) uv__to_stat(&pbuf, buf); diff -up node-v12.10.0/deps/uv/src/unix/linux-syscalls.c.orig node-v12.10.0/deps/uv/src/unix/linux-syscalls.c --- node-v12.10.0/deps/uv/src/unix/linux-syscalls.c.orig 2019-09-04 17:36:23.000000000 +0200 +++ node-v12.10.0/deps/uv/src/unix/linux-syscalls.c 2019-10-10 12:46:46.261728396 +0200 @@ -187,21 +187,6 @@ # endif #endif /* __NR_pwritev */ -#ifndef __NR_statx -# if defined(__x86_64__) -# define __NR_statx 332 -# elif defined(__i386__) -# define __NR_statx 383 -# elif defined(__aarch64__) -# define __NR_statx 397 -# elif defined(__arm__) -# define __NR_statx (UV_SYSCALL_BASE + 397) -# elif defined(__ppc__) -# define __NR_statx 383 -# elif defined(__s390__) -# define __NR_statx 379 -# endif -#endif /* __NR_statx */ int uv__accept4(int fd, struct sockaddr* addr, socklen_t* addrlen, int flags) { #if defined(__i386__) @@ -350,20 +335,4 @@ int uv__dup3(int oldfd, int newfd, int f #else return errno = ENOSYS, -1; #endif -} - - -int uv__statx(int dirfd, - const char* path, - int flags, - unsigned int mask, - struct uv__statx* statxbuf) { - /* __NR_statx make Android box killed by SIGSYS. - * That looks like a seccomp2 sandbox filter rejecting the system call. - */ -#if defined(__NR_statx) && !defined(__ANDROID__) - return syscall(__NR_statx, dirfd, path, flags, mask, statxbuf); -#else - return errno = ENOSYS, -1; -#endif } diff -up node-v12.10.0/deps/uv/src/unix/linux-syscalls.h.orig node-v12.10.0/deps/uv/src/unix/linux-syscalls.h --- node-v12.10.0/deps/uv/src/unix/linux-syscalls.h.orig 2019-09-04 17:36:23.000000000 +0200 +++ node-v12.10.0/deps/uv/src/unix/linux-syscalls.h 2019-10-10 12:43:54.858867961 +0200 @@ -80,36 +80,6 @@ #define UV__IN_DELETE_SELF 0x400 #define UV__IN_MOVE_SELF 0x800 -struct uv__statx_timestamp { - int64_t tv_sec; - uint32_t tv_nsec; - int32_t unused0; -}; - -struct uv__statx { - uint32_t stx_mask; - uint32_t stx_blksize; - uint64_t stx_attributes; - uint32_t stx_nlink; - uint32_t stx_uid; - uint32_t stx_gid; - uint16_t stx_mode; - uint16_t unused0; - uint64_t stx_ino; - uint64_t stx_size; - uint64_t stx_blocks; - uint64_t stx_attributes_mask; - struct uv__statx_timestamp stx_atime; - struct uv__statx_timestamp stx_btime; - struct uv__statx_timestamp stx_ctime; - struct uv__statx_timestamp stx_mtime; - uint32_t stx_rdev_major; - uint32_t stx_rdev_minor; - uint32_t stx_dev_major; - uint32_t stx_dev_minor; - uint64_t unused1[14]; -}; - struct uv__inotify_event { int32_t wd; uint32_t mask; @@ -143,10 +113,5 @@ int uv__sendmmsg(int fd, ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset); ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset); int uv__dup3(int oldfd, int newfd, int flags); -int uv__statx(int dirfd, - const char* path, - int flags, - unsigned int mask, - struct uv__statx* statxbuf); #endif /* UV_LINUX_SYSCALL_H_ */