GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
xt_daemonize(3) FreeBSD Library Functions Manual xt_daemonize(3)

xt_daemonize() - Detach process from terminal

#include <xtend/proc.h>
-lxtend

int     xt_daemonize(int nochdir, int noclose)

nochdir:    If true (non-zero), do not chdir("/")
noclose:    If true, do not redirect standard descriptors to /dev/null

Daemonize a process, using the double-fork() method to ensure that it cannot attach to a controlling tty (terminal). The interface is identical to the BSD daemon(3) function, but daemon(3) only performs a single fork, so there is a risk that the resulting process could attach to a termimal.

The double-fork() entails additional overhead compared to daemon(3), but ensures that the process cannot aquire a controlling terminal and be affected by signals from the keyboard.

daemon(3) is deprecated on macOS as of this writing.

0 on success, -1 on failure

xt_daemonize(0, 0);

daemon(3), fork(2), setsid(2)


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.