View | Details | Raw Unified | Return to bug 252106
Collapse All | Expand All

(-)b/sys/compat/linux/linux.h (+41 lines)
Lines 205-208 int linux_to_bsd_bits_(int value, struct bsd_to_linux_bitmap *bitmap, Link Here
205
int bsd_to_linux_errno(int error);
205
int bsd_to_linux_errno(int error);
206
void linux_check_errtbl(void);
206
void linux_check_errtbl(void);
207
207
208
#define STATX_BASIC_STATS		0x7ff
209
#define STATX_BTIME			0x800
210
#define STATX_ALL			0xfff
211
212
#define STATX_ATTR_COMPRESSED		0x04
213
#define STATX_ATTR_IMMUTABLE		0x10
214
#define STATX_ATTR_APPEND		0x20
215
#define STATX_ATTR_NODUMP		0x40
216
#define STATX_ATTR_ENCRYPTED		0x800
217
#define STATX_ATTR_DIR_AUTOMOUNT	0x1000
218
219
struct l_statx_timestamp {
220
	int64_t tv_sec;
221
	int32_t tv_nsec;
222
	int32_t __spare0;
223
};
224
225
struct l_statx {
226
	uint32_t stx_mask;
227
	uint32_t stx_blksize;
228
	uint64_t stx_attributes;
229
	uint32_t stx_nlink;
230
	uint32_t stx_uid;
231
	uint32_t stx_gid;
232
	uint16_t stx_mode;
233
	uint16_t __spare0[1];
234
	uint64_t stx_ino;
235
	uint64_t stx_size;
236
	uint64_t stx_blocks;
237
	uint64_t __spare1[1];
238
	struct l_statx_timestamp stx_atime;
239
	struct l_statx_timestamp stx_btime;
240
	struct l_statx_timestamp stx_ctime;
241
	struct l_statx_timestamp stx_mtime;
242
	uint32_t stx_rdev_major;
243
	uint32_t stx_rdev_minor;
244
	uint32_t stx_dev_major;
245
	uint32_t stx_dev_minor;
246
	uint64_t __spare2[14];
247
};
248
208
#endif /* _LINUX_MI_H_ */
249
#endif /* _LINUX_MI_H_ */
(-)b/sys/compat/linux/linux_stats.c (+67 lines)
Lines 196-201 newstat_copyout(struct stat *buf, void *ubuf) Link Here
196
	return (copyout(&tbuf, ubuf, sizeof(tbuf)));
196
	return (copyout(&tbuf, ubuf, sizeof(tbuf)));
197
}
197
}
198
198
199
static int
200
statx_copyout(struct stat *buf, void *ubuf)
201
{
202
	struct l_statx tbuf;
203
204
	bzero(&tbuf, sizeof(tbuf));
205
	tbuf.stx_mask = STATX_ALL;
206
	tbuf.stx_blksize = buf->st_blksize;
207
	tbuf.stx_attributes = 0;
208
	tbuf.stx_nlink = buf->st_nlink;
209
	tbuf.stx_uid = buf->st_uid;
210
	tbuf.stx_gid = buf->st_gid;
211
	tbuf.stx_mode = buf->st_mode;
212
	tbuf.stx_ino = buf->st_ino;
213
	tbuf.stx_size = buf->st_size;
214
	tbuf.stx_blocks = buf->st_blocks;
215
216
	tbuf.stx_atime.tv_sec = buf->st_atim.tv_sec;
217
	tbuf.stx_atime.tv_nsec = buf->st_atim.tv_nsec;
218
	tbuf.stx_btime.tv_sec = buf->st_birthtim.tv_sec;
219
	tbuf.stx_btime.tv_nsec = buf->st_birthtim.tv_nsec;
220
	tbuf.stx_ctime.tv_sec = buf->st_ctim.tv_sec;
221
	tbuf.stx_ctime.tv_nsec = buf->st_ctim.tv_nsec;
222
	tbuf.stx_mtime.tv_sec = buf->st_mtim.tv_sec;
223
	tbuf.stx_mtime.tv_nsec = buf->st_mtim.tv_nsec;
224
225
	tbuf.stx_rdev_major = buf->st_rdev >> 8;
226
	tbuf.stx_rdev_minor = buf->st_rdev & 0xff;
227
	tbuf.stx_dev_major = buf->st_dev >> 8;
228
	tbuf.stx_dev_minor = buf->st_dev & 0xff;
229
230
	return (copyout(&tbuf, ubuf, sizeof(tbuf)));
231
}
232
199
#ifdef LINUX_LEGACY_SYSCALLS
233
#ifdef LINUX_LEGACY_SYSCALLS
200
int
234
int
201
linux_newstat(struct thread *td, struct linux_newstat_args *args)
235
linux_newstat(struct thread *td, struct linux_newstat_args *args)
Lines 730-732 linux_syncfs(struct thread *td, struct linux_syncfs_args *args) Link Here
730
	vrele(vp);
764
	vrele(vp);
731
	return (error);
765
	return (error);
732
}
766
}
767
768
int
769
linux_statx(struct thread *td, struct linux_statx_args *args)
770
{
771
	char *path;
772
	int error, dirfd, flags;
773
	struct stat buf;
774
775
	if (args->flags & ~(LINUX_AT_SYMLINK_NOFOLLOW | LINUX_AT_EMPTY_PATH)) {
776
		linux_msg(td, "statx unsupported flags 0x%x", args->flags);
777
		return (EINVAL);
778
	}
779
780
	flags = (args->flags & LINUX_AT_SYMLINK_NOFOLLOW) ?
781
	    AT_SYMLINK_NOFOLLOW : 0;
782
	flags |= (args->flags & LINUX_AT_EMPTY_PATH) ?
783
	    AT_EMPTY_PATH : 0;
784
785
	dirfd = (args->dirfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dirfd;
786
	if (!LUSECONVPATH(td)) {
787
		error = linux_kern_statat(td, flags, dirfd, args->pathname,
788
		    UIO_USERSPACE, &buf);
789
	} else {
790
		LCONVPATHEXIST_AT(td, args->pathname, &path, dirfd);
791
		error = linux_kern_statat(td, flags, dirfd, path, UIO_SYSSPACE, &buf);
792
		LFREEPATH(path);
793
	}
794
	if (error == 0)
795
		error = statx_copyout(&buf, args->statxbuf);
796
797
	return (error);
798
}
799
(-)b/sys/x86/linux/linux_dummy_x86.c (-2 lines)
Lines 57-64 DUMMY(quotactl); Link Here
57
DUMMY(inotify_init);
57
DUMMY(inotify_init);
58
/* Linux 2.6.22: */
58
/* Linux 2.6.22: */
59
DUMMY(signalfd);
59
DUMMY(signalfd);
60
/* Linux 4.11: */
61
DUMMY(statx);
62
/* Linux 4.18: */
60
/* Linux 4.18: */
63
DUMMY(io_pgetevents);
61
DUMMY(io_pgetevents);
64
DUMMY(rseq);
62
DUMMY(rseq);

Return to bug 252106