All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Drop O_LARGEFILE from F_GETFL for POSIX compliance
@ 2004-03-22  4:13 Andi Kleen
  2004-03-22  4:29 ` Nicholas Miell
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Andi Kleen @ 2004-03-22  4:13 UTC (permalink / raw)
  To: marcelo.tosatti; +Cc: linux-kernel


On 64bit architectures open() sets O_LARGEFILE implicitely. This causes the LSB
testsuite to fail, which checks that F_GETFL only returns the flags set by 
a previous open.

According to the POSIX standards gurus the Linux behaviour is not compliant.

This patch fixes this by just not reporting O_LARGEFILE in F_GETFL.

This has been in several shipping SuSE releases and the x86-64.org CVS
treee for a long time, so is unlikely to break anything.

-Andi

diff -burpN -X ../KDIFX linux-2.4.26-pre5/fs/fcntl.c linux-merge/fs/fcntl.c
--- linux-2.4.26-pre5/fs/fcntl.c	2004-01-13 10:29:17.000000000 +0100
+++ linux-merge/fs/fcntl.c	2003-10-23 15:40:52.000000000 +0200
@@ -271,7 +271,7 @@ static long do_fcntl(unsigned int fd, un
 			set_close_on_exec(fd, arg&1);
 			break;
 		case F_GETFL:
-			err = filp->f_flags;
+			err = filp->f_flags & ~O_LARGEFILE;
 			break;
 		case F_SETFL:
 			lock_kernel();

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-03-22  7:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-22  4:13 [PATCH] Drop O_LARGEFILE from F_GETFL for POSIX compliance Andi Kleen
2004-03-22  4:29 ` Nicholas Miell
2004-03-22  4:34 ` Andrea Arcangeli
2004-03-22  4:45   ` Andi Kleen
2004-03-22  5:07     ` Andrea Arcangeli
2004-03-22  5:39 ` Andrew Morton
2004-03-22  6:14   ` Andi Kleen
2004-03-22  7:04     ` Ulrich Drepper
2004-03-22  7:09       ` Andi Kleen
2004-03-22  7:08     ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.