Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 16:00:13 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293525 - stable/10/sys/compat/linux
Message-ID:  <201601091600.u09G0DUq028996@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Jan  9 16:00:13 2016
New Revision: 293525
URL: https://svnweb.freebsd.org/changeset/base/293525

Log:
  MFC r283420:
  
  Add newfstatat system call for 64-bit Linuxulator.

Modified:
  stable/10/sys/compat/linux/linux_stats.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_stats.c
==============================================================================
--- stable/10/sys/compat/linux/linux_stats.c	Sat Jan  9 15:58:42 2016	(r293524)
+++ stable/10/sys/compat/linux/linux_stats.c	Sat Jan  9 16:00:13 2016	(r293525)
@@ -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?201601091600.u09G0DUq028996>