45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
typedef struct kiochan {
kiostream in;
// text can be read from this stream
kiostream out;
// text can be written to this stream
} kiochan;
typedef enum kiocond {
/* to check if a call failed, perform (x >= kiocond_fail) where x
* is that call's return value. more typically however you should
* select explicitly against kiocond_ok or kiocond_partial, since
* those situations will usually need to be handled differently. */
kiocond_ok, // success
kiocond_partial, // partial read or write
kiocond_poll, // call would block
kiocond_interrupt, // call was interrupted by signal
kiocond_fail, // action failed - unspecified reason
kiocond_fail_closed_stream, // action failed because stream is closed
kiocond_fail_invalid,
|
|
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
typedef struct kiochan {
kiostream in;
// text can be read from this stream
kiostream out;
// text can be written to this stream
} kiochan;
#include <k/internal.egroup.h>
typedef enum kiocond {
/* to check if a call failed, perform (x >= kiocond_fail) where x
* is that call's return value. more typically however you should
* select explicitly against kiocond_ok or kiocond_partial, since
* those situations will usually need to be handled differently. */
kiocond_ok = kiocond_id, // success
kiocond_partial, // partial read or write
kiocond_poll, // call would block
kiocond_interrupt, // call was interrupted by signal
kiocond_fail, // action failed - unspecified reason
kiocond_fail_closed_stream, // action failed because stream is closed
kiocond_fail_invalid,
|