Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2014 18:05:44 +0000 (UTC)
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r266899 - user/dchagin/lemul/sys/compat/linux
Message-ID:  <201405301805.s4UI5iVT096022@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cognet
Date: Fri May 30 18:05:43 2014
New Revision: 266899
URL: http://svnweb.freebsd.org/changeset/base/266899

Log:
  Choose /compat/linux or /compat/linux64 as prefix depending on if the
  process is a 32bits or 64bits process.

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

Modified: user/dchagin/lemul/sys/compat/linux/linux_util.c
==============================================================================
--- user/dchagin/lemul/sys/compat/linux/linux_util.c	Fri May 30 18:05:04 2014	(r266898)
+++ user/dchagin/lemul/sys/compat/linux/linux_util.c	Fri May 30 18:05:43 2014	(r266899)
@@ -59,6 +59,7 @@ MALLOC_DEFINE(M_FUTEX, "futex", "Linux f
 MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp");
 
 const char      linux_emul_path[] = "/compat/linux";
+const char	linux64_emul_path[] = "/compat/linux64";
 
 /*
  * Search an alternate path before passing pathname arguments on to
@@ -71,9 +72,14 @@ int
 linux_emul_convpath(struct thread *td, const char *path, enum uio_seg pathseg,
     char **pbuf, int cflag, int dfd)
 {
+	const char *lemul_path;
 	int retval;
 
-	retval = kern_alternate_path(td, linux_emul_path, path, pathseg, pbuf,
+	if (td->td_proc->p_sysent->sv_flags & SV_LP64)
+		lemul_path = linux64_emul_path;
+	else
+		lemul_path = linux_emul_path;
+	retval = kern_alternate_path(td, lemul_path, path, pathseg, pbuf,
 	    cflag, dfd);
 
 	return (retval);



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