Date: Wed, 7 Mar 2007 01:23:40 GMT From: Jung-uk Kim <jkim@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 115451 for review Message-ID: <200703070123.l271Ne9A088906@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=115451 Change 115451 by jkim@jkim_hammer on 2007/03/07 01:23:36 Add access mask for open(3). Affected files ... .. //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#25 edit .. //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#15 edit .. //depot/projects/linuxolator/src/sys/i386/linux/linux.h#21 edit Differences ... ==== //depot/projects/linuxolator/src/sys/amd64/linux32/linux.h#25 (text+ko) ==== @@ -531,6 +531,7 @@ #define LINUX_O_RDONLY 00000000 #define LINUX_O_WRONLY 00000001 #define LINUX_O_RDWR 00000002 +#define LINUX_O_ACCMODE 00000003 #define LINUX_O_CREAT 00000100 #define LINUX_O_EXCL 00000200 #define LINUX_O_NOCTTY 00000400 ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_file.c#15 (text+ko) ==== @@ -96,12 +96,16 @@ int bsd_flags, error; bsd_flags = 0; - if (l_flags & LINUX_O_RDONLY) - bsd_flags |= O_RDONLY; - if (l_flags & LINUX_O_WRONLY) + switch (l_flags & LINUX_O_ACCMODE) { + case LINUX_O_WRONLY: bsd_flags |= O_WRONLY; - if (l_flags & LINUX_O_RDWR) + break; + case LINUX_O_RDWR: bsd_flags |= O_RDWR; + break; + default: + bsd_flags |= O_RDONLY; + } if (l_flags & LINUX_O_NDELAY) bsd_flags |= O_NONBLOCK; if (l_flags & LINUX_O_APPEND) ==== //depot/projects/linuxolator/src/sys/i386/linux/linux.h#21 (text+ko) ==== @@ -502,6 +502,7 @@ #define LINUX_O_RDONLY 00000000 #define LINUX_O_WRONLY 00000001 #define LINUX_O_RDWR 00000002 +#define LINUX_O_ACCMODE 00000003 #define LINUX_O_CREAT 00000100 #define LINUX_O_EXCL 00000200 #define LINUX_O_NOCTTY 00000400
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200703070123.l271Ne9A088906>