* fhandler-tut.txt: Update description to cygwin 1.5.13

This commit is contained in:
Christopher Faylor 2005-04-20 04:26:34 +00:00
parent 5746f4b602
commit eb07f8c343
2 changed files with 25 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2005-04-20 Gerd Spalink <Gerd.Spalink@t-online.de>
* fhandler-tut.txt: Update description to cygwin 1.5.13
2005-04-19 Corinna Vinschen <corinna@vinschen.de>
* cygwinenv.sgml: Mention that check_case is deprecated.

View File

@ -6,7 +6,7 @@ showing an example of /dev/zero.
Files to note:
fhandler.h - must define a new derived class here and FH_*
path.cc - to notice "/dev/zero" and mark it
devices.in - to notice "/dev/zero" and mark it
fhandler_zero.cc - new
dtable.cc - to create the fhandler instance
@ -27,23 +27,34 @@ simulating everything. Thus:
handle of -1, which (1) maps swap memory, and (2) zeros it out for
us (at least, on NT).
OK, let's start with fhandler.h.
OK, let's start with devices.h.
First, update the comment about which files are where. We're adding
fhandler_dev_zero as FH_DEV_ZERO. We're adding this as a "fast"
device (it will never block) so we have to adjust FH_NDEV also.
We have to create a new entry in the enum fh_devices. The new
devices must get a major and a minor ID. As a rule of thumb, just
copy the ones that are used on a linux system.
Later in that file, we'll copy fhandler_dev_null and edit it to be
Now, let's continue with fhandler.h.
First, update the fhandler_union near the end of the file with a
line for the new device. Use existing members, in this case __dev_null
as a template. This union is sorted alphabetically.
Earlier in that file, we'll copy fhandler_dev_null and edit it to be
fhandler_dev_zero. I chose that one because it's small, but we'll add
more members as we go (since we're simulating the whole thing). In
fact, let's copy the I/O methods from fhandler_windows since we'll
need all those anyway, even though we'll go through the full list
later.
OK, next we need to edit path.cc to recognize when the user is trying
to open "/dev/zero". Look in get_device_number; there's a long list
of cases, just add one (I added one after "null"). Also remember to
add an entry to the windows_device_names list in the right spot.
OK, next we need to edit devices.in. There is a section where each device
is listed with its cygwin path, its structure and its windows path.
"/dev/zero", FH_ZERO, "\\dev\\zero"
This is needed to recognize when the user is trying to open "/dev/zero".
You have to build devices.cc from devices.in now.
There is a script 'gendevices' in the winsup/cygwin directory which may
be called at some time in the future if you use 'make' to build the DLL.
This should rebuild the devices.cc file. You have to have shilka
available to do that; this is part of the cygwin cocom package.
To go along with that change, we'll need to change dtable.cc. Look for
FH_NULL and add a case for FH_ZERO as well.