[lkml]   [2007]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Syslets, Threadlets, generic AIO support, v6
Hash: SHA1

Linus Torvalds wrote:
> for (i = 0; i < NR_OPEN; i++)
> close(i);
> to clean up all file descriptors before doing something new. And yes, I
> think it was bash that used to *literally* do something like that a long
> time ago.

Indeed. It was not only bash, though, I fixed probably a dozen
applications. But even the new and better solution (readdir of
/proc/self/fd) does not prevent the problem of closing descriptors the
system might still need and the application doesn't know about.

> Which *could* be something as simple as saying "bit 30 in the file
> descriptor specifies a separate fd space" along with some flags to make
> open and friends return those separate fd's.

I don't like special cases. For me things better come in quantities 0,
1, and unlimited (well, reasonable high limit). Otherwise, who gets to
use that special namespace? The C library is not the only body of code
which would want to use descriptors.

And then the semantics: do these descriptors should show up in
/proc/self/fd? Are there separate directories for each namespace? Do
they count against the rlimit?

This seems to me like a shot from the hips without thinking about other

- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
Version: GnuPG v1.4.7 (GNU/Linux)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-05-30 23:21    [W:0.153 / U:0.332 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site