Date: Thu, 25 Apr 2019 11:57:35 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r346666 - in stable/11: lib/libcuse sys/fs/cuse Message-ID: <201904251157.x3PBvZ36069788@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Apr 25 11:57:34 2019 New Revision: 346666 URL: https://svnweb.freebsd.org/changeset/base/346666 Log: MFC r346356: Implement flag for telling cuse(3) clients if the peer is running in 32-bit compat mode or not. This is useful when implementing compatibility ioctl(2) handlers in userspace. Sponsored by: Mellanox Technologies Modified: stable/11/lib/libcuse/cuse.3 stable/11/sys/fs/cuse/cuse.c stable/11/sys/fs/cuse/cuse_defs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libcuse/cuse.3 ============================================================================== --- stable/11/lib/libcuse/cuse.3 Thu Apr 25 11:56:07 2019 (r346665) +++ stable/11/lib/libcuse/cuse.3 Thu Apr 25 11:57:34 2019 (r346666) @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 5, 2017 +.Dd April 17, 2019 .Dt CUSE 3 .Os .Sh NAME @@ -303,6 +303,7 @@ enum { CUSE_FFLAG_READ CUSE_FFLAG_WRITE CUSE_FFLAG_NONBLOCK + CUSE_FFLAG_COMPAT32 CUSE_CMD_NONE CUSE_CMD_OPEN Modified: stable/11/sys/fs/cuse/cuse.c ============================================================================== --- stable/11/sys/fs/cuse/cuse.c Thu Apr 25 11:56:07 2019 (r346665) +++ stable/11/sys/fs/cuse/cuse.c Thu Apr 25 11:57:34 2019 (r346666) @@ -53,6 +53,7 @@ #include <sys/vnode.h> #include <sys/selinfo.h> #include <sys/ptrace.h> +#include <sys/sysent.h> #include <machine/bus.h> @@ -538,7 +539,10 @@ cuse_client_send_command_locked(struct cuse_client_com if (ioflag & IO_NDELAY) cuse_fflags |= CUSE_FFLAG_NONBLOCK; - +#if defined(__LP64__) + if (SV_CURPROC_FLAG(SV_ILP32)) + cuse_fflags |= CUSE_FFLAG_COMPAT32; +#endif pccmd->sub.fflags = cuse_fflags; pccmd->sub.data_pointer = data_ptr; pccmd->sub.argument = arg; Modified: stable/11/sys/fs/cuse/cuse_defs.h ============================================================================== --- stable/11/sys/fs/cuse/cuse_defs.h Thu Apr 25 11:56:07 2019 (r346665) +++ stable/11/sys/fs/cuse/cuse_defs.h Thu Apr 25 11:57:34 2019 (r346666) @@ -27,7 +27,7 @@ #ifndef _CUSE_DEFS_H_ #define _CUSE_DEFS_H_ -#define CUSE_VERSION 0x000123 +#define CUSE_VERSION 0x000124 #define CUSE_ERR_NONE 0 #define CUSE_ERR_BUSY -1 @@ -49,6 +49,7 @@ #define CUSE_FFLAG_READ 1 #define CUSE_FFLAG_WRITE 2 #define CUSE_FFLAG_NONBLOCK 4 +#define CUSE_FFLAG_COMPAT32 8 /* peer is running in 32-bit compat mode */ #define CUSE_DBG_NONE 0 #define CUSE_DBG_FULL 1
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904251157.x3PBvZ36069788>