From: Ulrich Drepper <drepper@akkadia.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kosaki.motohiro@jp.fujitsu.com, linux-kernel@vger.kernel.org,
rientjes@google.com, torvalds@linux-foundation.org,
viro@zeniv.linux.org.uk, wilsons@start.ca,
linux-man@vger.kernel.org,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Geert Uytterhoeven <geert@linux-m68k.org>,
Chris Zankel <chris@zankel.net>
Subject: Re: [PATCH] Add cloexec information to fdinfo
Date: Tue, 28 Jun 2011 03:07:58 -0400 [thread overview]
Message-ID: <4E097DCE.1090004@akkadia.org> (raw)
In-Reply-To: <20110620143131.9c6e040c.akpm@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]
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@gmail.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);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
next prev parent reply other threads:[~2011-06-28 7:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-10 3:55 [PATCH] Add cloexec information to fdinfo drepper
2011-06-13 2:54 ` KOSAKI Motohiro
2011-06-20 21:31 ` Andrew Morton
2011-06-28 7:07 ` Ulrich Drepper [this message]
2011-06-28 17:23 ` Linus Torvalds
2011-06-29 8:15 ` Ulrich Drepper
2011-06-29 10:51 ` Pádraig Brady
2011-06-29 16:22 ` Linus Torvalds
2011-06-29 18:05 ` Linus Torvalds
2011-06-30 2:59 ` Ulrich Drepper
2011-06-30 13:39 ` Ulrich Drepper
2011-06-30 16:07 ` Linus Torvalds
2011-08-05 11:49 ` Ulrich Drepper
2011-08-06 18:58 ` Linus Torvalds
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E097DCE.1090004@akkadia.org \
--to=drepper@akkadia.org \
--cc=akpm@linux-foundation.org \
--cc=chris@zankel.net \
--cc=geert@linux-m68k.org \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=rientjes@google.com \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=wilsons@start.ca \
--cc=ysato@users.sourceforge.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox