File: umdevnull.c

package info (click to toggle)
umview 0.8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,472 kB
  • sloc: ansic: 67,305; sh: 11,160; ruby: 914; makefile: 424; python: 141
file content (36 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (6)
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
#include <stdio.h>
#include "umdev.h"
#include <config.h>

static int null_open(char type, dev_t device, struct dev_info *di)
{
	printf("null_open %c %d %d flag %x\n",type,major(device),minor(device),di->flags);
	return 0;
}

static int null_read(char type, dev_t device, char *buf, size_t len, loff_t pos,struct dev_info *di)
{
	printf("null_read %c %d %d len %d\n",type,major(device),minor(device),len);
	return 0;
}

static int null_write(char type, dev_t device, const char *buf, size_t len, loff_t pos, struct dev_info *di)
{
	printf("null_write %c %d %d len %d\n",type,major(device),minor(device),len);
	return len;
}

static int null_release(char type, dev_t device, struct dev_info *di)
{
	printf("null_release %c %d %d flag %x\n",type,major(device),minor(device),di->flags);
	return 0;
}

struct umdev_operations umdev_ops={
	.open=null_open,
	.read=null_read,
	.write=null_write,
	.release=null_release,
};