History log of /freebsd-10.1-release/lib/libutil/pidfile.3
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 231193 08-Feb-2012 pjd

Add a comment to the example that pidfile_* functions can handle pfh being NULL.

MFC after: 3 days


# 231192 08-Feb-2012 pjd

Note that calling pidfile_write(3) multiple times is fine.

MFC after: 3 days


# 230234 16-Jan-2012 ghelmer

Remove unnecessary includes from these libutil man pages.

Requested by bde (as was the previous commit).


# 230010 12-Jan-2012 ghelmer

pidfile_open() no longer uses fcntl() to set the close-on-exec flag.


# 229942 10-Jan-2012 ghelmer

Style fixes courtesy of pjd.


# 229941 10-Jan-2012 ghelmer

Document that pidfile_open() now sets the FD_CLOEXEC flag on the open
file descriptor, and that errors can be returned as a result of the
fcntl(2) system call.


# 229937 10-Jan-2012 ghelmer

Add pidfile_fileno() to obtain the file descriptor for an open
pidfile.


# 226450 16-Oct-2011 pjd

In pidfile_open(), if the pidfile is locked, but empty (PID is not stored yet)
and the caller requested other process' PID by passing non-NULL pidptr
argument, we will wait at most 100ms for the PID to show up in the file and if
it won't, we will store -1 in *pidptr.

From now on, pidfile_open() function never sets errno to EAGAIN on failure.

In collaboration with: des
MFC after: 1 week


# 193589 06-Jun-2009 des

Add missing .Pp


# 184092 20-Oct-2008 des

pidfile(3) uses flopen(3) - don't make any assumptions about how the
latter is implemented.


# 172611 13-Oct-2007 simon

Minor mdoc cleanup: Every sentence should start on its own line.


# 172577 12-Oct-2007 kib

When pidfile is already locked and has zero length, do not return
success and zero pid from pidfile_read(). Return EAGAIN instead. Sleep
up to three times for 5 ms while waiting for pidfile to be written.

mount(8) does the kill(mountpid, SIGHUP). If mountd pidfile is truncated,
that would result in the SIGHUP delivered to the mount' process group
instead of the mountd.

Found and analyzed by: Peter Holm
Tested by: Peter Holm, kris
Reviewed by: pjd
MFC after: 1 week


# 156280 04-Mar-2006 keramida

Use `intmax_t' instead of plain `int' for pid_t casts.

Useful tips from: ru, bde
Approved by: pjd
MFC after: 3 days


# 154952 28-Jan-2006 pjd

- Add a note that passing NULL to pidfile_write(), pidfile_remove() and
pidfile_close() functions is safe. This possibility is used in example code.
- Cast pid_t to int.

Requested by: yar


# 152579 18-Nov-2005 ru

Fix markup, grammar and spelling.


# 150214 16-Sep-2005 pjd

Pidfiles should be created with permission preventing users from opening
them for reading. When user can open file for reading, he can also
flock(2) it, which can lead to confusions.

Pointed out by: green


# 149423 24-Aug-2005 pjd

Add a family of functions for reliable pidfiles handling.

Idea from: jmg
Discussed on: arch@