Re: Syslets, Threadlets, generic AIO support, v6



On Wed, 30 May 2007, Ingo Molnar wrote:

yeah - this is a fundamental design question for Linus i guess :-) glibc
(and other infrastructure libraries) have a fundamental problem: they
cannot (and do not) presently use persistent file descriptors to make
use of kernel functionality, due to ABI side-effects. [applications can
dup into an fd used by glibc, applications can close it - shells close
fds blindly for example, etc.] Today glibc simply cannot open a file
descriptor and keep it open while application code is running due to
these problems.

Here I think we are forgetting that glibc is userspace and there's no
separation between the application code and glibc code. An application
linking to glibc can break glibc in thousand ways, indipendently from fds
or not fds. Like complaining that glibc is broken because printf()
suddendly does not work anymore ;)

#include <stdio.h>
int main(void) {
close(fileno(stdout));
printf("Whiskey Tango Foxtrot?\n");
return 0;
}



- Davide


-
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/



Relevant Pages

  • Re: Syslets, Threadlets, generic AIO support, v6
    ... An application linking to glibc can break glibc in thousand ways, indipendently from fds or not fds. ... But this obviously works only if you dont have another thread messing with fds, or if you dont call a library function that opens a file. ... 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. ...
    (Linux-Kernel)
  • Re: Syslets, Threadlets, generic AIO support, v6
    ... for libraries to be able to open files and keep them open ... For example currently glibc is quite wasteful in a ... which tests the (cache-hot or cache-cold) cost of open-ing of two fds ...
    (Linux-Kernel)
  • Re: Syslets, Threadlets, generic AIO support, v6
    ... for libraries to be able to open files and keep them open ... For example currently glibc is quite wasteful in a ... which tests the (cache-hot or cache-cold) cost of open-ing of two fds ...
    (Linux-Kernel)