From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:00:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FFBE1065671; Mon, 20 Oct 2008 18:00:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DDAE8FC14; Mon, 20 Oct 2008 18:00:11 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KI0BFh077295; Mon, 20 Oct 2008 18:00:11 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KI0BQG077294; Mon, 20 Oct 2008 18:00:11 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201800.m9KI0BQG077294@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 18:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184092 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 18:00:11 -0000 Author: des Date: Mon Oct 20 18:00:11 2008 New Revision: 184092 URL: http://svn.freebsd.org/changeset/base/184092 Log: pidfile(3) uses flopen(3) - don't make any assumptions about how the latter is implemented. Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Mon Oct 20 17:41:08 2008 (r184091) +++ head/lib/libutil/pidfile.3 Mon Oct 20 18:00:11 2008 (r184092) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 22, 2005 +.Dd October 20, 2008 .Dt PIDFILE 3 .Os .Sh NAME @@ -51,16 +51,14 @@ The .Nm pidfile family of functions allows daemons to handle PID files. It uses -.Xr flock 2 +.Xr flopen 3 to lock a pidfile and detect already running daemons. .Pp The .Fn pidfile_open function opens (or creates) a file specified by the .Fa path -argument and locks it with the -.Xr flock 2 -system call. +argument and locks it. If a file can not be locked, a PID of an already running daemon is returned in the .Fa pidptr @@ -233,16 +231,17 @@ function may also fail and set .Va errno for any errors specified for the .Xr close 2 , -.Xr flock 2 , .Xr fstat 2 , .Xr write 2 , and .Xr unlink 2 -calls. +system calls and the +.Xr flopen 3 +library function. .Sh SEE ALSO -.Xr flock 2 , .Xr open 2 , -.Xr daemon 3 +.Xr daemon 3 , +.Xr flopen 3 .Sh AUTHORS .An -nosplit The