cos: (Default)
[personal profile] cos
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. ]
Date: 2013-05-28 15:38 (UTC)

From: [identity profile] en-ki.livejournal.com
Love it.

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.

February 2025

S M T W T F S
      1
2345678
91011121314 15
16171819202122
232425262728 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 16th, 2026 12:24
Powered by Dreamwidth Studios