Rev | Line | |
---|
[9] | 1 | /* asynchio.h - Asynchronous I/O Author: Kees J. Bot
|
---|
| 2 | * 26 Jan 1995
|
---|
| 3 | * This is just a fake async I/O library to be used for programs
|
---|
| 4 | * written for Minix-vmd that must also run under standard Minix.
|
---|
| 5 | * This limits the number of ugly #ifdefs somewhat. The programs must
|
---|
| 6 | * be restricted to performing just one service, of course.
|
---|
| 7 | */
|
---|
| 8 | #ifndef _SYS__ASYNCHIO_H
|
---|
| 9 | #define _SYS__ASYNCHIO_H
|
---|
| 10 |
|
---|
| 11 | #ifndef _ANSI_H
|
---|
| 12 | #include <ansi.h>
|
---|
| 13 | #endif
|
---|
| 14 |
|
---|
| 15 | #include <sys/time.h>
|
---|
| 16 |
|
---|
| 17 | typedef struct {
|
---|
| 18 | char state;
|
---|
| 19 | char op;
|
---|
| 20 | char fd;
|
---|
| 21 | char req;
|
---|
| 22 | void *data;
|
---|
| 23 | ssize_t count;
|
---|
| 24 | int errno;
|
---|
| 25 | } asynchio_t;
|
---|
| 26 |
|
---|
| 27 | #define ASYN_NONBLOCK 0x01
|
---|
| 28 |
|
---|
| 29 | #define ASYN_INPROGRESS EINPROGRESS
|
---|
| 30 |
|
---|
| 31 | void asyn_init(asynchio_t *_asyn);
|
---|
| 32 | ssize_t asyn_read(asynchio_t *_asyn, int _fd, void *_buf, size_t _len);
|
---|
| 33 | ssize_t asyn_write(asynchio_t *_asyn, int _fd, const void *_buf, size_t _len);
|
---|
| 34 | int asyn_ioctl(asynchio_t *_asyn, int _fd, unsigned long _request, void *_data);
|
---|
| 35 | int asyn_wait(asynchio_t *_asyn, int _flags, struct timeval *to);
|
---|
| 36 | int asyn_synch(asynchio_t *_asyn, int _fd);
|
---|
| 37 | int asyn_close(asynchio_t *_asyn, int _fd);
|
---|
| 38 |
|
---|
| 39 | #endif /* _SYS__ASYNCHIO_H */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.