Changes in uspace/lib/c/generic/io/chardev.c [d5c1051:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/io/chardev.c
rd5c1051 rb7fd2a0 50 50 * @return EOK on success, ENOMEM if out of memory, EIO on I/O error 51 51 */ 52 int chardev_open(async_sess_t *sess, chardev_t **rchardev)52 errno_t chardev_open(async_sess_t *sess, chardev_t **rchardev) 53 53 { 54 54 chardev_t *chardev; … … 94 94 * @return EOK on success or non-zero error code 95 95 */ 96 int chardev_read(chardev_t *chardev, void *buf, size_t size, size_t *nread)96 errno_t chardev_read(chardev_t *chardev, void *buf, size_t size, size_t *nread) 97 97 { 98 98 async_exch_t *exch = async_exchange_begin(chardev->sess); … … 105 105 ipc_call_t answer; 106 106 aid_t req = async_send_0(exch, CHARDEV_READ, &answer); 107 int rc = async_data_read_start(exch, buf, size);107 errno_t rc = async_data_read_start(exch, buf, size); 108 108 async_exchange_end(exch); 109 109 … … 114 114 } 115 115 116 int retval;116 errno_t retval; 117 117 async_wait_for(req, &retval); 118 118 … … 124 124 *nread = IPC_GET_ARG2(answer); 125 125 /* In case of partial success, ARG1 contains the error code */ 126 return ( int) IPC_GET_ARG1(answer);126 return (errno_t) IPC_GET_ARG1(answer); 127 127 128 128 } … … 144 144 * @return EOK on success or non-zero error code 145 145 */ 146 static int chardev_write_once(chardev_t *chardev, const void *data,146 static errno_t chardev_write_once(chardev_t *chardev, const void *data, 147 147 size_t size, size_t *nwritten) 148 148 { … … 150 150 ipc_call_t answer; 151 151 aid_t req; 152 int rc;152 errno_t rc; 153 153 154 154 /* Break down large transfers */ … … 166 166 } 167 167 168 int retval;168 errno_t retval; 169 169 async_wait_for(req, &retval); 170 170 if (retval != EOK) { … … 175 175 *nwritten = IPC_GET_ARG2(answer); 176 176 /* In case of partial success, ARG1 contains the error code */ 177 return ( int) IPC_GET_ARG1(answer);177 return (errno_t) IPC_GET_ARG1(answer); 178 178 } 179 179 … … 193 193 * @return EOK on success or non-zero error code 194 194 */ 195 int chardev_write(chardev_t *chardev, const void *data, size_t size,195 errno_t chardev_write(chardev_t *chardev, const void *data, size_t size, 196 196 size_t *nwritten) 197 197 { 198 198 size_t nw; 199 199 size_t p; 200 int rc;200 errno_t rc; 201 201 202 202 p = 0;
Note:
See TracChangeset
for help on using the changeset viewer.