Index: uspace/lib/c/generic/inet/tcp.c
===================================================================
--- uspace/lib/c/generic/inet/tcp.c	(revision cde999aca79219e8751af76502001a86d411d176)
+++ uspace/lib/c/generic/inet/tcp.c	(revision a0a9cc249adce31c755defdb6b74a991ebbf55ea)
@@ -42,5 +42,5 @@
 
 static void tcp_cb_conn(ipc_callid_t, ipc_call_t *, void *);
-static int tcp_conn_fibril(void *);
+static errno_t tcp_conn_fibril(void *);
 
 /** Incoming TCP connection info
@@ -61,5 +61,5 @@
  * @return EOK on success or an error code
  */
-static int tcp_callback_create(tcp_t *tcp)
+static errno_t tcp_callback_create(tcp_t *tcp)
 {
 	async_exch_t *exch = async_exchange_begin(tcp->sess);
@@ -68,5 +68,5 @@
 	
 	port_id_t port;
-	int rc = async_create_callback_port(exch, INTERFACE_TCP_CB, 0, 0,
+	errno_t rc = async_create_callback_port(exch, INTERFACE_TCP_CB, 0, 0,
 	    tcp_cb_conn, tcp, &port);
 	
@@ -76,5 +76,5 @@
 		return rc;
 
-	int retval;
+	errno_t retval;
 	async_wait_for(req, &retval);
 
@@ -88,9 +88,9 @@
  *         cannot be contacted
  */
-int tcp_create(tcp_t **rtcp)
+errno_t tcp_create(tcp_t **rtcp)
 {
 	tcp_t *tcp;
 	service_id_t tcp_svcid;
-	int rc;
+	errno_t rc;
 
 	tcp = calloc(1, sizeof(tcp_t));
@@ -161,5 +161,5 @@
  * @return EOK on success, ENOMEM if out of memory
  */
-static int tcp_conn_new(tcp_t *tcp, sysarg_t id, tcp_cb_t *cb, void *arg,
+static errno_t tcp_conn_new(tcp_t *tcp, sysarg_t id, tcp_cb_t *cb, void *arg,
     tcp_conn_t **rconn)
 {
@@ -207,5 +207,5 @@
  * @return EOK on success or an error code.
  */
-int tcp_conn_create(tcp_t *tcp, inet_ep2_t *epp, tcp_cb_t *cb, void *arg,
+errno_t tcp_conn_create(tcp_t *tcp, inet_ep2_t *epp, tcp_cb_t *cb, void *arg,
     tcp_conn_t **rconn)
 {
@@ -216,10 +216,10 @@
 	exch = async_exchange_begin(tcp->sess);
 	aid_t req = async_send_0(exch, TCP_CONN_CREATE, &answer);
-	int rc = async_data_write_start(exch, (void *)epp,
+	errno_t rc = async_data_write_start(exch, (void *)epp,
 	    sizeof(inet_ep2_t));
 	async_exchange_end(exch);
 
 	if (rc != EOK) {
-		int rc_orig;
+		errno_t rc_orig;
 		async_wait_for(req, &rc_orig);
 		if (rc_orig != EOK)
@@ -240,5 +240,5 @@
 	return EOK;
 error:
-	return (int) rc;
+	return (errno_t) rc;
 }
 
@@ -260,5 +260,5 @@
 
 	exch = async_exchange_begin(conn->tcp->sess);
-	int rc = async_req_1_0(exch, TCP_CONN_DESTROY, conn->id);
+	errno_t rc = async_req_1_0(exch, TCP_CONN_DESTROY, conn->id);
 	async_exchange_end(exch);
 
@@ -275,5 +275,5 @@
  * @return EOK on success, EINVAL if no connection with the given ID exists
  */
-static int tcp_conn_get(tcp_t *tcp, sysarg_t id, tcp_conn_t **rconn)
+static errno_t tcp_conn_get(tcp_t *tcp, sysarg_t id, tcp_conn_t **rconn)
 {
 	list_foreach(tcp->conn, ltcp, tcp_conn_t, conn) {
@@ -318,5 +318,5 @@
  * @return EOK on success or an error code
  */
-int tcp_listener_create(tcp_t *tcp, inet_ep_t *ep, tcp_listen_cb_t *lcb,
+errno_t tcp_listener_create(tcp_t *tcp, inet_ep_t *ep, tcp_listen_cb_t *lcb,
     void *larg, tcp_cb_t *cb, void *arg, tcp_listener_t **rlst)
 {
@@ -331,10 +331,10 @@
 	exch = async_exchange_begin(tcp->sess);
 	aid_t req = async_send_0(exch, TCP_LISTENER_CREATE, &answer);
-	int rc = async_data_write_start(exch, (void *)ep,
+	errno_t rc = async_data_write_start(exch, (void *)ep,
 	    sizeof(inet_ep_t));
 	async_exchange_end(exch);
 
 	if (rc != EOK) {
-		int rc_orig;
+		errno_t rc_orig;
 		async_wait_for(req, &rc_orig);
 		if (rc_orig != EOK)
@@ -360,5 +360,5 @@
 error:
 	free(lst);
-	return (int) rc;
+	return (errno_t) rc;
 }
 
@@ -377,5 +377,5 @@
 
 	exch = async_exchange_begin(lst->tcp->sess);
-	int rc = async_req_1_0(exch, TCP_LISTENER_DESTROY, lst->id);
+	errno_t rc = async_req_1_0(exch, TCP_LISTENER_DESTROY, lst->id);
 	async_exchange_end(exch);
 
@@ -392,5 +392,5 @@
  * @return EOK on success, EINVAL if no listener with the given ID is found
  */
-static int tcp_listener_get(tcp_t *tcp, sysarg_t id, tcp_listener_t **rlst)
+static errno_t tcp_listener_get(tcp_t *tcp, sysarg_t id, tcp_listener_t **rlst)
 {
 	list_foreach(tcp->listener, ltcp, tcp_listener_t, lst) {
@@ -424,5 +424,5 @@
  * @return EOK if connection is established, EIO otherwise
  */
-int tcp_conn_wait_connected(tcp_conn_t *conn)
+errno_t tcp_conn_wait_connected(tcp_conn_t *conn)
 {
 	fibril_mutex_lock(&conn->lock);
@@ -448,8 +448,8 @@
  * @return EOK on success or an error code
  */
-int tcp_conn_send(tcp_conn_t *conn, const void *data, size_t bytes)
-{
-	async_exch_t *exch;
-	int rc;
+errno_t tcp_conn_send(tcp_conn_t *conn, const void *data, size_t bytes)
+{
+	async_exch_t *exch;
+	errno_t rc;
 
 	exch = async_exchange_begin(conn->tcp->sess);
@@ -480,10 +480,10 @@
  * @return EOK on success or an error code
  */
-int tcp_conn_send_fin(tcp_conn_t *conn)
+errno_t tcp_conn_send_fin(tcp_conn_t *conn)
 {
 	async_exch_t *exch;
 
 	exch = async_exchange_begin(conn->tcp->sess);
-	int rc = async_req_1_0(exch, TCP_CONN_SEND_FIN, conn->id);
+	errno_t rc = async_req_1_0(exch, TCP_CONN_SEND_FIN, conn->id);
 	async_exchange_end(exch);
 
@@ -496,10 +496,10 @@
  * @return EOK on success or an error code
  */
-int tcp_conn_push(tcp_conn_t *conn)
+errno_t tcp_conn_push(tcp_conn_t *conn)
 {
 	async_exch_t *exch;
 
 	exch = async_exchange_begin(conn->tcp->sess);
-	int rc = async_req_1_0(exch, TCP_CONN_PUSH, conn->id);
+	errno_t rc = async_req_1_0(exch, TCP_CONN_PUSH, conn->id);
 	async_exchange_end(exch);
 
@@ -512,10 +512,10 @@
  * @return EOK on success or an error code
  */
-int tcp_conn_reset(tcp_conn_t *conn)
+errno_t tcp_conn_reset(tcp_conn_t *conn)
 {
 	async_exch_t *exch;
 
 	exch = async_exchange_begin(conn->tcp->sess);
-	int rc = async_req_1_0(exch, TCP_CONN_RESET, conn->id);
+	errno_t rc = async_req_1_0(exch, TCP_CONN_RESET, conn->id);
 	async_exchange_end(exch);
 
@@ -540,5 +540,5 @@
  *         error code in case of other error
  */
-int tcp_conn_recv(tcp_conn_t *conn, void *buf, size_t bsize, size_t *nrecv)
+errno_t tcp_conn_recv(tcp_conn_t *conn, void *buf, size_t bsize, size_t *nrecv)
 {
 	async_exch_t *exch;
@@ -553,5 +553,5 @@
 	exch = async_exchange_begin(conn->tcp->sess);
 	aid_t req = async_send_1(exch, TCP_CONN_RECV, conn->id, &answer);
-	int rc = async_data_read_start(exch, buf, bsize);
+	errno_t rc = async_data_read_start(exch, buf, bsize);
 	async_exchange_end(exch);
 
@@ -562,5 +562,5 @@
 	}
 
-	int retval;
+	errno_t retval;
 	async_wait_for(req, &retval);
 	if (retval != EOK) {
@@ -588,5 +588,5 @@
  * @return EOK on success or an error code
  */
-int tcp_conn_recv_wait(tcp_conn_t *conn, void *buf, size_t bsize,
+errno_t tcp_conn_recv_wait(tcp_conn_t *conn, void *buf, size_t bsize,
     size_t *nrecv)
 {
@@ -602,5 +602,5 @@
 	exch = async_exchange_begin(conn->tcp->sess);
 	aid_t req = async_send_1(exch, TCP_CONN_RECV_WAIT, conn->id, &answer);
-	int rc = async_data_read_start(exch, buf, bsize);
+	errno_t rc = async_data_read_start(exch, buf, bsize);
 	async_exchange_end(exch);
 
@@ -616,5 +616,5 @@
 	}
 
-	int retval;
+	errno_t retval;
 	async_wait_for(req, &retval);
 	if (retval != EOK) {
@@ -641,5 +641,5 @@
 	tcp_conn_t *conn;
 	sysarg_t conn_id;
-	int rc;
+	errno_t rc;
 
 	conn_id = IPC_GET_ARG1(*icall);
@@ -669,5 +669,5 @@
 	tcp_conn_t *conn;
 	sysarg_t conn_id;
-	int rc;
+	errno_t rc;
 
 	conn_id = IPC_GET_ARG1(*icall);
@@ -697,5 +697,5 @@
 	tcp_conn_t *conn;
 	sysarg_t conn_id;
-	int rc;
+	errno_t rc;
 
 	conn_id = IPC_GET_ARG1(*icall);
@@ -725,5 +725,5 @@
 	tcp_conn_t *conn;
 	sysarg_t conn_id;
-	int rc;
+	errno_t rc;
 
 	conn_id = IPC_GET_ARG1(*icall);
@@ -769,5 +769,5 @@
 	fid_t fid;
 	tcp_in_conn_t *cinfo;
-	int rc;
+	errno_t rc;
 
 	lst_id = IPC_GET_ARG1(*icall);
@@ -863,5 +863,5 @@
  * @param arg Argument, incoming connection information (@c tcp_in_conn_t)
  */
-static int tcp_conn_fibril(void *arg)
+static errno_t tcp_conn_fibril(void *arg)
 {
 	tcp_in_conn_t *cinfo = (tcp_in_conn_t *)arg;
