From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulrich Drepper Subject: Re: [PATCH] Add cloexec information to fdinfo Date: Tue, 28 Jun 2011 03:07:58 -0400 Message-ID: <4E097DCE.1090004@akkadia.org> References: <201106100355.p5A3t8Aa024924@drepperk.user.openhosting.com> <20110620143131.9c6e040c.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig9A9705871A68BA8FF54D72F8" Return-path: In-Reply-To: <20110620143131.9c6e040c.akpm@linux-foundation.org> Sender: linux-kernel-owner@vger.kernel.org To: Andrew Morton 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 , Geert Uytterhoeven , Chris Zankel List-Id: linux-man@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9A9705871A68BA8FF54D72F8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/20/2011 05:31 PM, Andrew Morton wrote: > Does FD_ISSET return 0 or 1? Or 0 or non-zero? >=20 > For x86 it's the former. >=20 > >=20 > arch/h8300/include/asm/posix_types.h: busted > #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK= (d)) >=20 > arch/m68k/include/asm/posix_types.h: busted > #define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK= (d)) >=20 > 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 --- 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); --------------enig9A9705871A68BA8FF54D72F8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAk4Jfc4ACgkQ2ijCOnn/RHQ05gCgu4yikszRPlgoAIDnhuhVzyA4 v4EAmwURz4ww9sirtln/5ELsYayqV2fD =Xsaa -----END PGP SIGNATURE----- --------------enig9A9705871A68BA8FF54D72F8--