vserver 1.9.3
[linux-2.6.git] / arch / um / drivers / null.c
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #include <stdlib.h>
7 #include <errno.h>
8 #include "chan_user.h"
9 #include "os.h"
10
11 static int null_chan;
12
13 void *null_init(char *str, int device, struct chan_opts *opts)
14 {
15         return(&null_chan);
16 }
17
18 int null_open(int input, int output, int primary, void *d, char **dev_out)
19 {
20         *dev_out = NULL;
21         return(os_open_file(DEV_NULL, of_rdwr(OPENFLAGS()), 0));
22 }
23
24 int null_read(int fd, char *c_out, void *unused)
25 {
26         return(-ENODEV);
27 }
28
29 void null_free(void *data)
30 {
31 }
32
33 struct chan_ops null_ops = {
34         .type           = "null",
35         .init           = null_init,
36         .open           = null_open,
37         .close          = generic_close,
38         .read           = null_read,
39         .write          = generic_write,
40         .console_write  = generic_console_write,
41         .window_size    = generic_window_size,
42         .free           = null_free,
43         .winch          = 0,
44 };
45
46 /*
47  * Overrides for Emacs so that we follow Linus's tabbing style.
48  * Emacs will notice this stuff at the end of the file and automatically
49  * adjust the settings for this buffer only.  This must remain at the end
50  * of the file.
51  * ---------------------------------------------------------------------------
52  * Local variables:
53  * c-file-style: "linux"
54  * End:
55  */