diff options
author | dchagin <dchagin@FreeBSD.org> | 2016-01-09 16:00:13 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2016-01-09 16:00:13 +0000 |
commit | f1749dc5eabfb4c07da6e48e7a8cd0b3655b20a6 (patch) | |
tree | 8457b5aad56f931d27b7fc18808a36247ad68e7f /sys/compat | |
parent | de7c911268b73d6b9e6b3583c413db9759b8320c (diff) | |
download | FreeBSD-src-f1749dc5eabfb4c07da6e48e7a8cd0b3655b20a6.zip FreeBSD-src-f1749dc5eabfb4c07da6e48e7a8cd0b3655b20a6.tar.gz |
MFC r283420:
Add newfstatat system call for 64-bit Linuxulator.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_stats.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 21471b7..845ac67 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -627,4 +627,34 @@ linux_fstatat64(struct thread *td, struct linux_fstatat64_args *args) return (error); } +#else /* __amd64__ && !COMPAT_LINUX32 */ + +int +linux_newfstatat(struct thread *td, struct linux_newfstatat_args *args) +{ + char *path; + int error, dfd, flag; + struct stat buf; + + if (args->flag & ~LINUX_AT_SYMLINK_NOFOLLOW) + return (EINVAL); + flag = (args->flag & LINUX_AT_SYMLINK_NOFOLLOW) ? + AT_SYMLINK_NOFOLLOW : 0; + + dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd; + LCONVPATHEXIST_AT(td, args->pathname, &path, dfd); + +#ifdef DEBUG + if (ldebug(newfstatat)) + printf(ARGS(newfstatat, "%i, %s, %i"), args->dfd, path, args->flag); +#endif + + error = linux_kern_statat(td, flag, dfd, path, UIO_SYSSPACE, &buf); + if (error == 0) + error = newstat_copyout(&buf, args->statbuf); + LFREEPATH(path); + + return (error); +} + #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ |