svn commit: r250439 - user/dchagin/lemul/sys/compat/linux

Dmitry Chagin dchagin at FreeBSD.org
Fri May 10 06:45:27 UTC 2013


Author: dchagin
Date: Fri May 10 06:45:27 2013
New Revision: 250439
URL: http://svnweb.freebsd.org/changeset/base/250439

Log:
  Get ready to commit x86_64 Linux emulation.
  Add newfstatat system call for 64-bit Linuxulator.

Modified:
  user/dchagin/lemul/sys/compat/linux/linux_stats.c

Modified: user/dchagin/lemul/sys/compat/linux/linux_stats.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_stats.c	Fri May 10 06:43:41 2013	(r250438)
+++ user/dchagin/lemul/sys/compat/linux/linux_stats.c	Fri May 10 06:45:27 2013	(r250439)
@@ -627,4 +627,34 @@ linux_fstatat64(struct thread *td, struc
 	return (error);
 }
 
+#else
+
+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)
+		error = newstat_copyout(&buf, args->statbuf);
+	LFREEPATH(path);
+
+	return (error);
+}
+
 #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */


More information about the svn-src-user mailing list