Re: [PATCH] Add cloexec information to fdinfo

From: PÃdraig Brady
Date: Wed Jun 29 2011 - 06:52:04 EST


On 29/06/11 09:15, Ulrich Drepper wrote:
> On 06/28/2011 01:23 PM, Linus Torvalds wrote:
>> The description makes no mention of why this would be needed?
>
> In this specific case I was trying to re-implement the pfiles program.
> For normal file descriptors (not sockets) this was the last piece of
> information which wasn't available. This is all part of my "give
> Solaris users no reason to not switch" effort. I intend to offer the
> code to the util-linux-ng maintainers.

For the curious (me):

solaris:~ > pfiles $$
8418: -bash
Current rlimit: 256 file descriptors
0: S_IFCHR mode:0620 dev:349,28 ino:130202 uid:11003 gid:7 rdev:24,116
O_RDWR|O_NOCTTY|O_LARGEFILE
/dev/pts/116
1: S_IFCHR mode:0620 dev:349,28 ino:130202 uid:11003 gid:7 rdev:24,116
O_RDWR|O_NOCTTY|O_LARGEFILE
/dev/pts/116
2: S_IFCHR mode:0620 dev:349,28 ino:130202 uid:11003 gid:7 rdev:24,116
O_RDWR|O_NOCTTY|O_LARGEFILE
/dev/pts/116
3: S_IFDOOR mode:0444 dev:347,0 ino:189 uid:0 gid:0 size:0
O_RDONLY|O_LARGEFILE FD_CLOEXEC door to nscd[11276]
/var/run/name_service_door
255: S_IFCHR mode:0620 dev:349,28 ino:130202 uid:11003 gid:7 rdev:24,116
O_RDWR|O_NOCTTY|O_LARGEFILE FD_CLOEXEC
/dev/pts/116

I guess `lsof +f g` could be suitably embellished as well.

cheers,
PÃdraig.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/