Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
69bcc951
Commit
69bcc951
authored
Feb 11, 2011
by
Stewart Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add daemon.h and documentation on functions
parent
bc10f8a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
ccan/daemon-with-notify/daemon.h
ccan/daemon-with-notify/daemon.h
+32
-0
No files found.
ccan/daemon-with-notify/daemon.h
0 → 100644
View file @
69bcc951
#ifndef CCAN_DAEMON_WITH_NOTIFY_H
#define CCAN_DAEMON_WITH_NOTIFY_H
/**
* daemonize - turns this process into a daemon
*
* This routine will fork() us off to become a daemon. It will return
* -1 on error and 0 on success.
*
* It has a few optional behaviours:
* @nochdir: if nochdir is set, it won't chdir to /
* this means we could hold onto mounts
* @noclose: if noclose is set, we won't close stdout, stdin and stderr.
* @wait_sigusr1: if wait_sigusr1 is set, the parent will not exit until the
* child has either exited OR it receives a SIGUSR1 signal. You can use this
* to have the parent only exit when your process has done all the
* danegerous initialization that could cause it to fail to start
* (e.g. allocating large amounts of memory, replaying REDO logs).
* This allows init scripts starting the daemon to easily report
* success/failure.
*/
int
daemonize
(
int
nochdir
,
int
noclose
,
int
wait_sigusr1
);
/**
* daemon_is_ready - signals parent that it can exit, we started okay
*
* After a daemonize() call, this function will send a SIGUSR1 to the parent
* telling it to exit as we have started up okay.
*/
int
daemon_is_ready
(
void
);
#endif
/* CCAN_DAEMON_WITH_NOTIFY_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment