[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E097DCE.1090004@akkadia.org>
Date: Tue, 28 Jun 2011 03:07:58 -0400
From: Ulrich Drepper <drepper@...adia.org>
To: Andrew Morton <akpm@...ux-foundation.org>
CC: kosaki.motohiro@...fujitsu.com, linux-kernel@...r.kernel.org,
rientjes@...gle.com, torvalds@...ux-foundation.org,
viro@...iv.linux.org.uk, wilsons@...rt.ca,
linux-man@...r.kernel.org,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Chris Zankel <chris@...kel.net>
Subject: Re: [PATCH] Add cloexec information to fdinfo
On 06/20/2011 05:31 PM, Andrew Morton wrote:
> Does FD_ISSET return 0 or 1? Or 0 or non-zero?
>
> For x86 it's the former.
>
> <checks the architectures>
>
> arch/h8300/include/asm/posix_types.h: busted
> #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
>
> arch/m68k/include/asm/posix_types.h: busted
> #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
>
> arch/xtensa/include/asm/posix_types.h: busted
> #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
I agree, this is an issue. Existing code works around this. We should
use the attached patch on top of the existing one.
This doesn't invalidate your patch to harmonize the architectures but
the above is what existing code does. I didn't use a tab in the output
since the initial string is long enough to force the subsequent text in
a new column. Using a single space seemed more visually pleasing.
Signed-off-by: Ulrich Drepper <drepper@...il.com>
--- a/fs/proc/base.c 2011-06-28 02:54:01.888793757 -0400
+++ b/fs/proc/base.c 2011-06-28 02:54:30.668664335 -0400
@@ -1939,7 +1939,7 @@
"cloexec:\t%d\n",
(long long) file->f_pos,
file->f_flags,
- cloexec);
+ cloexec ? FD_CLOEXEC : 0);
}
spin_unlock(&files->file_lock);
put_files_struct(files);
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists