From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: [PATCH] Mask out O_LARGEFILE in F_GETFL Date: Thu, 25 Sep 2003 07:25:08 +0200 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030925052508.GA2374@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from zero.aec.at ([193.170.194.10]:5894 "EHLO zero.aec.at") by vger.kernel.org with ESMTP id S261700AbTIYFZY (ORCPT ); Thu, 25 Sep 2003 01:25:24 -0400 To: marcelo.tosatti@cyclades.com.br Content-Disposition: inline List-Id: linux-fsdevel.vger.kernel.org This fixes a test in the LSB test suite. The kernel sets O_LARGEFILE implicitely on 64bit hosts. According to POSIX it should not appear on F_GETFL then. Just mask it out always. This will also mask it out for explicitely set O_LARGEFILE, but that seems to be ok. Any flames for this please to the POSIX comittee, not to me. -Andi diff -X ../../KDIFX -burpN linux-2.4.23-pre5/fs/fcntl.c linux-merge/fs/fcntl.c --- linux-2.4.23-pre5/fs/fcntl.c 2002-11-30 00:37:11.000000000 +0100 +++ linux-merge/fs/fcntl.c 2002-11-30 05:22:20.000000000 +0100 @@ -270,7 +270,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();