On Sun, 10 Jun 2007, Eric Dumazet wrote: > Linus Torvalds a écrit : > > > > close(0); > > close(1); > > close(2); > > .. generate filenames, whatever .. > > if (open(..) < 0 || open(..) < 0 || open(..) < 0) > > die("Couldn't redirect stdin/stdout/stderr"); > > > > and there's absolutely nothing wrong with this kind of setup, even if you > > could obviously have done it other ways too (ie by using "dup2()" instead of > > "close + open"), > > This kind of setup was OK 25 years ago, before multithreading era. > You cannot reasonably expect it to work in a multithreaded program. Who said _anything_ about threading? The above is a totally non-threaded app. 99% of all applications are like that. Threading is for the 1%. But 99% is what we need to make sure works. Linus
- References:
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Al Viro <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Ulrich Drepper <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Al Viro <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Ulrich Drepper <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Al Viro <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Ulrich Drepper <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Al Viro <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Ulrich Drepper <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Al Viro <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Kyle Moffett <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Al Viro <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Linus Torvalds <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- From: Eric Dumazet <[email protected]>
- Re: [patch 7/8] fdmap v2 - implement sys_socket2
- Prev by Date: Re: 2.6.22-rc3 nmi watchdog hang
- Next by Date: Re: [RFD] Documentation/HOWTO translated into Japanese
- Previous by thread: Re: [patch 7/8] fdmap v2 - implement sys_socket2
- Next by thread: Re: [patch 7/8] fdmap v2 - implement sys_socket2
- Index(es):