diff --git a/headers/os/drivers/Drivers.h b/headers/os/drivers/Drivers.h index c5fc6ca04f..2093eac83c 100644 --- a/headers/os/drivers/Drivers.h +++ b/headers/os/drivers/Drivers.h @@ -5,6 +5,8 @@ #include #include #include +#include + #ifdef __cplusplus extern "C" { @@ -14,20 +16,6 @@ extern "C" { these hooks are how the kernel accesses the device --- */ -struct selectsync; -typedef struct selectsync selectsync; -#ifndef B_SELECT_READ -/* those were lacking for quite some time... - yes the select API will get deprecated, but for now that goes here. */ -#define B_SELECT_READ 1 -#define B_SELECT_WRITE 2 -#define B_SELECT_EXCEPTION 3 -// that's Be's prototype... -//extern void notify_select_event(selectsync * sync, uint32 ref); -// moved from current/headers/private/kernel/vfs.h -extern status_t notify_select_event(struct selectsync *sync, uint32 ref, uint8 event); -#endif - typedef status_t (*device_open_hook) (const char *name, uint32 flags, void **cookie); typedef status_t (*device_close_hook) (void *cookie); typedef status_t (*device_free_hook) (void *cookie); @@ -41,9 +29,9 @@ typedef status_t (*device_select_hook) (void *cookie, uint8 event, uint32 ref, selectsync *sync); typedef status_t (*device_deselect_hook) (void *cookie, uint8 event, selectsync *sync); -typedef status_t (*device_read_pages_hook)(void *deviceCookie, off_t position, const iovec *vec, +typedef status_t (*device_read_pages_hook)(void *cookie, off_t position, const iovec *vec, size_t count, size_t *_numBytes); -typedef status_t (*device_write_pages_hook) (void *deviceCookie, off_t position, const iovec *vec, +typedef status_t (*device_write_pages_hook) (void *cookie, off_t position, const iovec *vec, size_t count, size_t *_numBytes); #define B_CUR_DRIVER_API_VERSION 2 diff --git a/headers/os/drivers/Select.h b/headers/os/drivers/Select.h new file mode 100644 index 0000000000..1219c967a7 --- /dev/null +++ b/headers/os/drivers/Select.h @@ -0,0 +1,44 @@ +/* File System and Drivers select support +** +** Distributed under the terms of the Haiku License. +*/ +#ifndef _DRIVERS_SELECT_H +#define _DRIVERS_SELECT_H + + +#include + + +struct selectsync; +typedef struct selectsync selectsync; + +enum select_events { + B_SELECT_READ = 1, // standard select() support + B_SELECT_WRITE, + B_SELECT_ERROR, + + B_SELECT_PRI_READ, // additional poll() support + B_SELECT_PRI_WRITE, + + B_SELECT_HIGH_PRI_READ, + B_SELECT_HIGH_PRI_WRITE, + + B_SELECT_DISCONNECTED +}; + + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef COMPILE_FOR_R5 +extern status_t notify_select_event(struct selectsync *sync, uint32 ref); +#else +extern status_t notify_select_event(struct selectsync *sync, uint32 ref, uint8 event); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _DRIVERS_SELECT_H */ diff --git a/headers/os/drivers/fs_interface.h b/headers/os/drivers/fs_interface.h index 07410306db..49d0e38326 100644 --- a/headers/os/drivers/fs_interface.h +++ b/headers/os/drivers/fs_interface.h @@ -7,8 +7,10 @@ #include +#include #include -#include + +#include struct dirent;