May. 27th, 2013 15:59
Proposal for a new syscall
pitchfork() - daemon fork
Much like fork(), except that the new child automatically also setsid()'s and:
- Has a umask of 0 and working directory "/"
- SIGHUP set to ignore
- Gets new stdin, stdout, stderr handles, all tied to /dev/null
[ Apologizes to non-unix-geek readers. Maybe you'll like my next post. ]
Much like fork(), except that the new child automatically also setsid()'s and:
- Has a umask of 0 and working directory "/"
- SIGHUP set to ignore
- Gets new stdin, stdout, stderr handles, all tied to /dev/null
[ Apologizes to non-unix-geek readers. Maybe you'll like my next post. ]
no subject
I had to look up setsid and came across this interesting bit: http://stackoverflow.com/questions/2613104/why-fork-before-setsid
no subject
In all seriousness, of course it shouldn't be a new syscall, but it would make a lot of sense to write a little thing called libdaemon that did this sort of thing right, maybe ship it with libc? While I'm dreaming, it could be packaged with gflags and a few other things to encourage people to write their C tools in a standard non-insane way.
no subject
no subject
Just to make your next syscall() easier..
no subject