2 ** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
8 #include <KernelExport.h>
13 #define DEVICE_NAME "zero"
15 int32 api_version
= B_CUR_DRIVER_API_VERSION
;
19 zero_open(const char *name
, uint32 flags
, void **cookie
)
27 zero_close(void *cookie
)
34 zero_freecookie(void *cookie
)
41 zero_ioctl(void *cookie
, uint32 op
, void *buffer
, size_t length
)
48 zero_read(void *cookie
, off_t pos
, void *buffer
, size_t *_length
)
50 if (user_memset(buffer
, 0, *_length
) < B_OK
)
58 zero_write(void *cookie
, off_t pos
, const void *buffer
, size_t *_length
)
77 static const char *devices
[] = {
87 find_device(const char *name
)
89 static device_hooks hooks
= {
96 /* Leave select/deselect/readv/writev undefined. The kernel will
97 * use its own default implementation. The basic hooks above this
98 * line MUST be defined, however. */
105 if (!strcmp(name
, DEVICE_NAME
))