2 ms·
clone() can't either, if you call it like fork(). It's the semantics of fork() that are the problem.
by cryptonector 9y ago
clone() can't either, if you call it like fork(). It's the semantics of fork() that are the problem.
- arghwhat 9y agoThe difference being that the semantics of fork() are optional with clone(), not with fork(). Thus, I would say that clone() can handle the situation.
- cryptonector 9y agoThat's the point of clone(), but the point is that the problems of fork() are with its semantics. Even with clone(), if you want to spawn a new process then your best bet is to go with vfork() semantics -- in principle you could create a thread-like process sharing the parent's address space that can then exec() without affecting the parent, but in practice you can only do this inside a C library because the protocol for setting up TLS (for errno) is underdocumented and requires knowledge of and access to your C library's internals.