whats a good magic number for fifo's?

Robert Collins robert.collins@itdomain.com.au
Tue Mar 27 05:08:00 GMT 2001

---- Original Message -----
From: "Egor Duda" <deo@logos-m.ru>
To: "Robert Collins" <robert.collins@itdomain.com.au>
Cc: <cygwin-developers@cygwin.com>
Sent: Tuesday, March 27, 2001 10:55 PM
Subject: Re: whats a good magic number for fifo's?

> Hi!
> Tuesday, 27 March, 2001 Robert Collins robert.collins@itdomain.com.au
> RC> The title says it all.
> RC> I'm extending the magic number checks in fhandler_base... this
will have
> RC> a performance impact (the assume exe flag and/or ntsec will no
> RC> shortcut the file open and read tests). I'm open to suggestions
> RC> marking the file as a fifo without magic numbers.
> how about using symlinks pointing to some special destination (for
> example to '/cygdrive/fifo')? all we need to do in this case is to
> slightly modify current symlink resolution code.
> Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet

Hmm. Because I didn't think of that :]

Lets see if it passes the "poke holes in the idea test"

because it doesn't work with todays code (using /dev/clipboard as an
existing example):

administrator@LIFELESSWKS /dev
$ ls

administrator@LIFELESSWKS /dev
$ ls -s /dev/clipboard myclip
ls: myclip: No such file or directory
   0 /dev/clipboard

administrator@LIFELESSWKS /dev
$ ls

administrator@LIFELESSWKS /dev
$ cat /dev/clipboard
administrator@LIFELESSWKS /dev

And 1 challenge at a time is enough for me. Although it does work to
/dev/mem. Hmm. I might try and debug this one a little more.

On the other hand there are questions about users modifying the
shortcut, windows link tracking manager, and the time it takes to
resolve the shortcut (vs checking it's exactly 3 bytes long and reading
the special). note: I don't know the answers to these potential issues.

Finally, if we want to do an external interoperable (via a new .lib ?)
fifo implementation (it'd be neat to have mingw interoperate with this
fir example) then shortcuts may not be the best way. (We've got two
shortcut formats in cygwin - if a user is running the old form, then
that code has to be exported as well.)


More information about the Cygwin-developers mailing list