source: rtems/cpukit/libmisc/devnull/devnull.c @ 77c4089

Last change on this file since 77c4089 was b9e230a2, checked in by Ralf Corsepius <ralf.corsepius@…>, on 07/08/03 at 08:38:15

2003-07-08 Ralf Corsepius <corsepiu@…>

  • capture/capture-cli.c: Add config-header support.
  • capture/capture.c: Add config-header support.
  • cpuuse/cpuuse.c: Add config-header support.
  • devnull/devnull.c: Add config-header support.
  • dummy/dummy.c: Add config-header support.
  • dumpbuf/dumpbuf.c: Add config-header support.
  • monitor/mon-command.c: Add config-header support.
  • monitor/mon-config.c: Add config-header support.
  • monitor/mon-dname.c: Add config-header support.
  • monitor/mon-driver.c: Add config-header support.
  • monitor/mon-extension.c: Add config-header support.
  • monitor/mon-itask.c: Add config-header support.
  • monitor/mon-manager.c: Add config-header support.
  • monitor/mon-monitor.c: Add config-header support.
  • monitor/mon-mpci.c: Add config-header support.
  • monitor/mon-object.c: Add config-header support.
  • monitor/mon-prmisc.c: Add config-header support.
  • monitor/mon-queue.c: Add config-header support.
  • monitor/mon-server.c: Add config-header support.
  • monitor/mon-symbols.c: Add config-header support.
  • monitor/mon-task.c: Add config-header support.
  • mw-fb/mw_fb.c: Add config-header support.
  • mw-fb/mw_uid.c: Add config-header support.
  • rtmonuse/rtmonuse.c: Add config-header support.
  • serdbg/serdbg.c: Add config-header support.
  • serdbg/serdbgio.c: Add config-header support.
  • serdbg/termios_printk.c: Add config-header support.
  • shell/cmds.c: Add config-header support.
  • stackchk/check.c: Add config-header support.
  • untar/untar.c: Add config-header support.
  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*  /dev/null
2 *
3 *  Derived from rtems' stub driver.
4 *
5 *  Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
6 *
7 *  COPYRIGHT (c) 1989-2000.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems.h>
22#include <rtems/devnull.h>
23#include <rtems/libio.h>
24
25/*  null_initialize
26 *
27 *  This routine is the null device driver init routine.
28 *
29 *  Input parameters:
30 *    major - device major number
31 *    minor - device minor number
32 *    pargp - pointer to parameter block
33 *
34 *  Output parameters:
35 *    rval       - NULL_SUCCESSFUL
36 */
37
38rtems_unsigned32 NULL_major;
39static char initialized;
40
41rtems_device_driver null_initialize(
42  rtems_device_major_number major,
43  rtems_device_minor_number minor,
44  void *pargp
45)
46{
47  rtems_device_driver status;
48 
49  if ( !initialized ) {
50    initialized = 1;
51
52    status = rtems_io_register_name(
53      "/dev/null",
54      major,
55      (rtems_device_minor_number) 0
56    );
57
58    if (status != RTEMS_SUCCESSFUL)
59      rtems_fatal_error_occurred(status);
60     
61    NULL_major = major;
62  }
63 
64  return RTEMS_SUCCESSFUL;
65}
66
67/*  null_open
68 *
69 *  This routine is the null device driver open routine.
70 *
71 *  Input parameters:
72 *    major - device major number
73 *    minor - device minor number
74 *    pargb - pointer to open parameter block
75 *
76 *  Output parameters:
77 *    rval       - NULL_SUCCESSFUL
78 */
79
80rtems_device_driver null_open(
81  rtems_device_major_number major,
82  rtems_device_minor_number minor,
83  void *pargp
84)
85{
86  return NULL_SUCCESSFUL;
87}
88
89
90/*  null_close
91 *
92 *  This routine is the null device driver close routine.
93 *
94 *  Input parameters:
95 *    major - device major number
96 *    minor - device minor number
97 *    pargb - pointer to close parameter block
98 *
99 *  Output parameters:
100 *    rval       - NULL_SUCCESSFUL
101 */
102
103rtems_device_driver null_close(
104  rtems_device_major_number major,
105  rtems_device_minor_number minor,
106  void *pargp
107)
108{
109  return NULL_SUCCESSFUL;
110}
111
112
113/*  null_read
114 *
115 *  This routine is the null device driver read routine.
116 *
117 *  Input parameters:
118 *    major - device major number
119 *    minor - device minor number
120 *    pargp - pointer to read parameter block
121 *
122 *  Output parameters:
123 *    rval       - NULL_SUCCESSFUL
124 */
125
126rtems_device_driver null_read(
127  rtems_device_major_number major,
128  rtems_device_minor_number minor,
129  void *pargp
130)
131{
132  return NULL_SUCCESSFUL;
133}
134
135
136/*  null_write
137 *
138 *  This routine is the null device driver write routine.
139 *
140 *  Input parameters:
141 *    major - device major number
142 *    minor - device minor number
143 *    pargp - pointer to write parameter block
144 *
145 *  Output parameters:
146 *    rval       - NULL_SUCCESSFUL
147 */
148
149rtems_device_driver null_write(
150  rtems_device_major_number major,
151  rtems_device_minor_number minor,
152  void *pargp
153)
154{
155  rtems_libio_rw_args_t *rw_args = (rtems_libio_rw_args_t *) pargp;
156 
157  if ( rw_args )
158    rw_args->bytes_moved = rw_args->count;
159 
160  return NULL_SUCCESSFUL;
161}
162
163
164/*  null_control
165 *
166 *  This routine is the null device driver control routine.
167 *
168 *  Input parameters:
169 *    major - device major number
170 *    minor - device minor number
171 *    pargp - pointer to cntrl parameter block
172 *
173 *  Output parameters:
174 *    rval       - NULL_SUCCESSFUL
175 */
176
177rtems_device_driver null_control(
178  rtems_device_major_number major,
179  rtems_device_minor_number minor,
180  void *pargp
181)
182{
183  return NULL_SUCCESSFUL;
184}
Note: See TracBrowser for help on using the repository browser.