Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2015 15:48:34 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283420 - head/sys/compat/linux
Message-ID:  <201505241548.t4OFmYxf063982@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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) */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505241548.t4OFmYxf063982>