Next: , Previous: , Up: Top   [Contents][Index]

6 Special Files

In Unix, any file that does not act as a general-purpose unit of storage is called a special file. These are FIFOs, Unix-domain sockets, and device nodes. In the Hurd, there is no need for the “special file” distinction, since they are implemented by translators, just as regular files are.

Nevertheless, the Hurd maintains this distinction, in order to provide backward compatibility for Unix programs (which do not know about translators). Studying the implementation of Hurd special files is a good way to introduce the idea of translators to people who are familiar with Unix.

This chapter does not discuss /dev/zero or any of the microkernel-based devices, since these are translated by the generalized storeio server (FIXME xref).

FIXME: finish


Next: , Up: Special Files   [Contents][Index]

6.1 fifo


Next: , Previous: , Up: Special Files   [Contents][Index]

6.2 ifsock


Next: , Previous: , Up: Special Files   [Contents][Index]

6.3 magic


Next: , Previous: , Up: Special Files   [Contents][Index]

6.4 null


Previous: , Up: Special Files   [Contents][Index]

6.5 devnode

devnode is a translator that creates the device file for the device, which provides another way for other programs to open the device.

Clients need to get the port to the devnode translator by calling file_name_lookup() and uses this port as a master device port to open the device by calling device_open(). The device name used in device_open() is specified by --name of devnode.


Up: devnode   [Contents][Index]

6.5.1 Invoking devnode

Usage: devnode [option…]

--name=devicename
-n

Define the device name used by clients in device_open().

--master-device=devicefile
-M

Get a pseudo master device port

Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options.

If --name is specified, the client must use the device name in device_open. Otherwise, any device name is acceptable.

--master-device can be useful to open the virtual interface created by some other programs, for example by eth-multiplexer.

FIXME: a chapter on libtreefs and libdirmgt will probably go here


Up: devnode   [Contents][Index]