svn commit: r283420 - head/sys/compat/linux
Dmitry Chagin
dchagin at FreeBSD.org
Sun May 24 15:48:35 UTC 2015
Author: dchagin
Date: Sun May 24 15:48:34 2015
New Revision: 283420
URL: https://svnweb.freebsd.org/changeset/base/283420
Log:
Add newfstatat system call for 64-bit Linuxulator.
Differential Revision: https://reviews.freebsd.org/D1071
Reviewed by: trasz
Modified:
head/sys/compat/linux/linux_stats.c
Modified: head/sys/compat/linux/linux_stats.c
==============================================================================
--- head/sys/compat/linux/linux_stats.c Sun May 24 15:47:15 2015 (r283419)
+++ head/sys/compat/linux/linux_stats.c Sun May 24 15:48:34 2015 (r283420)
@@ -627,4 +627,34 @@ linux_fstatat64(struct thread *td, struc
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) */
More information about the svn-src-head
mailing list