/cygdrive in CVS? Time for 1.5.6 soon.

Corinna Vinschen vinschen@redhat.com
Mon Dec 1 20:51:00 GMT 2003

On Mon, Dec 01, 2003 at 02:28:20PM -0500, Nicholas Wourms wrote:
> vinschen@redhat.com wrote:
> >On Mon, Dec 01, 2003 at 01:23:47PM -0500, Nicholas Wourms wrote:
> >>-   flocks.l_type = type ? F_RDLCK : F_WRLCK;
> >>+   flocks.l_type = F_RDLCK : F_WRLCK;
> >
> >Yes, that makes a lot more sense.  Interested to submit a patch?
> Sure I'll cook one up shortly.  I'm also currently porting some of the 
> LTP flock tests, so when I'm finished I'd like to submit them in one shot.

Btw., perhaps it's not that good an idea to implement flock using
fcntl in Cygwin.  According to the Linux manpage, flock only places
advisory locks:

"flock(2) places advisory locks only; given suitable permissions on a
 file, a process is free to ignore the use of flock(2) and perform I/O
 on the file."

Given that also the Linux kernel had problems with emulating flock
using fcntl once, it might be a good idea to think about another
solution, for instance keeping the flocked regions in a linked list
within a per file table or something, and use this information only
across applications using flock on the same files.  Due to the pure
advisory quality of the locking, the files don't have to be actually
locked using Windows system calls.  Just flock has to return sensible
values.  As on Linux, this would also have the advantage of having
flock and fcntl semantics entirely separated.

> extern "C" int
> mkfifo (const char *path, mode_t mode)
> {
>   return (mknod (path, (mode_t) (mode|S_IFIFO), 0));
> }

Doesn't look wrong so, go ahead and submit a patch ;-)


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

More information about the Cygwin-developers mailing list