Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Aug 1997 07:20:03 -0700 (PDT)
From:      Peter Wemm <peter@spinner.dialix.com.au>
To:        freebsd-bugs
Subject:   Re: kern/4243: file locking doesn't work for pipe 
Message-ID:  <199708071420.HAA09554@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/4243; it has been noted by GNATS.

From: Peter Wemm <peter@spinner.dialix.com.au>
To: David Greenman <dg@root.com>
Cc: tetsuya@secom-sis.co.jp, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/4243: file locking doesn't work for pipe 
Date: Thu, 07 Aug 1997 22:12:12 +0800

 David Greenman wrote:
 >  >In flock() in /sys/kern/kern_descrip.c, the following statement:
 >  >
 >  >    f (fp->f_type != DTYPE_VNODE)
 >  >	    return (EOPNOTSUPP);
 >  >
 >  >rejects the file descriptor if fp->f_type == DTYPE_PIPE.
 >  >F_SETLK and F_GETLK of fcntl() have also the similar statements.
 >  >
 >  >"Program rewriting map" (RewriteMap mapname prg:filename) of
 >  >the URL rewriting module (mod_rewrite) of the Apache HTTP server
 >  >uses file locking for pipe, so FreeBSD users cannot use the fine
 >  >feature of "program rewriting map".
 >  
 >     Hmmm. Maybe I'm missing something obvious, but I can't think of a reason
 >  why one would want to do file locking on a pipe (which is not a shared
 >  resource). This sounds like a bug in Apache to me...
 
 It's been around for a while..  I've also seen it used to syncronise 
 multiple listeners on the same socket on systems where it's not safe to 
 listen on a socket, fork N children and have them all do an accept().  I 
 don't remember where I saw that first, but I'm pretty sure I've seen it in 
 use on one of the http daemons, possibly the NCSA one or early apache code.
 
 Yeah, it's kinda nonsensical, but useful in certain situations where the 
 same fd is shared between processes. If we could support it without too 
 much effort it'd be kinda handy.
 
 >  -DG
 >  
 >  David Greenman
 >  Core-team/Principal Architect, The FreeBSD Project
 > 
 
 Cheers,
 -Peter
 
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708071420.HAA09554>