53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/* 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_fail, // action failed - unspecified reason
kiocond_fail_closed_stream, // action failed because stream is closed
} kiocond;
kiocond kiosend(kiochan, ksraw, sz*); // send data to a channel
kiocond kiorecv(kiochan, ksraw*); // receive data from a channel
kmptr kiorecvall(kiochan, kmcell*, kmkind); // automatically allocate a bufer for a channel
// kmkind is only used if kmcell* is null
kiocond kiocon(kiochan, kiochan); // connect one channel to another
#ifdef __cplusplus
}
#endif
#endif
|
|
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
/* 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,
kiocond_fail_io,
kiocond_fail_no_peer,
kiocond_fail_no_space,
kiocond_fail_forbidden,
kiocond_fail_over_quota,
kiocond_fail_pfault,
kiocond_fail_too_big,
kiocond_fail_stream_mismatch,
} kiocond;
kiocond kiosend(kiochan, ksraw, sz*); // send data to a channel
kiocond kiorecv(kiochan, ksraw*); // receive data from a channel
kmptr kiorecvall(kiochan, kmcell*, kmkind); // automatically allocate a bufer for a channel
// kmkind is only used if kmcell* is null
kiocond kiocon(kiochan, kiochan); // connect one channel to another
#ifdef __cplusplus
}
#endif
#endif
|