> > 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. Why not. When execution begins which is the normal point you do this then you've got one thread. If you need to do this from a thread after that point posix provides threaded applications with locking. Not much else works in a threaded app if you get the locking wrong, and that is considered the authors job. Why is fd allocation different ? - 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/
- 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: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
- Next by Date: Re: [patch 7/8] fdmap v2 - implement sys_socket2
- 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):