MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / arch / um / drivers / null.c
blob66b2fbe3dfb2e387c8e9ea4a7eb4b4a56a8fe89f
1 /*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
6 #include <stdlib.h>
7 #include <errno.h>
8 #include "chan_user.h"
9 #include "os.h"
11 static int null_chan;
13 void *null_init(char *str, int device, struct chan_opts *opts)
15 return(&null_chan);
18 int null_open(int input, int output, int primary, void *d, char **dev_out)
20 *dev_out = NULL;
21 return(os_open_file(DEV_NULL, of_rdwr(OPENFLAGS()), 0));
24 int null_read(int fd, char *c_out, void *unused)
26 return(-ENODEV);
29 void null_free(void *data)
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,
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: