I’d like to use the namespacing features of the clone function. Reading the manpage, it seems like clone has lots of intricate details I need to worry about.
Is there an equivalent clone invocation to good ol’ fork()?
I’m already familiar with fork, and believe that if I have a starting point in clone, I can add flags and options from there.
I think that this will work, but I’m not entirely certain about some of the pointer arguments.
In the flags parameter the lower byte of it is used to specify which signal to send to notify the parent of the thread doing things like dying or stopping. I believe that all of the actual flags turn on switches which are different from
fork. Looking at the kernel code suggests this is the case.If you really want to get something close to
forkyou may want to callsys_clonewhich does not take function pointer and instead returns twice likefork.