File: device.h

package info (click to toggle)
librudiments0 0.27-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,528 kB
  • ctags: 2,284
  • sloc: cpp: 14,657; sh: 7,547; ansic: 2,664; makefile: 945; xml: 15
file content (34 lines) | stat: -rw-r--r-- 917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2004 David Muse
// See the COPYING file for more information.

#ifndef RUDIMENTS_DEVICE_H
#define RUDIMENTS_DEVICE_H

#include <rudiments/private/deviceincludes.h>

// The device class provides methods for interacting with devices.

class device : public file {
	public:

			device();
			// Creates an uninitialized instance of the
			// device class.
		virtual	~device();

		static bool	createDeviceNode(const char *filename,
						bool blockdevice,
						unsigned short major,
						unsigned short minor,
						mode_t perms);
			// Creates device node "filename" with major number
			// "major" and minor number "minor".  The device node
			// will be created as a block device if "blockdevice"
			// is true, otherwise it will be created as a character
			// device.  The device node will be assigned
			// permissions "perms".
			//
			// Returns true on success and false on failure.
};

#endif