00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _SYS__ASYNCHIO_H
00009 #define _SYS__ASYNCHIO_H
00010
00011 #ifndef _ANSI_H
00012 #include <ansi.h>
00013 #endif
00014
00015 #include <sys/time.h>
00016
00017 typedef struct {
00018 char state;
00019 char op;
00020 char fd;
00021 char req;
00022 void *data;
00023 ssize_t count;
00024 int errno;
00025 } asynchio_t;
00026
00027 #define ASYN_NONBLOCK 0x01
00028
00029 #define ASYN_INPROGRESS EINPROGRESS
00030
00031 void asyn_init(asynchio_t *_asyn);
00032 ssize_t asyn_read(asynchio_t *_asyn, int _fd, void *_buf, size_t _len);
00033 ssize_t asyn_write(asynchio_t *_asyn, int _fd, const void *_buf, size_t _len);
00034 int asyn_ioctl(asynchio_t *_asyn, int _fd, unsigned long _request, void *_data);
00035 int asyn_wait(asynchio_t *_asyn, int _flags, struct timeval *to);
00036 int asyn_synch(asynchio_t *_asyn, int _fd);
00037 int asyn_close(asynchio_t *_asyn, int _fd);
00038
00039 #endif