Re: Syslets, Threadlets, generic AIO support, v6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Linus Torvalds wrote:
> Well, don't think of it as a special case at all: think of bit 30 as a 
> "the user asked for a non-linear fd".

This sounds easy but doesn't really solve all the issues.  Let me repeat
your example and the solution currently in use:

problem: application wants to close all file descriptors except a select
few, cleaning up what is currently open.  It doesn't know all the
descriptors that are open.  Maybe all this in preparation of an exec call.

Today the best method to do this is to readdir() /proc/self/fd and
exclude the descriptors on the whitelist.

If the special, non-sequential descriptors are also listed in that
directory the runtimes still cannot use them since they are visible.

If you go ahead with this, then at the very least add a flag which
causes the descriptor to not show up in /proc/*/fd.


You also have to be aware that open() is just one piece of the puzzle.
What about socket()?  I've cursed this interface many times before and
now it's biting you: there is parameter to pass a flag.  What about
transferring file descriptors via Unix domain sockets?  How can I decide
the transferred descriptor should be in the private namespace?

There are likely many many more problems and cornercases like this.

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

iD8DBQFGXfD12ijCOnn/RHQRAk4nAJ0Zjevd9Y0lQa/fLzKK+BshcLVbngCfSspI
ALNKu8VCKy7CvoIqJD3Xs/Y=
=+fM8
-----END PGP SIGNATURE-----
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux