pidfile(3) uses flopen(3) - don't make any assumptions about how the
latter is implemented.
This commit is contained in:
parent
51e75198fa
commit
cb7cd07a07
@ -24,7 +24,7 @@
|
|||||||
.\"
|
.\"
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd August 22, 2005
|
.Dd October 20, 2008
|
||||||
.Dt PIDFILE 3
|
.Dt PIDFILE 3
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -51,16 +51,14 @@ The
|
|||||||
.Nm pidfile
|
.Nm pidfile
|
||||||
family of functions allows daemons to handle PID files.
|
family of functions allows daemons to handle PID files.
|
||||||
It uses
|
It uses
|
||||||
.Xr flock 2
|
.Xr flopen 3
|
||||||
to lock a pidfile and detect already running daemons.
|
to lock a pidfile and detect already running daemons.
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Fn pidfile_open
|
.Fn pidfile_open
|
||||||
function opens (or creates) a file specified by the
|
function opens (or creates) a file specified by the
|
||||||
.Fa path
|
.Fa path
|
||||||
argument and locks it with the
|
argument and locks it.
|
||||||
.Xr flock 2
|
|
||||||
system call.
|
|
||||||
If a file can not be locked, a PID of an already running daemon is returned in
|
If a file can not be locked, a PID of an already running daemon is returned in
|
||||||
the
|
the
|
||||||
.Fa pidptr
|
.Fa pidptr
|
||||||
@ -233,16 +231,17 @@ function may also fail and set
|
|||||||
.Va errno
|
.Va errno
|
||||||
for any errors specified for the
|
for any errors specified for the
|
||||||
.Xr close 2 ,
|
.Xr close 2 ,
|
||||||
.Xr flock 2 ,
|
|
||||||
.Xr fstat 2 ,
|
.Xr fstat 2 ,
|
||||||
.Xr write 2 ,
|
.Xr write 2 ,
|
||||||
and
|
and
|
||||||
.Xr unlink 2
|
.Xr unlink 2
|
||||||
calls.
|
system calls and the
|
||||||
|
.Xr flopen 3
|
||||||
|
library function.
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr flock 2 ,
|
|
||||||
.Xr open 2 ,
|
.Xr open 2 ,
|
||||||
.Xr daemon 3
|
.Xr daemon 3 ,
|
||||||
|
.Xr flopen 3
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.An -nosplit
|
.An -nosplit
|
||||||
The
|
The
|
||||||
|
Loading…
x
Reference in New Issue
Block a user