File: device.h

package info (click to toggle)
lilo 21-4
  • links: PTS
  • area: main
  • in suites: slink
  • size: 812 kB
  • ctags: 895
  • sloc: ansic: 3,420; asm: 2,546; sh: 767; perl: 607; makefile: 193; cpp: 3
file content (36 lines) | stat: -rw-r--r-- 819 bytes parent folder | download | duplicates (4)
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
35
36
/* device.h  -  Device access */

/* Copyright 1992-1996 Werner Almesberger. See file COPYING for details. */


#ifndef DEVICE_H
#define DEVICE_H

#include <sys/stat.h>


typedef struct {
    int fd;
    struct stat st;
    char *name;
    int delete;
} DEVICE;


int dev_open(DEVICE *dev,int number,int flags);

/* Searches /dev for a block device with the specified number. If no device
   can be found, a temporary device is created. The device is opened with
   the specified access mode and the file descriptor is returned. If flags
   are -1, the device is not opened. */

void dev_close(DEVICE *dev);

/* Closes a device that has previously been opened by dev_open. If the device
   had to be created, it is removed now. */

void preload_dev_cache(void);

/* Preloads the device number to name cache. */

#endif