Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-04-20 08:26:34 +0400
committerChristopher Faylor <me@cgf.cx>2005-04-20 08:26:34 +0400
commiteb07f8c343ba7cdce21bc750c6eaa3f7a4804ab2 (patch)
tree131d7485a10457c66e953f7a01f12597d2f645f4 /winsup/doc/fhandler-tut.txt
parent5746f4b60228823e3690fe2b79158e291538dd99 (diff)
* fhandler-tut.txt: Update description to cygwin 1.5.13
Diffstat (limited to 'winsup/doc/fhandler-tut.txt')
-rw-r--r--winsup/doc/fhandler-tut.txt31
1 files changed, 21 insertions, 10 deletions
diff --git a/winsup/doc/fhandler-tut.txt b/winsup/doc/fhandler-tut.txt
index 213b32b20..00a3b4b94 100644
--- a/winsup/doc/fhandler-tut.txt
+++ b/winsup/doc/fhandler-tut.txt
@@ -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.