Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/driver.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -124,5 +124,5 @@
 	
 	char *dev_name = NULL;
-	int rc = async_data_write_accept((void **) &dev_name, true, 0, 0, 0, 0);
+	errno_t rc = async_data_write_accept((void **) &dev_name, true, 0, 0, 0, 0);
 	if (rc != EOK) {
 		async_answer_0(iid, rc);
@@ -157,5 +157,5 @@
 	(void) parent_fun_handle;
 	
-	int res = driver->driver_ops->dev_add(dev);
+	errno_t res = driver->driver_ops->dev_add(dev);
 	
 	if (res != EOK) {
@@ -189,5 +189,5 @@
 	}
 	
-	int rc;
+	errno_t rc;
 	
 	if (driver->driver_ops->dev_remove != NULL)
@@ -217,5 +217,5 @@
 	}
 	
-	int rc;
+	errno_t rc;
 	
 	if (driver->driver_ops->dev_gone != NULL)
@@ -253,5 +253,5 @@
 	
 	/* Call driver entry point */
-	int rc;
+	errno_t rc;
 	
 	if (driver->driver_ops->fun_online != NULL)
@@ -288,5 +288,5 @@
 	
 	/* Call driver entry point */
-	int rc;
+	errno_t rc;
 	
 	if (driver->driver_ops->fun_offline != NULL)
@@ -404,5 +404,5 @@
 	 */
 	
-	int ret = EOK;
+	errno_t ret = EOK;
 	/* Open device function */
 	if (fun->ops != NULL && fun->ops->open != NULL)
@@ -666,5 +666,5 @@
  * @return	EOK on success, ENOMEM if out of memory
  */
-int ddf_fun_set_name(ddf_fun_t *dev, const char *name)
+errno_t ddf_fun_set_name(ddf_fun_t *dev, const char *name)
 {
 	assert(dev->name == NULL);
@@ -815,5 +815,5 @@
  *
  */
-int ddf_fun_bind(ddf_fun_t *fun)
+errno_t ddf_fun_bind(ddf_fun_t *fun)
 {
 	assert(fun->bound == false);
@@ -822,5 +822,5 @@
 	
 	add_to_functions_list(fun);
-	int res = devman_add_function(fun->name, fun->ftype, &fun->match_ids,
+	errno_t res = devman_add_function(fun->name, fun->ftype, &fun->match_ids,
 	    fun->dev->handle, &fun->handle);
 	if (res != EOK) {
@@ -843,9 +843,9 @@
  *
  */
-int ddf_fun_unbind(ddf_fun_t *fun)
+errno_t ddf_fun_unbind(ddf_fun_t *fun)
 {
 	assert(fun->bound == true);
 	
-	int res = devman_remove_function(fun->handle);
+	errno_t res = devman_remove_function(fun->handle);
 	if (res != EOK)
 		return res;
@@ -864,9 +864,9 @@
  *
  */
-int ddf_fun_online(ddf_fun_t *fun)
+errno_t ddf_fun_online(ddf_fun_t *fun)
 {
 	assert(fun->bound == true);
 	
-	int res = devman_drv_fun_online(fun->handle);
+	errno_t res = devman_drv_fun_online(fun->handle);
 	if (res != EOK)
 		return res;
@@ -882,9 +882,9 @@
  *
  */
-int ddf_fun_offline(ddf_fun_t *fun)
+errno_t ddf_fun_offline(ddf_fun_t *fun)
 {
 	assert(fun->bound == true);
 	
-	int res = devman_drv_fun_offline(fun->handle);
+	errno_t res = devman_drv_fun_offline(fun->handle);
 	if (res != EOK)
 		return res;
@@ -906,5 +906,5 @@
  *
  */
-int ddf_fun_add_match_id(ddf_fun_t *fun, const char *match_id_str,
+errno_t ddf_fun_add_match_id(ddf_fun_t *fun, const char *match_id_str,
     int match_score)
 {
@@ -953,5 +953,5 @@
  *
  */
-int ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name)
+errno_t ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name)
 {
 	assert(fun->bound == true);
@@ -974,5 +974,5 @@
 	 */
 	port_id_t port;
-	int rc = async_create_port(INTERFACE_DDF_DRIVER, driver_connection_driver,
+	errno_t rc = async_create_port(INTERFACE_DDF_DRIVER, driver_connection_driver,
 	    NULL, &port);
 	if (rc != EOK) {
Index: uspace/lib/drv/generic/interrupt.c
===================================================================
--- uspace/lib/drv/generic/interrupt.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/interrupt.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -43,5 +43,5 @@
 #include "private/driver.h"
 
-int register_interrupt_handler(ddf_dev_t *dev, int irq,
+errno_t register_interrupt_handler(ddf_dev_t *dev, int irq,
     interrupt_handler_t *handler, const irq_code_t *irq_code,
     cap_handle_t *handle)
@@ -51,5 +51,5 @@
 }
 
-int unregister_interrupt_handler(ddf_dev_t *dev, cap_handle_t cap)
+errno_t unregister_interrupt_handler(ddf_dev_t *dev, cap_handle_t cap)
 {
 	return async_irq_unsubscribe(cap);
Index: uspace/lib/drv/generic/log.c
===================================================================
--- uspace/lib/drv/generic/log.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/log.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -40,5 +40,5 @@
  *
  */
-int ddf_log_init(const char *drv_name)
+errno_t ddf_log_init(const char *drv_name)
 {
 	return log_init(drv_name);
Index: uspace/lib/drv/generic/remote_ahci.c
===================================================================
--- uspace/lib/drv/generic/remote_ahci.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_ahci.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -65,5 +65,5 @@
 	
 	char devn[MAX_NAME_LENGTH];
-	int rc = devman_fun_get_name(funh, devn, MAX_NAME_LENGTH);
+	errno_t rc = devman_fun_get_name(funh, devn, MAX_NAME_LENGTH);
 	if (rc != EOK)
 		return NULL;
@@ -83,5 +83,5 @@
 }
 
-int ahci_get_sata_device_name(async_sess_t *sess, size_t sata_dev_name_length,
+errno_t ahci_get_sata_device_name(async_sess_t *sess, size_t sata_dev_name_length,
     char *sata_dev_name)
 {
@@ -95,5 +95,5 @@
 	async_data_read_start(exch, sata_dev_name, sata_dev_name_length);
 	
-	int rc;
+	errno_t rc;
 	async_wait_for(req, &rc);
 	
@@ -101,5 +101,5 @@
 }
 
-int ahci_get_num_blocks(async_sess_t *sess, uint64_t *blocks)
+errno_t ahci_get_num_blocks(async_sess_t *sess, uint64_t *blocks)
 {
 	async_exch_t *exch = async_exchange_begin(sess);
@@ -109,5 +109,5 @@
 	sysarg_t blocks_hi;
 	sysarg_t blocks_lo;
-	int rc = async_req_1_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
+	errno_t rc = async_req_1_2(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
 	    IPC_M_AHCI_GET_NUM_BLOCKS, &blocks_hi, &blocks_lo);
 	
@@ -122,5 +122,5 @@
 }
 
-int ahci_get_block_size(async_sess_t *sess, size_t *blocks_size)
+errno_t ahci_get_block_size(async_sess_t *sess, size_t *blocks_size)
 {
 	async_exch_t *exch = async_exchange_begin(sess);
@@ -129,5 +129,5 @@
 	
 	sysarg_t bs;
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
+	errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(AHCI_DEV_IFACE),
 	    IPC_M_AHCI_GET_BLOCK_SIZE, &bs);
 	
@@ -140,5 +140,5 @@
 }
 
-int ahci_read_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
+errno_t ahci_read_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
     void *buf)
 {
@@ -155,5 +155,5 @@
 	async_exchange_end(exch);
 	
-	int rc;
+	errno_t rc;
 	async_wait_for(req, &rc);
 	
@@ -161,5 +161,5 @@
 }
 
-int ahci_write_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
+errno_t ahci_write_blocks(async_sess_t *sess, uint64_t blocknum, size_t count,
     void* buf)
 {
@@ -175,5 +175,5 @@
 	async_exchange_end(exch);
 	
-	int rc;
+	errno_t rc;
 	async_wait_for(req, &rc);
 	
@@ -227,5 +227,5 @@
 	}	
 	
-	const int ret = ahci_iface->get_sata_device_name(fun,
+	const errno_t ret = ahci_iface->get_sata_device_name(fun,
 	    sata_dev_name_length, sata_dev_name);
 	
@@ -251,5 +251,5 @@
 	
 	uint64_t blocks;
-	const int ret = ahci_iface->get_num_blocks(fun, &blocks);
+	const errno_t ret = ahci_iface->get_num_blocks(fun, &blocks);
 	
 	if (ret != EOK)
@@ -270,5 +270,5 @@
 	
 	size_t blocks;
-	const int ret = ahci_iface->get_block_size(fun, &blocks);
+	const errno_t ret = ahci_iface->get_block_size(fun, &blocks);
 	
 	if (ret != EOK)
@@ -302,5 +302,5 @@
 	const size_t cnt = (size_t) DEV_IPC_GET_ARG3(*call);
 	
-	const int ret = ahci_iface->read_blocks(fun, blocknum, cnt, buf);
+	const errno_t ret = ahci_iface->read_blocks(fun, blocknum, cnt, buf);
 	
 	async_answer_0(callid, ret);
@@ -331,5 +331,5 @@
 	const size_t cnt = (size_t) DEV_IPC_GET_ARG3(*call);
 	
-	const int ret = ahci_iface->write_blocks(fun, blocknum, cnt, buf);
+	const errno_t ret = ahci_iface->write_blocks(fun, blocknum, cnt, buf);
 	
 	async_answer_0(callid, ret);
Index: uspace/lib/drv/generic/remote_audio_mixer.c
===================================================================
--- uspace/lib/drv/generic/remote_audio_mixer.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_audio_mixer.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -94,10 +94,10 @@
  * @return Error code.
  */
-int audio_mixer_get_info(async_exch_t *exch, const char **name, unsigned *items)
+errno_t audio_mixer_get_info(async_exch_t *exch, const char **name, unsigned *items)
 {
 	if (!exch)
 		return EINVAL;
 	sysarg_t name_size, itemc;
-	const int ret = async_req_1_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),
+	const errno_t ret = async_req_1_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),
 	    IPC_M_AUDIO_MIXER_GET_INFO, &name_size, &itemc);
 	if (ret == EOK && name) {
@@ -109,5 +109,5 @@
 			return ENOMEM;
 		}
-		const int ret =
+		const errno_t ret =
 		    async_data_read_start(exch, name_place, name_size);
 		if (ret != EOK) {
@@ -130,5 +130,5 @@
  * @return Error code.
  */
-int audio_mixer_get_item_info(async_exch_t *exch, unsigned item,
+errno_t audio_mixer_get_item_info(async_exch_t *exch, unsigned item,
     const char **name, unsigned *levels)
 {
@@ -136,5 +136,5 @@
 		return EINVAL;
 	sysarg_t name_size, lvls;
-	const int ret = async_req_2_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),
+	const errno_t ret = async_req_2_2(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),
 	    IPC_M_AUDIO_MIXER_GET_ITEM_INFO, item, &name_size, &lvls);
 	if (ret == EOK && name) {
@@ -146,5 +146,5 @@
 			return ENOMEM;
 		}
-		const int ret =
+		const errno_t ret =
 		    async_data_read_start(exch, name_place, name_size);
 		if (ret != EOK) {
@@ -166,5 +166,5 @@
  * @return Error code.
  */
-int audio_mixer_set_item_level(async_exch_t *exch, unsigned item,
+errno_t audio_mixer_set_item_level(async_exch_t *exch, unsigned item,
     unsigned level)
 {
@@ -183,5 +183,5 @@
  * @return Error code.
  */
-int audio_mixer_get_item_level(async_exch_t *exch, unsigned item,
+errno_t audio_mixer_get_item_level(async_exch_t *exch, unsigned item,
     unsigned *level)
 {
@@ -189,5 +189,5 @@
 		return EINVAL;
 	sysarg_t current;
-	const int ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),
+	const errno_t ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_MIXER_IFACE),
 	    IPC_M_AUDIO_MIXER_GET_ITEM_LEVEL, item, &current);
 	if (ret == EOK && level)
@@ -229,5 +229,5 @@
 	const char *name = NULL;
 	unsigned items = 0;
-	const int ret = mixer_iface->get_info(fun, &name, &items);
+	const errno_t ret = mixer_iface->get_info(fun, &name, &items);
 	const size_t name_size = name ? str_size(name) + 1 : 0;
 	async_answer_2(callid, ret, name_size, items);
@@ -261,5 +261,5 @@
 	const char *name = NULL;
 	unsigned values = 0;
-	const int ret = mixer_iface->get_item_info(fun, item, &name, &values);
+	const errno_t ret = mixer_iface->get_item_info(fun, item, &name, &values);
 	const size_t name_size = name ? str_size(name) + 1 : 0;
 	async_answer_2(callid, ret, name_size, values);
@@ -291,5 +291,5 @@
 	const unsigned item = DEV_IPC_GET_ARG1(*call);
 	const unsigned value = DEV_IPC_GET_ARG2(*call);
-	const int ret = mixer_iface->set_item_level(fun, item, value);
+	const errno_t ret = mixer_iface->set_item_level(fun, item, value);
 	async_answer_0(callid, ret);
 }
@@ -306,5 +306,5 @@
 	const unsigned item = DEV_IPC_GET_ARG1(*call);
 	unsigned current = 0;
-	const int ret =
+	const errno_t ret =
 	    mixer_iface->get_item_level(fun, item, &current);
 	async_answer_1(callid, ret, current);
Index: uspace/lib/drv/generic/remote_audio_pcm.c
===================================================================
--- uspace/lib/drv/generic/remote_audio_pcm.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_audio_pcm.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -114,5 +114,5 @@
 	static category_id_t pcm_id = 0;
 	if (!resolved) {
-		const int ret = loc_category_get_id("audio-pcm", &pcm_id,
+		const errno_t ret = loc_category_get_id("audio-pcm", &pcm_id,
 		    IPC_FLAG_BLOCKING);
 		if (ret != EOK)
@@ -123,5 +123,5 @@
 	service_id_t *svcs = NULL;
 	size_t count = 0;
-	const int ret = loc_category_get_svcs(pcm_id, &svcs, &count);
+	const errno_t ret = loc_category_get_svcs(pcm_id, &svcs, &count);
 	if (ret != EOK)
 		return NULL;
@@ -143,5 +143,5 @@
 {
 	devman_handle_t device_handle = 0;
-	const int ret = devman_fun_get_handle(name, &device_handle, 0);
+	const errno_t ret = devman_fun_get_handle(name, &device_handle, 0);
 	if (ret != EOK)
 		return NULL;
@@ -184,5 +184,5 @@
  * @note Caller is responsible for freeing newly allocated memory.
  */
-int audio_pcm_get_info_str(audio_pcm_sess_t *sess, const char **name)
+errno_t audio_pcm_get_info_str(audio_pcm_sess_t *sess, const char **name)
 {
 	if (!name)
@@ -190,5 +190,5 @@
 	async_exch_t *exch = async_exchange_begin(sess);
 	sysarg_t name_size;
-	const int ret = async_req_1_1(exch,
+	const errno_t ret = async_req_1_1(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_GET_INFO_STR, &name_size);
@@ -202,5 +202,5 @@
 			return ENOMEM;
 		}
-		const int ret =
+		const errno_t ret =
 		    async_data_read_start(exch, name_place, name_size);
 		if (ret != EOK) {
@@ -225,8 +225,8 @@
  * @return Error code.
  */
-int audio_pcm_query_cap(audio_pcm_sess_t *sess, audio_cap_t cap, sysarg_t *value)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_2_1(exch,
+errno_t audio_pcm_query_cap(audio_pcm_sess_t *sess, audio_cap_t cap, sysarg_t *value)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_2_1(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_QUERY_CAPS,
 	    cap, value);
@@ -245,5 +245,5 @@
  * Works for both playback and capture.
  */
-int audio_pcm_get_buffer_pos(audio_pcm_sess_t *sess, size_t *pos)
+errno_t audio_pcm_get_buffer_pos(audio_pcm_sess_t *sess, size_t *pos)
 {
 	if (!pos)
@@ -251,5 +251,5 @@
 	async_exch_t *exch = async_exchange_begin(sess);
 	sysarg_t value = 0;
-	const int ret = async_req_1_1(exch,
+	const errno_t ret = async_req_1_1(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_GET_BUFFER_POS, &value);
@@ -273,5 +273,5 @@
  * parameters to the nearest values supported by the device.
  */
-int audio_pcm_test_format(audio_pcm_sess_t *sess, unsigned *channels,
+errno_t audio_pcm_test_format(audio_pcm_sess_t *sess, unsigned *channels,
     unsigned *rate, pcm_sample_format_t *format)
 {
@@ -280,5 +280,5 @@
 	sysarg_t rate_arg = rate ? *rate : 0;
 	sysarg_t format_arg = format ? *format : 0;
-	const int ret = async_req_4_3(exch,
+	const errno_t ret = async_req_4_3(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_TEST_FORMAT, channels_arg, rate_arg, format_arg,
@@ -311,5 +311,5 @@
  * @return Error code.
  */
-int audio_pcm_register_event_callback(audio_pcm_sess_t *sess,
+errno_t audio_pcm_register_event_callback(audio_pcm_sess_t *sess,
     async_port_handler_t event_callback, void *arg)
 {
@@ -319,5 +319,5 @@
 	async_exch_t *exch = async_exchange_begin(sess);
 	
-	int ret = async_req_1_0(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
+	errno_t ret = async_req_1_0(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_REGISTER_EVENTS);
 	if (ret == EOK) {
@@ -338,8 +338,8 @@
  * @return Error code.
  */
-int audio_pcm_unregister_event_callback(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_1_0(exch,
+errno_t audio_pcm_unregister_event_callback(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_1_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_UNREGISTER_EVENTS);
@@ -357,5 +357,5 @@
  * @return Error code.
  */
-int audio_pcm_get_buffer(audio_pcm_sess_t *sess, void **buffer, size_t *size)
+errno_t audio_pcm_get_buffer(audio_pcm_sess_t *sess, void **buffer, size_t *size)
 {
 	if (!buffer || !size)
@@ -365,5 +365,5 @@
 
 	sysarg_t buffer_size = *size;
-	int ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
+	errno_t ret = async_req_2_1(exch, DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_GET_BUFFER, (sysarg_t)buffer_size, &buffer_size);
 	if (ret == EOK) {
@@ -388,8 +388,8 @@
  * @return Error code.
  */
-int audio_pcm_release_buffer(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_1_0(exch,
+errno_t audio_pcm_release_buffer(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_1_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_RELEASE_BUFFER);
@@ -412,5 +412,5 @@
  * 0 to turn off event generation.
  */
-int audio_pcm_start_playback_fragment(audio_pcm_sess_t *sess, unsigned frames,
+errno_t audio_pcm_start_playback_fragment(audio_pcm_sess_t *sess, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -420,5 +420,5 @@
 	const sysarg_t packed = (channels << 16) | (format & UINT16_MAX);
 	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_4_0(exch,
+	const errno_t ret = async_req_4_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_START_PLAYBACK,
@@ -434,8 +434,8 @@
  * @return Error code.
  */
-int audio_pcm_last_playback_fragment(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_2_0(exch,
+errno_t audio_pcm_last_playback_fragment(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_2_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_STOP_PLAYBACK, false);
@@ -454,5 +454,5 @@
  * @return Error code.
  */
-int audio_pcm_start_playback(audio_pcm_sess_t *sess,
+errno_t audio_pcm_start_playback(audio_pcm_sess_t *sess,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -468,8 +468,8 @@
  * @return Error code.
  */
-int audio_pcm_stop_playback_immediate(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_2_0(exch,
+errno_t audio_pcm_stop_playback_immediate(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_2_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_STOP_PLAYBACK, true);
@@ -485,8 +485,8 @@
  * @return Error code.
  */
-int audio_pcm_stop_playback(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_2_0(exch,
+errno_t audio_pcm_stop_playback(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_2_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_STOP_PLAYBACK, false);
@@ -509,5 +509,5 @@
  * 0 to turn off event generation.
  */
-int audio_pcm_start_capture_fragment(audio_pcm_sess_t *sess, unsigned frames,
+errno_t audio_pcm_start_capture_fragment(audio_pcm_sess_t *sess, unsigned frames,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -517,5 +517,5 @@
 	const sysarg_t packed = (channels << 16) | (format & UINT16_MAX);
 	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_4_0(exch,
+	const errno_t ret = async_req_4_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE), IPC_M_AUDIO_PCM_START_CAPTURE,
 	    frames, sample_rate, packed);
@@ -534,5 +534,5 @@
  * @return Error code.
  */
-int audio_pcm_start_capture(audio_pcm_sess_t *sess,
+errno_t audio_pcm_start_capture(audio_pcm_sess_t *sess,
     unsigned channels, unsigned sample_rate, pcm_sample_format_t format)
 {
@@ -549,8 +549,8 @@
  * @return Error code.
  */
-int audio_pcm_last_capture_fragment(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_2_0(exch,
+errno_t audio_pcm_last_capture_fragment(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_2_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_STOP_CAPTURE, false);
@@ -566,8 +566,8 @@
  * @return Error code.
  */
-int audio_pcm_stop_capture_immediate(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_2_0(exch,
+errno_t audio_pcm_stop_capture_immediate(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_2_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_STOP_CAPTURE, true);
@@ -583,8 +583,8 @@
  * @return Error code.
  */
-int audio_pcm_stop_capture(audio_pcm_sess_t *sess)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	const int ret = async_req_2_0(exch,
+errno_t audio_pcm_stop_capture(audio_pcm_sess_t *sess)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	const errno_t ret = async_req_2_0(exch,
 	    DEV_IFACE_ID(AUDIO_PCM_BUFFER_IFACE),
 	    IPC_M_AUDIO_PCM_STOP_CAPTURE, false);
@@ -641,5 +641,5 @@
 	}
 	const char *name = NULL;
-	const int ret = pcm_iface->get_info_str(fun, &name);
+	const errno_t ret = pcm_iface->get_info_str(fun, &name);
 	const size_t name_size = name ? str_size(name) + 1 : 0;
 	async_answer_1(callid, ret, name_size);
@@ -692,5 +692,5 @@
 		return;
 	}
-	const int ret = pcm_iface->set_event_session(fun, sess);
+	const errno_t ret = pcm_iface->set_event_session(fun, sess);
 	if (ret != EOK) {
 		ddf_msg(LVL_DEBUG, "Failed to set event callback.");
@@ -722,5 +722,5 @@
 	const audio_pcm_iface_t *pcm_iface = iface;
 	size_t pos = 0;
-	const int ret = pcm_iface->get_buffer_pos ?
+	const errno_t ret = pcm_iface->get_buffer_pos ?
 	    pcm_iface->get_buffer_pos(fun, &pos) : ENOTSUP;
 	async_answer_1(callid, ret, pos);
@@ -733,5 +733,5 @@
 	unsigned rate = DEV_IPC_GET_ARG2(*call);
 	pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call);
-	const int ret = pcm_iface->test_format ?
+	const errno_t ret = pcm_iface->test_format ?
 	    pcm_iface->test_format(fun, &channels, &rate, &format) : ENOTSUP;
 	async_answer_3(callid, ret, channels, rate, format);
@@ -750,5 +750,5 @@
 	void *buffer = NULL;
 	size_t size = DEV_IPC_GET_ARG1(*call);
-	int ret = pcm_iface->get_buffer(fun, &buffer, &size);
+	errno_t ret = pcm_iface->get_buffer(fun, &buffer, &size);
 	async_answer_1(callid, ret, size);
 	if (ret != EOK || size == 0)
@@ -792,5 +792,5 @@
 	const audio_pcm_iface_t *pcm_iface = iface;
 
-	const int ret = pcm_iface->release_buffer ?
+	const errno_t ret = pcm_iface->release_buffer ?
 	    pcm_iface->release_buffer(fun) : ENOTSUP;
 	async_answer_0(callid, ret);
@@ -807,5 +807,5 @@
 	const pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call) & UINT16_MAX;
 
-	const int ret = pcm_iface->start_playback
+	const errno_t ret = pcm_iface->start_playback
 	    ? pcm_iface->start_playback(fun, frames, channels, rate, format)
 	    : ENOTSUP;
@@ -819,5 +819,5 @@
 	const bool immediate = DEV_IPC_GET_ARG1(*call);
 
-	const int ret = pcm_iface->stop_playback ?
+	const errno_t ret = pcm_iface->stop_playback ?
 	    pcm_iface->stop_playback(fun, immediate) : ENOTSUP;
 	async_answer_0(callid, ret);
@@ -834,5 +834,5 @@
 	const pcm_sample_format_t format = DEV_IPC_GET_ARG3(*call) & UINT16_MAX;
 
-	const int ret = pcm_iface->start_capture
+	const errno_t ret = pcm_iface->start_capture
 	    ? pcm_iface->start_capture(fun, frames, channels, rate, format)
 	    : ENOTSUP;
@@ -846,5 +846,5 @@
 	const bool immediate = DEV_IPC_GET_ARG1(*call);
 
-	const int ret = pcm_iface->stop_capture ?
+	const errno_t ret = pcm_iface->stop_capture ?
 	    pcm_iface->stop_capture(fun, immediate) : ENOTSUP;
 	async_answer_0(callid, ret);
Index: uspace/lib/drv/generic/remote_battery_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_battery_dev.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_battery_dev.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -47,5 +47,5 @@
  * @return         EOK on success or an error code
  */
-int
+errno_t
 battery_status_get(async_sess_t *sess, battery_status_t *batt_status)
 {
@@ -54,5 +54,5 @@
 	async_exch_t *exch = async_exchange_begin(sess);
 
-	int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
+	errno_t const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
 	    BATTERY_STATUS_GET, &status);
 
@@ -72,5 +72,5 @@
  * @return         EOK on success or an error code
  */
-int
+errno_t
 battery_charge_level_get(async_sess_t *sess, int *level)
 {
@@ -79,5 +79,5 @@
 	async_exch_t *exch = async_exchange_begin(sess);
 
-	int const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
+	errno_t const rc = async_req_1_1(exch, DEV_IFACE_ID(BATTERY_DEV_IFACE),
 	    BATTERY_CHARGE_LEVEL_GET, &charge_level);
 
@@ -129,5 +129,5 @@
 
 	battery_status_t batt_status;
-	const int rc = bops->battery_status_get(fun, &batt_status);
+	const errno_t rc = bops->battery_status_get(fun, &batt_status);
 
 	if (rc != EOK)
@@ -155,5 +155,5 @@
 
 	int battery_level;
-	const int rc = bops->battery_charge_level_get(fun, &battery_level);
+	const errno_t rc = bops->battery_charge_level_get(fun, &battery_level);
 
 	if (rc != EOK)
Index: uspace/lib/drv/generic/remote_clock_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_clock_dev.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_clock_dev.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -75,5 +75,5 @@
 	ipc_callid_t cid;
 	struct tm t;
-	int rc;
+	errno_t rc;
 	size_t len;
 
@@ -114,5 +114,5 @@
 {
 	clock_dev_ops_t *clock_dev_ops = (clock_dev_ops_t *) ops;
-	int          rc;
+	errno_t      rc;
 	struct tm    t;
 	ipc_callid_t cid;
Index: uspace/lib/drv/generic/remote_hw_res.c
===================================================================
--- uspace/lib/drv/generic/remote_hw_res.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_hw_res.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -79,5 +79,5 @@
 	
 	const int irq = DEV_IPC_GET_ARG1(*call);
-	const int ret = hw_res_ops->enable_interrupt(fun, irq);
+	const errno_t ret = hw_res_ops->enable_interrupt(fun, irq);
 	async_answer_0(callid, ret);
 }
@@ -94,5 +94,5 @@
 	
 	const int irq = DEV_IPC_GET_ARG1(*call);
-	const int ret = hw_res_ops->disable_interrupt(fun, irq);
+	const errno_t ret = hw_res_ops->disable_interrupt(fun, irq);
 	async_answer_0(callid, ret);
 }
@@ -109,5 +109,5 @@
 	
 	const int irq = DEV_IPC_GET_ARG1(*call);
-	const int ret = hw_res_ops->enable_interrupt(fun, irq);
+	const errno_t ret = hw_res_ops->enable_interrupt(fun, irq);
 	async_answer_0(callid, ret);
 }
@@ -153,5 +153,5 @@
 	const uint32_t size = DEV_IPC_GET_ARG3(*call);
 
-	const int ret = hw_res_ops->dma_channel_setup(
+	const errno_t ret = hw_res_ops->dma_channel_setup(
 	    fun, channel, address, size, mode);
 	async_answer_0(callid, ret);
@@ -169,5 +169,5 @@
 	const unsigned channel = DEV_IPC_GET_ARG1(*call);
 	size_t remain = 0;
-	const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain);
+	const errno_t ret = hw_res_ops->dma_channel_remain(fun, channel, &remain);
 	async_answer_1(callid, ret, remain);
 }
Index: uspace/lib/drv/generic/remote_ieee80211.c
===================================================================
--- uspace/lib/drv/generic/remote_ieee80211.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_ieee80211.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -62,5 +62,5 @@
  *
  */
-int ieee80211_get_scan_results(async_sess_t *dev_sess,
+errno_t ieee80211_get_scan_results(async_sess_t *dev_sess,
     ieee80211_scan_results_t *results, bool now)
 {
@@ -71,13 +71,13 @@
 	aid_t aid = async_send_2(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE),
 	    IEEE80211_GET_SCAN_RESULTS, now, NULL);
-	int rc = async_data_read_start(exch, results,
+	errno_t rc = async_data_read_start(exch, results,
 	    sizeof(ieee80211_scan_results_t));
 	async_exchange_end(exch);
 	
-	int res;
+	errno_t res;
 	async_wait_for(aid, &res);
 	
 	if(res != EOK)
-		return (int) res;
+		return (errno_t) res;
 	
 	return rc;
@@ -100,5 +100,5 @@
 	size_t count;
 	
-	int rc = inetcfg_get_link_list(&link_list, &count);
+	errno_t rc = inetcfg_get_link_list(&link_list, &count);
 	if (rc != EOK)
 		return -1;
@@ -126,9 +126,9 @@
  *
  */
-int ieee80211_connect(async_sess_t *dev_sess, char *ssid_start, char *password)
+errno_t ieee80211_connect(async_sess_t *dev_sess, char *ssid_start, char *password)
 {
 	assert(ssid_start);
 	
-	int rc_orig;
+	errno_t rc_orig;
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
@@ -137,5 +137,5 @@
 	    IEEE80211_CONNECT, NULL);
 	
-	int rc = async_data_write_start(exch, ssid_start,
+	errno_t rc = async_data_write_start(exch, ssid_start,
 	    str_size(ssid_start) + 1);
 	if (rc != EOK) {
@@ -144,7 +144,7 @@
 		
 		if (rc_orig == EOK)
-			return (int) rc;
-		
-		return (int) rc_orig;
+			return (errno_t) rc;
+		
+		return (errno_t) rc_orig;
 	}
 	
@@ -159,7 +159,7 @@
 		
 		if (rc_orig == EOK)
-			return (int) rc;
-		
-		return (int) rc_orig;
+			return (errno_t) rc;
+		
+		return (errno_t) rc_orig;
 	}
 	
@@ -182,5 +182,5 @@
 	rc = dhcp_discover(link_id);
 	
-	return (int) rc;
+	return (errno_t) rc;
 }
 
@@ -193,8 +193,8 @@
  *
  */
-int ieee80211_disconnect(async_sess_t *dev_sess)
+errno_t ieee80211_disconnect(async_sess_t *dev_sess)
 {
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE),
+	errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(IEEE80211_DEV_IFACE),
 	    IEEE80211_DISCONNECT);
 	async_exchange_end(exch);
@@ -278,5 +278,5 @@
 	bool now = IPC_GET_ARG2(*call);
 	
-	int rc = ieee80211_iface->get_scan_results(fun, &scan_results, now);
+	errno_t rc = ieee80211_iface->get_scan_results(fun, &scan_results, now);
 	if (rc == EOK) {
 		ipc_callid_t data_callid;
@@ -324,5 +324,5 @@
 	}
 	
-	int rc = async_data_write_finalize(data_callid, ssid_start, len);
+	errno_t rc = async_data_write_finalize(data_callid, ssid_start, len);
 	if (rc != EOK) {
 		async_answer_0(data_callid, EINVAL);
@@ -360,5 +360,5 @@
 	ieee80211_iface_t *ieee80211_iface = (ieee80211_iface_t *) iface;
 	assert(ieee80211_iface->disconnect);
-	int rc = ieee80211_iface->disconnect(fun);
+	errno_t rc = ieee80211_iface->disconnect(fun);
 	async_answer_0(callid, rc);
 }
Index: uspace/lib/drv/generic/remote_led_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_led_dev.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_led_dev.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -77,5 +77,5 @@
 	}
 	
-	int rc = (*led_dev_ops->color_set)(fun, color);
+	errno_t rc = (*led_dev_ops->color_set)(fun, color);
 	async_answer_0(callid, rc);
 }
Index: uspace/lib/drv/generic/remote_nic.c
===================================================================
--- uspace/lib/drv/generic/remote_nic.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_nic.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -98,5 +98,5 @@
  *
  */
-int nic_send_frame(async_sess_t *dev_sess, void *data, size_t size)
+errno_t nic_send_frame(async_sess_t *dev_sess, void *data, size_t size)
 {
 	async_exch_t *exch = async_exchange_begin(dev_sess);
@@ -105,5 +105,5 @@
 	aid_t req = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_SEND_MESSAGE, &answer);
-	int retval = async_data_write_start(exch, data, size);
+	errno_t retval = async_data_write_start(exch, data, size);
 	
 	async_exchange_end(exch);
@@ -126,10 +126,10 @@
  *
  */
-int nic_callback_create(async_sess_t *dev_sess, async_port_handler_t cfun,
+errno_t nic_callback_create(async_sess_t *dev_sess, async_port_handler_t cfun,
     void *carg)
 {
 	ipc_call_t answer;
-	int rc;
-	int retval;
+	errno_t rc;
+	errno_t retval;
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
@@ -158,5 +158,5 @@
  *
  */
-int nic_get_state(async_sess_t *dev_sess, nic_device_state_t *state)
+errno_t nic_get_state(async_sess_t *dev_sess, nic_device_state_t *state)
 {
 	assert(state);
@@ -165,5 +165,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_GET_STATE, &_state);
 	async_exchange_end(exch);
@@ -182,8 +182,8 @@
  *
  */
-int nic_set_state(async_sess_t *dev_sess, nic_device_state_t state)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_set_state(async_sess_t *dev_sess, nic_device_state_t state)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_SET_STATE, state);
 	async_exchange_end(exch);
@@ -200,5 +200,5 @@
  *
  */
-int nic_get_address(async_sess_t *dev_sess, nic_address_t *address)
+errno_t nic_get_address(async_sess_t *dev_sess, nic_address_t *address)
 {
 	assert(address);
@@ -207,8 +207,8 @@
 	aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_GET_ADDRESS, NULL);
-	int rc = async_data_read_start(exch, address, sizeof(nic_address_t));
-	async_exchange_end(exch);
-	
-	int res;
+	errno_t rc = async_data_read_start(exch, address, sizeof(nic_address_t));
+	async_exchange_end(exch);
+	
+	errno_t res;
 	async_wait_for(aid, &res);
 	
@@ -227,5 +227,5 @@
  *
  */
-int nic_set_address(async_sess_t *dev_sess, const nic_address_t *address)
+errno_t nic_set_address(async_sess_t *dev_sess, const nic_address_t *address)
 {
 	assert(address);
@@ -234,8 +234,8 @@
 	aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_SET_ADDRESS, NULL);
-	int rc = async_data_write_start(exch, address, sizeof(nic_address_t));
-	async_exchange_end(exch);
-	
-	int res;
+	errno_t rc = async_data_write_start(exch, address, sizeof(nic_address_t));
+	async_exchange_end(exch);
+	
+	errno_t res;
 	async_wait_for(aid, &res);
 	
@@ -254,5 +254,5 @@
  *
  */
-int nic_get_stats(async_sess_t *dev_sess, nic_device_stats_t *stats)
+errno_t nic_get_stats(async_sess_t *dev_sess, nic_device_stats_t *stats)
 {
 	assert(stats);
@@ -260,5 +260,5 @@
 	async_exch_t *exch = async_exchange_begin(dev_sess);
 	
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_GET_STATS);
 	if (rc != EOK) {
@@ -284,5 +284,5 @@
  *
  */
-int nic_get_device_info(async_sess_t *dev_sess, nic_device_info_t *device_info)
+errno_t nic_get_device_info(async_sess_t *dev_sess, nic_device_info_t *device_info)
 {
 	assert(device_info);
@@ -292,8 +292,8 @@
 	aid_t aid = async_send_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_GET_DEVICE_INFO, NULL);
-	int rc = async_data_read_start(exch, device_info, sizeof(nic_device_info_t));
-	async_exchange_end(exch);
-
-	int res;
+	errno_t rc = async_data_read_start(exch, device_info, sizeof(nic_device_info_t));
+	async_exchange_end(exch);
+
+	errno_t res;
 	async_wait_for(aid, &res);
 	
@@ -312,5 +312,5 @@
  *
  */
-int nic_get_cable_state(async_sess_t *dev_sess, nic_cable_state_t *cable_state)
+errno_t nic_get_cable_state(async_sess_t *dev_sess, nic_cable_state_t *cable_state)
 {
 	assert(cable_state);
@@ -319,5 +319,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_GET_CABLE_STATE, &_cable_state);
 	async_exchange_end(exch);
@@ -338,5 +338,5 @@
  *
  */
-int nic_get_operation_mode(async_sess_t *dev_sess, int *speed,
+errno_t nic_get_operation_mode(async_sess_t *dev_sess, int *speed,
    nic_channel_mode_t *duplex, nic_role_t *role)
 {
@@ -346,5 +346,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_GET_OPERATION_MODE, &_speed, &_duplex, &_role);
 	async_exchange_end(exch);
@@ -375,9 +375,9 @@
  *
  */
-int nic_set_operation_mode(async_sess_t *dev_sess, int speed,
+errno_t nic_set_operation_mode(async_sess_t *dev_sess, int speed,
     nic_channel_mode_t duplex, nic_role_t role)
 {
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_SET_OPERATION_MODE, (sysarg_t) speed, (sysarg_t) duplex,
 	    (sysarg_t) role);
@@ -400,8 +400,8 @@
  *
  */
-int nic_autoneg_enable(async_sess_t *dev_sess, uint32_t advertisement)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_autoneg_enable(async_sess_t *dev_sess, uint32_t advertisement)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_AUTONEG_ENABLE, (sysarg_t) advertisement);
 	async_exchange_end(exch);
@@ -417,8 +417,8 @@
  *
  */
-int nic_autoneg_disable(async_sess_t *dev_sess)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_autoneg_disable(async_sess_t *dev_sess)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_AUTONEG_DISABLE);
 	async_exchange_end(exch);
@@ -444,5 +444,5 @@
  *
  */
-int nic_autoneg_probe(async_sess_t *dev_sess, uint32_t *our_advertisement,
+errno_t nic_autoneg_probe(async_sess_t *dev_sess, uint32_t *our_advertisement,
     uint32_t *their_advertisement, nic_result_t *result,
     nic_result_t *their_result)
@@ -454,5 +454,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_4(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_4(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_AUTONEG_PROBE, &_our_advertisement, &_their_advertisement,
 	    &_result, &_their_result);
@@ -481,8 +481,8 @@
  *
  */
-int nic_autoneg_restart(async_sess_t *dev_sess)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_autoneg_restart(async_sess_t *dev_sess)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_AUTONEG_RESTART);
 	async_exchange_end(exch);
@@ -501,5 +501,5 @@
  *
  */
-int nic_get_pause(async_sess_t *dev_sess, nic_result_t *we_send,
+errno_t nic_get_pause(async_sess_t *dev_sess, nic_result_t *we_send,
     nic_result_t *we_receive, uint16_t *pause)
 {
@@ -509,5 +509,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_3(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_GET_PAUSE, &_we_send, &_we_receive, &_pause);
 	async_exchange_end(exch);
@@ -539,9 +539,9 @@
  *
  */
-int nic_set_pause(async_sess_t *dev_sess, int allow_send, int allow_receive,
+errno_t nic_set_pause(async_sess_t *dev_sess, int allow_send, int allow_receive,
     uint16_t pause)
 {
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_SET_PAUSE, allow_send, allow_receive, pause);
 	async_exchange_end(exch);
@@ -566,5 +566,5 @@
  *
  */
-int nic_unicast_get_mode(async_sess_t *dev_sess, nic_unicast_mode_t *mode,
+errno_t nic_unicast_get_mode(async_sess_t *dev_sess, nic_unicast_mode_t *mode,
     size_t max_count, nic_address_t *address_list, size_t *address_count)
 {
@@ -579,5 +579,5 @@
 	async_exch_t *exch = async_exchange_begin(dev_sess);
 	
-	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_UNICAST_GET_MODE, max_count, &_mode, &_address_count);
 	if (rc != EOK) {
@@ -609,5 +609,5 @@
  *
  */
-int nic_unicast_set_mode(async_sess_t *dev_sess, nic_unicast_mode_t mode,
+errno_t nic_unicast_set_mode(async_sess_t *dev_sess, nic_unicast_mode_t mode,
     const nic_address_t *address_list, size_t address_count)
 {
@@ -620,5 +620,5 @@
 	    NIC_UNICAST_SET_MODE, (sysarg_t) mode, address_count, NULL);
 	
-	int rc;
+	errno_t rc;
 	if (address_count)
 		rc = async_data_write_start(exch, address_list,
@@ -629,5 +629,5 @@
 	async_exchange_end(exch);
 	
-	int res;
+	errno_t res;
 	async_wait_for(message_id, &res);
 	
@@ -655,5 +655,5 @@
  *
  */
-int nic_multicast_get_mode(async_sess_t *dev_sess, nic_multicast_mode_t *mode,
+errno_t nic_multicast_get_mode(async_sess_t *dev_sess, nic_multicast_mode_t *mode,
     size_t max_count, nic_address_t *address_list, size_t *address_count)
 {
@@ -668,5 +668,5 @@
 	
 	sysarg_t ac;
-	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_MULTICAST_GET_MODE, max_count, &_mode, &ac);
 	if (rc != EOK) {
@@ -697,5 +697,5 @@
  *
  */
-int nic_multicast_set_mode(async_sess_t *dev_sess, nic_multicast_mode_t mode,
+errno_t nic_multicast_set_mode(async_sess_t *dev_sess, nic_multicast_mode_t mode,
     const nic_address_t *address_list, size_t address_count)
 {
@@ -708,5 +708,5 @@
 	    NIC_MULTICAST_SET_MODE, (sysarg_t) mode, address_count, NULL);
 	
-	int rc;
+	errno_t rc;
 	if (address_count)
 		rc = async_data_write_start(exch, address_list,
@@ -717,5 +717,5 @@
 	async_exchange_end(exch);
 	
-	int res;
+	errno_t res;
 	async_wait_for(message_id, &res);
 	
@@ -734,5 +734,5 @@
  *
  */
-int nic_broadcast_get_mode(async_sess_t *dev_sess, nic_broadcast_mode_t *mode)
+errno_t nic_broadcast_get_mode(async_sess_t *dev_sess, nic_broadcast_mode_t *mode)
 {
 	assert(mode);
@@ -741,5 +741,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_BROADCAST_GET_MODE, &_mode);
 	async_exchange_end(exch);
@@ -758,8 +758,8 @@
  *
  */
-int nic_broadcast_set_mode(async_sess_t *dev_sess, nic_broadcast_mode_t mode)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_broadcast_set_mode(async_sess_t *dev_sess, nic_broadcast_mode_t mode)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_BROADCAST_SET_MODE, mode);
 	async_exchange_end(exch);
@@ -776,5 +776,5 @@
  *
  */
-int nic_defective_get_mode(async_sess_t *dev_sess, uint32_t *mode)
+errno_t nic_defective_get_mode(async_sess_t *dev_sess, uint32_t *mode)
 {
 	assert(mode);
@@ -783,5 +783,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_DEFECTIVE_GET_MODE, &_mode);
 	async_exchange_end(exch);
@@ -800,8 +800,8 @@
  *
  */
-int nic_defective_set_mode(async_sess_t *dev_sess, uint32_t mode)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_defective_set_mode(async_sess_t *dev_sess, uint32_t mode)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_DEFECTIVE_SET_MODE, mode);
 	async_exchange_end(exch);
@@ -822,5 +822,5 @@
  *
  */
-int nic_blocked_sources_get(async_sess_t *dev_sess, size_t max_count,
+errno_t nic_blocked_sources_get(async_sess_t *dev_sess, size_t max_count,
     nic_address_t *address_list, size_t *address_count)
 {
@@ -831,5 +831,5 @@
 	
 	sysarg_t ac;
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_BLOCKED_SOURCES_GET, max_count, &ac);
 	if (rc != EOK) {
@@ -858,5 +858,5 @@
  *
  */
-int nic_blocked_sources_set(async_sess_t *dev_sess,
+errno_t nic_blocked_sources_set(async_sess_t *dev_sess,
     const nic_address_t *address_list, size_t address_count)
 {
@@ -869,5 +869,5 @@
 	    NIC_BLOCKED_SOURCES_SET, address_count, NULL);
 	
-	int rc;
+	errno_t rc;
 	if (address_count)
 		rc = async_data_write_start(exch, address_list,
@@ -878,5 +878,5 @@
 	async_exchange_end(exch);
 	
-	int res;
+	errno_t res;
 	async_wait_for(message_id, &res);
 	
@@ -895,10 +895,10 @@
  *
  */
-int nic_vlan_get_mask(async_sess_t *dev_sess, nic_vlan_mask_t *mask)
+errno_t nic_vlan_get_mask(async_sess_t *dev_sess, nic_vlan_mask_t *mask)
 {
 	assert(mask);
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_VLAN_GET_MASK);
 	if (rc != EOK) {
@@ -923,5 +923,5 @@
  *
  */
-int nic_vlan_set_mask(async_sess_t *dev_sess, const nic_vlan_mask_t *mask)
+errno_t nic_vlan_set_mask(async_sess_t *dev_sess, const nic_vlan_mask_t *mask)
 {
 	async_exch_t *exch = async_exchange_begin(dev_sess);
@@ -930,5 +930,5 @@
 	    NIC_VLAN_SET_MASK, mask != NULL, NULL);
 	
-	int rc;
+	errno_t rc;
 	if (mask != NULL)
 		rc = async_data_write_start(exch, mask, sizeof(nic_vlan_mask_t));
@@ -938,5 +938,5 @@
 	async_exchange_end(exch);
 	
-	int res;
+	errno_t res;
 	async_wait_for(message_id, &res);
 	
@@ -963,8 +963,8 @@
  *
  */
-int nic_vlan_set_tag(async_sess_t *dev_sess, uint16_t tag, bool add, bool strip)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_vlan_set_tag(async_sess_t *dev_sess, uint16_t tag, bool add, bool strip)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_4_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_VLAN_SET_TAG, (sysarg_t) tag, (sysarg_t) add, (sysarg_t) strip);
 	async_exchange_end(exch);
@@ -985,5 +985,5 @@
  *
  */
-int nic_wol_virtue_add(async_sess_t *dev_sess, nic_wv_type_t type,
+errno_t nic_wol_virtue_add(async_sess_t *dev_sess, nic_wv_type_t type,
     const void *data, size_t length, nic_wv_id_t *id)
 {
@@ -997,7 +997,7 @@
 	    NIC_WOL_VIRTUE_ADD, (sysarg_t) type, send_data, &result);
 	
-	int res;
+	errno_t res;
 	if (send_data) {
-		int rc = async_data_write_start(exch, data, length);
+		errno_t rc = async_data_write_start(exch, data, length);
 		if (rc != EOK) {
 			async_exchange_end(exch);
@@ -1022,8 +1022,8 @@
  *
  */
-int nic_wol_virtue_remove(async_sess_t *dev_sess, nic_wv_id_t id)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_wol_virtue_remove(async_sess_t *dev_sess, nic_wv_id_t id)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_2_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_WOL_VIRTUE_REMOVE, (sysarg_t) id);
 	async_exchange_end(exch);
@@ -1045,5 +1045,5 @@
  *
  */
-int nic_wol_virtue_probe(async_sess_t *dev_sess, nic_wv_id_t id,
+errno_t nic_wol_virtue_probe(async_sess_t *dev_sess, nic_wv_id_t id,
     nic_wv_type_t *type, size_t max_length, void *data, size_t *length)
 {
@@ -1056,5 +1056,5 @@
 	async_exch_t *exch = async_exchange_begin(dev_sess);
 	
-	int rc = async_req_3_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_3_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_WOL_VIRTUE_PROBE, (sysarg_t) id, max_length,
 	    &_type, &_length);
@@ -1095,5 +1095,5 @@
  *
  */
-int nic_wol_virtue_list(async_sess_t *dev_sess, nic_wv_type_t type,
+errno_t nic_wol_virtue_list(async_sess_t *dev_sess, nic_wv_type_t type,
     size_t max_count, nic_wv_id_t *id_list, size_t *id_count)
 {
@@ -1104,5 +1104,5 @@
 	
 	sysarg_t count;
-	int rc = async_req_3_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_3_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_WOL_VIRTUE_LIST, (sysarg_t) type, max_count, &count);
 	
@@ -1135,5 +1135,5 @@
  *
  */
-int nic_wol_virtue_get_caps(async_sess_t *dev_sess, nic_wv_type_t type,
+errno_t nic_wol_virtue_get_caps(async_sess_t *dev_sess, nic_wv_type_t type,
     int *count)
 {
@@ -1143,5 +1143,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_WOL_VIRTUE_GET_CAPS, (sysarg_t) type, &_count);
 	async_exchange_end(exch);
@@ -1173,5 +1173,5 @@
  *
  */
-int nic_wol_load_info(async_sess_t *dev_sess, nic_wv_type_t *matched_type,
+errno_t nic_wol_load_info(async_sess_t *dev_sess, nic_wv_type_t *matched_type,
     size_t max_length, uint8_t *frame, size_t *frame_length)
 {
@@ -1186,5 +1186,5 @@
 	async_exch_t *exch = async_exchange_begin(dev_sess);
 	
-	int rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_2_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_WOL_LOAD_INFO, max_length, &_matched_type, &_frame_length);
 	if (rc != EOK) {
@@ -1213,5 +1213,5 @@
  *
  */
-int nic_offload_probe(async_sess_t *dev_sess, uint32_t *supported,
+errno_t nic_offload_probe(async_sess_t *dev_sess, uint32_t *supported,
     uint32_t *active)
 {
@@ -1223,5 +1223,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_1_2(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_OFFLOAD_PROBE, &_supported, &_active);
 	async_exchange_end(exch);
@@ -1241,8 +1241,8 @@
  *
  */
-int nic_offload_set(async_sess_t *dev_sess, uint32_t mask, uint32_t active)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+errno_t nic_offload_set(async_sess_t *dev_sess, uint32_t mask, uint32_t active)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_AUTONEG_RESTART, (sysarg_t) mask, (sysarg_t) active);
 	async_exchange_end(exch);
@@ -1261,5 +1261,5 @@
  *
  */
-int nic_poll_get_mode(async_sess_t *dev_sess, nic_poll_mode_t *mode,
+errno_t nic_poll_get_mode(async_sess_t *dev_sess, nic_poll_mode_t *mode,
     struct timeval *period)
 {
@@ -1270,5 +1270,5 @@
 	async_exch_t *exch = async_exchange_begin(dev_sess);
 	
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
+	errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(NIC_DEV_IFACE),
 	    NIC_POLL_GET_MODE, period != NULL, &_mode);
 	if (rc != EOK) {
@@ -1295,5 +1295,5 @@
  *
  */
-int nic_poll_set_mode(async_sess_t *dev_sess, nic_poll_mode_t mode,
+errno_t nic_poll_set_mode(async_sess_t *dev_sess, nic_poll_mode_t mode,
     const struct timeval *period)
 {
@@ -1303,5 +1303,5 @@
 	    NIC_POLL_SET_MODE, (sysarg_t) mode, period != NULL, NULL);
 	
-	int rc;
+	errno_t rc;
 	if (period)
 		rc = async_data_write_start(exch, period, sizeof(struct timeval));
@@ -1311,5 +1311,5 @@
 	async_exchange_end(exch);
 	
-	int res;
+	errno_t res;
 	async_wait_for(message_id, &res);
 	
@@ -1327,8 +1327,8 @@
  *
  */
-int nic_poll_now(async_sess_t *dev_sess)
-{
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	int rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), NIC_POLL_NOW);
+errno_t nic_poll_now(async_sess_t *dev_sess)
+{
+	async_exch_t *exch = async_exchange_begin(dev_sess);
+	errno_t rc = async_req_1_0(exch, DEV_IFACE_ID(NIC_DEV_IFACE), NIC_POLL_NOW);
 	async_exchange_end(exch);
 	
@@ -1344,5 +1344,5 @@
 	void *data;
 	size_t size;
-	int rc;
+	errno_t rc;
 	
 	rc = async_data_write_accept(&data, false, 0, 0, 0, &size);
@@ -1363,5 +1363,5 @@
 	assert(nic_iface->callback_create);
 	
-	int rc = nic_iface->callback_create(dev);
+	errno_t rc = nic_iface->callback_create(dev);
 	async_answer_0(callid, rc);
 }
@@ -1375,5 +1375,5 @@
 	nic_device_state_t state = NIC_STATE_MAX;
 	
-	int rc = nic_iface->get_state(dev, &state);
+	errno_t rc = nic_iface->get_state(dev, &state);
 	async_answer_1(callid, rc, state);
 }
@@ -1387,5 +1387,5 @@
 	nic_device_state_t state = (nic_device_state_t) IPC_GET_ARG2(*call);
 	
-	int rc = nic_iface->set_state(dev, state);
+	errno_t rc = nic_iface->set_state(dev, state);
 	async_answer_0(callid, rc);
 }
@@ -1400,5 +1400,5 @@
 	memset(&address, 0, sizeof(nic_address_t));
 	
-	int rc = nic_iface->get_address(dev, &address);
+	errno_t rc = nic_iface->get_address(dev, &address);
 	if (rc == EOK) {
 		size_t max_len;
@@ -1451,5 +1451,5 @@
 	
 	if (nic_iface->set_address != NULL) {
-		int rc = nic_iface->set_address(dev, &address);
+		errno_t rc = nic_iface->set_address(dev, &address);
 		async_answer_0(callid, rc);
 	} else
@@ -1469,5 +1469,5 @@
 	memset(&stats, 0, sizeof(nic_device_stats_t));
 	
-	int rc = nic_iface->get_stats(dev, &stats);
+	errno_t rc = nic_iface->get_stats(dev, &stats);
 	if (rc == EOK) {
 		ipc_callid_t data_callid;
@@ -1504,5 +1504,5 @@
 	memset(&info, 0, sizeof(nic_device_info_t));
 	
-	int rc = nic_iface->get_device_info(dev, &info);
+	errno_t rc = nic_iface->get_device_info(dev, &info);
 	if (rc == EOK) {
 		ipc_callid_t data_callid;
@@ -1538,5 +1538,5 @@
 	nic_cable_state_t cs = NIC_CS_UNKNOWN;
 	
-	int rc = nic_iface->get_cable_state(dev, &cs);
+	errno_t rc = nic_iface->get_cable_state(dev, &cs);
 	async_answer_1(callid, rc, (sysarg_t) cs);
 }
@@ -1555,5 +1555,5 @@
 	nic_role_t role = NIC_ROLE_UNKNOWN;
 	
-	int rc = nic_iface->get_operation_mode(dev, &speed, &duplex, &role);
+	errno_t rc = nic_iface->get_operation_mode(dev, &speed, &duplex, &role);
 	async_answer_3(callid, rc, (sysarg_t) speed, (sysarg_t) duplex,
 	    (sysarg_t) role);
@@ -1573,5 +1573,5 @@
 	nic_role_t role = (nic_role_t) IPC_GET_ARG4(*call);
 	
-	int rc = nic_iface->set_operation_mode(dev, speed, duplex, role);
+	errno_t rc = nic_iface->set_operation_mode(dev, speed, duplex, role);
 	async_answer_0(callid, rc);
 }
@@ -1588,5 +1588,5 @@
 	uint32_t advertisement = (uint32_t) IPC_GET_ARG2(*call);
 	
-	int rc = nic_iface->autoneg_enable(dev, advertisement);
+	errno_t rc = nic_iface->autoneg_enable(dev, advertisement);
 	async_answer_0(callid, rc);
 }
@@ -1601,5 +1601,5 @@
 	}
 	
-	int rc = nic_iface->autoneg_disable(dev);
+	errno_t rc = nic_iface->autoneg_disable(dev);
 	async_answer_0(callid, rc);
 }
@@ -1619,5 +1619,5 @@
 	nic_result_t their_result = NIC_RESULT_NOT_AVAILABLE;
 	
-	int rc = nic_iface->autoneg_probe(dev, &our_adv, &their_adv, &result,
+	errno_t rc = nic_iface->autoneg_probe(dev, &our_adv, &their_adv, &result,
 	    &their_result);
 	async_answer_4(callid, rc, our_adv, their_adv, (sysarg_t) result,
@@ -1634,5 +1634,5 @@
 	}
 	
-	int rc = nic_iface->autoneg_restart(dev);
+	errno_t rc = nic_iface->autoneg_restart(dev);
 	async_answer_0(callid, rc);
 }
@@ -1651,5 +1651,5 @@
 	uint16_t pause;
 	
-	int rc = nic_iface->get_pause(dev, &we_send, &we_receive, &pause);
+	errno_t rc = nic_iface->get_pause(dev, &we_send, &we_receive, &pause);
 	async_answer_3(callid, rc, we_send, we_receive, pause);
 }
@@ -1668,5 +1668,5 @@
 	uint16_t pause = (uint16_t) IPC_GET_ARG4(*call);
 	
-	int rc = nic_iface->set_pause(dev, allow_send, allow_receive,
+	errno_t rc = nic_iface->set_pause(dev, allow_send, allow_receive,
 	    pause);
 	async_answer_0(callid, rc);
@@ -1697,5 +1697,5 @@
 	size_t address_count = 0;
 	
-	int rc = nic_iface->unicast_get_mode(dev, &mode, max_count, address_list,
+	errno_t rc = nic_iface->unicast_get_mode(dev, &mode, max_count, address_list,
 	    &address_count);
 	
@@ -1768,5 +1768,5 @@
 	
 	if (nic_iface->unicast_set_mode != NULL) {
-		int rc = nic_iface->unicast_set_mode(dev, mode, address_list,
+		errno_t rc = nic_iface->unicast_set_mode(dev, mode, address_list,
 		    address_count);
 		async_answer_0(callid, rc);
@@ -1801,5 +1801,5 @@
 	size_t address_count = 0;
 	
-	int rc = nic_iface->multicast_get_mode(dev, &mode, max_count, address_list,
+	errno_t rc = nic_iface->multicast_get_mode(dev, &mode, max_count, address_list,
 	    &address_count);
 	
@@ -1872,5 +1872,5 @@
 	
 	if (nic_iface->multicast_set_mode != NULL) {
-		int rc = nic_iface->multicast_set_mode(dev, mode, address_list,
+		errno_t rc = nic_iface->multicast_set_mode(dev, mode, address_list,
 		    address_count);
 		async_answer_0(callid, rc);
@@ -1892,5 +1892,5 @@
 	nic_broadcast_mode_t mode = NIC_BROADCAST_ACCEPTED;
 	
-	int rc = nic_iface->broadcast_get_mode(dev, &mode);
+	errno_t rc = nic_iface->broadcast_get_mode(dev, &mode);
 	async_answer_1(callid, rc, mode);
 }
@@ -1907,5 +1907,5 @@
 	nic_broadcast_mode_t mode = IPC_GET_ARG2(*call);
 	
-	int rc = nic_iface->broadcast_set_mode(dev, mode);
+	errno_t rc = nic_iface->broadcast_set_mode(dev, mode);
 	async_answer_0(callid, rc);
 }
@@ -1922,5 +1922,5 @@
 	uint32_t mode = 0;
 	
-	int rc = nic_iface->defective_get_mode(dev, &mode);
+	errno_t rc = nic_iface->defective_get_mode(dev, &mode);
 	async_answer_1(callid, rc, mode);
 }
@@ -1937,5 +1937,5 @@
 	uint32_t mode = IPC_GET_ARG2(*call);
 	
-	int rc = nic_iface->defective_set_mode(dev, mode);
+	errno_t rc = nic_iface->defective_set_mode(dev, mode);
 	async_answer_0(callid, rc);
 }
@@ -1964,5 +1964,5 @@
 	size_t address_count = 0;
 	
-	int rc = nic_iface->blocked_sources_get(dev, max_count, address_list,
+	errno_t rc = nic_iface->blocked_sources_get(dev, max_count, address_list,
 	    &address_count);
 	
@@ -2034,5 +2034,5 @@
 	
 	if (nic_iface->blocked_sources_set != NULL) {
-		int rc = nic_iface->blocked_sources_set(dev, address_list,
+		errno_t rc = nic_iface->blocked_sources_set(dev, address_list,
 		    address_count);
 		async_answer_0(callid, rc);
@@ -2055,5 +2055,5 @@
 	memset(&vlan_mask, 0, sizeof(nic_vlan_mask_t));
 	
-	int rc = nic_iface->vlan_get_mask(dev, &vlan_mask);
+	errno_t rc = nic_iface->vlan_get_mask(dev, &vlan_mask);
 	if (rc == EOK) {
 		ipc_callid_t data_callid;
@@ -2111,5 +2111,5 @@
 	
 	if (nic_iface->vlan_set_mask != NULL) {
-		int rc = nic_iface->vlan_set_mask(dev, vlan_mask_pointer);
+		errno_t rc = nic_iface->vlan_set_mask(dev, vlan_mask_pointer);
 		async_answer_0(callid, rc);
 	} else
@@ -2131,5 +2131,5 @@
 	bool strip = (int) IPC_GET_ARG4(*call);
 	
-	int rc = nic_iface->vlan_set_tag(dev, tag, add, strip);
+	errno_t rc = nic_iface->vlan_set_tag(dev, tag, add, strip);
 	async_answer_0(callid, rc);
 }
@@ -2180,5 +2180,5 @@
 	nic_wv_type_t type = (nic_wv_type_t) IPC_GET_ARG2(*call);
 	
-	int rc = nic_iface->wol_virtue_add(dev, type, data, length, &id);
+	errno_t rc = nic_iface->wol_virtue_add(dev, type, data, length, &id);
 	async_answer_1(callid, rc, (sysarg_t) id);
 	free(data);
@@ -2197,5 +2197,5 @@
 	nic_wv_id_t id = (nic_wv_id_t) IPC_GET_ARG2(*call);
 	
-	int rc = nic_iface->wol_virtue_remove(dev, id);
+	errno_t rc = nic_iface->wol_virtue_remove(dev, id);
 	async_answer_0(callid, rc);
 }
@@ -2228,5 +2228,5 @@
 	memset(data, 0, max_length);
 	
-	int rc = nic_iface->wol_virtue_probe(dev, id, &type, max_length,
+	errno_t rc = nic_iface->wol_virtue_probe(dev, id, &type, max_length,
 	    data, &length);
 	
@@ -2278,5 +2278,5 @@
 	memset(id_list, 0, max_count * sizeof (nic_wv_id_t));
 	
-	int rc = nic_iface->wol_virtue_list(dev, type, max_count, id_list,
+	errno_t rc = nic_iface->wol_virtue_list(dev, type, max_count, id_list,
 	    &count);
 	
@@ -2315,5 +2315,5 @@
 	nic_wv_type_t type = (nic_wv_type_t) IPC_GET_ARG2(*call);
 	
-	int rc = nic_iface->wol_virtue_get_caps(dev, type, &count);
+	errno_t rc = nic_iface->wol_virtue_get_caps(dev, type, &count);
 	async_answer_1(callid, rc, (sysarg_t) count);
 }
@@ -2343,5 +2343,5 @@
 	memset(data, 0, max_length);
 	
-	int rc = nic_iface->wol_load_info(dev, &type, max_length, data,
+	errno_t rc = nic_iface->wol_load_info(dev, &type, max_length, data,
 	    &frame_length);
 	if (rc == EOK) {
@@ -2376,5 +2376,5 @@
 	uint32_t active = 0;
 	
-	int rc = nic_iface->offload_probe(dev, &supported, &active);
+	errno_t rc = nic_iface->offload_probe(dev, &supported, &active);
 	async_answer_2(callid, rc, supported, active);
 }
@@ -2392,5 +2392,5 @@
 	uint32_t active = (uint32_t) IPC_GET_ARG3(*call);
 	
-	int rc = nic_iface->offload_set(dev, mask, active);
+	errno_t rc = nic_iface->offload_set(dev, mask, active);
 	async_answer_0(callid, rc);
 }
@@ -2412,5 +2412,5 @@
 	};
 	
-	int rc = nic_iface->poll_get_mode(dev, &mode, &period);
+	errno_t rc = nic_iface->poll_get_mode(dev, &mode, &period);
 	if ((rc == EOK) && (request_data)) {
 		size_t max_len;
@@ -2470,5 +2470,5 @@
 	
 	if (nic_iface->poll_set_mode != NULL) {
-		int rc = nic_iface->poll_set_mode(dev, mode, period);
+		errno_t rc = nic_iface->poll_set_mode(dev, mode, period);
 		async_answer_0(callid, rc);
 	} else
@@ -2485,5 +2485,5 @@
 	}
 	
-	int rc = nic_iface->poll_now(dev);
+	errno_t rc = nic_iface->poll_now(dev);
 	async_answer_0(callid, rc);
 }
Index: uspace/lib/drv/generic/remote_pci.c
===================================================================
--- uspace/lib/drv/generic/remote_pci.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_pci.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -51,10 +51,10 @@
 } pci_dev_iface_funcs_t;
 
-int pci_config_space_read_8(async_sess_t *sess, uint32_t address, uint8_t *val)
+errno_t pci_config_space_read_8(async_sess_t *sess, uint32_t address, uint8_t *val)
 {
 	sysarg_t res = 0;
 	
 	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
 	    IPC_M_CONFIG_SPACE_READ_8, address, &res);
 	async_exchange_end(exch);
@@ -64,5 +64,5 @@
 }
 
-int pci_config_space_read_16(async_sess_t *sess, uint32_t address,
+errno_t pci_config_space_read_16(async_sess_t *sess, uint32_t address,
     uint16_t *val)
 {
@@ -70,5 +70,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
 	    IPC_M_CONFIG_SPACE_READ_16, address, &res);
 	async_exchange_end(exch);
@@ -78,5 +78,5 @@
 }
 
-int pci_config_space_read_32(async_sess_t *sess, uint32_t address,
+errno_t pci_config_space_read_32(async_sess_t *sess, uint32_t address,
     uint32_t *val)
 {
@@ -84,5 +84,5 @@
 	
 	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	errno_t rc = async_req_2_1(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
 	    IPC_M_CONFIG_SPACE_READ_32, address, &res);
 	async_exchange_end(exch);
@@ -92,8 +92,8 @@
 }
 
-int pci_config_space_write_8(async_sess_t *sess, uint32_t address, uint8_t val)
-{
-	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+errno_t pci_config_space_write_8(async_sess_t *sess, uint32_t address, uint8_t val)
+{
+	async_exch_t *exch = async_exchange_begin(sess);
+	errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
 	    IPC_M_CONFIG_SPACE_WRITE_8, address, val);
 	async_exchange_end(exch);
@@ -102,9 +102,9 @@
 }
 
-int pci_config_space_write_16(async_sess_t *sess, uint32_t address,
+errno_t pci_config_space_write_16(async_sess_t *sess, uint32_t address,
     uint16_t val)
 {
 	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
 	    IPC_M_CONFIG_SPACE_WRITE_16, address, val);
 	async_exchange_end(exch);
@@ -113,9 +113,9 @@
 }
 
-int pci_config_space_write_32(async_sess_t *sess, uint32_t address,
+errno_t pci_config_space_write_32(async_sess_t *sess, uint32_t address,
     uint32_t val)
 {
 	async_exch_t *exch = async_exchange_begin(sess);
-	int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
+	errno_t rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
 	    IPC_M_CONFIG_SPACE_WRITE_32, address, val);
 	async_exchange_end(exch);
@@ -160,5 +160,5 @@
 	uint32_t address = DEV_IPC_GET_ARG1(*call);
 	uint8_t value;
-	int ret = pci_iface->config_space_read_8(fun, address, &value);
+	errno_t ret = pci_iface->config_space_read_8(fun, address, &value);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
@@ -178,5 +178,5 @@
 	uint32_t address = DEV_IPC_GET_ARG1(*call);
 	uint16_t value;
-	int ret = pci_iface->config_space_read_16(fun, address, &value);
+	errno_t ret = pci_iface->config_space_read_16(fun, address, &value);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
@@ -195,5 +195,5 @@
 	uint32_t address = DEV_IPC_GET_ARG1(*call);
 	uint32_t value;
-	int ret = pci_iface->config_space_read_32(fun, address, &value);
+	errno_t ret = pci_iface->config_space_read_32(fun, address, &value);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
@@ -213,5 +213,5 @@
 	uint32_t address = DEV_IPC_GET_ARG1(*call);
 	uint8_t value = DEV_IPC_GET_ARG2(*call);
-	int ret = pci_iface->config_space_write_8(fun, address, value);
+	errno_t ret = pci_iface->config_space_write_8(fun, address, value);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
@@ -231,5 +231,5 @@
 	uint32_t address = DEV_IPC_GET_ARG1(*call);
 	uint16_t value = DEV_IPC_GET_ARG2(*call);
-	int ret = pci_iface->config_space_write_16(fun, address, value);
+	errno_t ret = pci_iface->config_space_write_16(fun, address, value);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
@@ -249,5 +249,5 @@
 	uint32_t address = DEV_IPC_GET_ARG1(*call);
 	uint32_t value = DEV_IPC_GET_ARG2(*call);
-	int ret = pci_iface->config_space_write_32(fun, address, value);
+	errno_t ret = pci_iface->config_space_write_32(fun, address, value);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
Index: uspace/lib/drv/generic/remote_usb.c
===================================================================
--- uspace/lib/drv/generic/remote_usb.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_usb.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -79,10 +79,10 @@
  * @return Error code.
  */
-int usb_get_my_interface(async_exch_t *exch, int *usb_iface)
+errno_t usb_get_my_interface(async_exch_t *exch, int *usb_iface)
 {
 	if (!exch)
 		return EBADMEM;
 	sysarg_t iface_no;
-	const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
+	const errno_t ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
 	    IPC_M_USB_GET_MY_INTERFACE, &iface_no);
 	if (ret == EOK && usb_iface)
@@ -99,8 +99,8 @@
  *
  */
-int usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle)
+errno_t usb_get_my_device_handle(async_exch_t *exch, devman_handle_t *handle)
 {
 	devman_handle_t h = 0;
-	const int ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
+	const errno_t ret = async_req_1_1(exch, DEV_IFACE_ID(USB_DEV_IFACE),
 	    IPC_M_USB_GET_MY_DEVICE_HANDLE, &h);
 	if (ret == EOK && handle)
@@ -114,5 +114,5 @@
  * @return Error code.
  */
-int usb_reserve_default_address(async_exch_t *exch, usb_speed_t speed)
+errno_t usb_reserve_default_address(async_exch_t *exch, usb_speed_t speed)
 {
 	if (!exch)
@@ -129,5 +129,5 @@
  *
  */
-int usb_release_default_address(async_exch_t *exch)
+errno_t usb_release_default_address(async_exch_t *exch)
 {
 	if (!exch)
@@ -145,9 +145,9 @@
  *
  */
-int usb_device_enumerate(async_exch_t *exch, unsigned port)
-{
-	if (!exch)
-		return EBADMEM;
-	const int ret = async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE),
+errno_t usb_device_enumerate(async_exch_t *exch, unsigned port)
+{
+	if (!exch)
+		return EBADMEM;
+	const errno_t ret = async_req_2_0(exch, DEV_IFACE_ID(USB_DEV_IFACE),
 	    IPC_M_USB_DEVICE_ENUMERATE, port);
 	return ret;
@@ -162,5 +162,5 @@
  *
  */
-int usb_device_remove(async_exch_t *exch, unsigned port)
+errno_t usb_device_remove(async_exch_t *exch, unsigned port)
 {
 	if (!exch)
@@ -177,5 +177,5 @@
 } pack8_t;
 
-int usb_register_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
+errno_t usb_register_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
     usb_transfer_type_t type, usb_direction_t direction,
     size_t mps, unsigned packets, unsigned interval)
@@ -194,5 +194,5 @@
 }
 
-int usb_unregister_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
+errno_t usb_unregister_endpoint(async_exch_t *exch, usb_endpoint_t endpoint,
     usb_direction_t direction)
 {
@@ -203,5 +203,5 @@
 }
 
-int usb_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
+errno_t usb_read(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
     void *data, size_t size, size_t *rec_size)
 {
@@ -233,6 +233,6 @@
 
 	/* Wait for the answer. */
-	int data_request_rc;
-	int opening_request_rc;
+	errno_t data_request_rc;
+	errno_t opening_request_rc;
 	async_wait_for(data_request, &data_request_rc);
 	async_wait_for(opening_request, &opening_request_rc);
@@ -241,11 +241,11 @@
 		/* Prefer the return code of the opening request. */
 		if (opening_request_rc != EOK) {
-			return (int) opening_request_rc;
+			return (errno_t) opening_request_rc;
 		} else {
-			return (int) data_request_rc;
+			return (errno_t) data_request_rc;
 		}
 	}
 	if (opening_request_rc != EOK) {
-		return (int) opening_request_rc;
+		return (errno_t) opening_request_rc;
 	}
 
@@ -254,5 +254,5 @@
 }
 
-int usb_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
+errno_t usb_write(async_exch_t *exch, usb_endpoint_t endpoint, uint64_t setup,
     const void *data, size_t size)
 {
@@ -273,5 +273,5 @@
 	/* Send the data if any. */
 	if (size > 0) {
-		const int ret = async_data_write_start(exch, data, size);
+		const errno_t ret = async_data_write_start(exch, data, size);
 		if (ret != EOK) {
 			async_forget(opening_request);
@@ -281,8 +281,8 @@
 
 	/* Wait for the answer. */
-	int opening_request_rc;
+	errno_t opening_request_rc;
 	async_wait_for(opening_request, &opening_request_rc);
 
-	return (int) opening_request_rc;
+	return (errno_t) opening_request_rc;
 }
 
@@ -330,5 +330,5 @@
 
 	int iface_no;
-	const int ret = usb_iface->get_my_interface(fun, &iface_no);
+	const errno_t ret = usb_iface->get_my_interface(fun, &iface_no);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
@@ -349,5 +349,5 @@
 
 	devman_handle_t handle;
-	const int ret = usb_iface->get_my_device_handle(fun, &handle);
+	const errno_t ret = usb_iface->get_my_device_handle(fun, &handle);
 	if (ret != EOK) {
 		async_answer_0(callid, ret);
@@ -368,5 +368,5 @@
 
 	usb_speed_t speed = DEV_IPC_GET_ARG1(*call);
-	const int ret = usb_iface->reserve_default_address(fun, speed);
+	const errno_t ret = usb_iface->reserve_default_address(fun, speed);
 	async_answer_0(callid, ret);
 }
@@ -382,5 +382,5 @@
 	}
 
-	const int ret = usb_iface->release_default_address(fun);
+	const errno_t ret = usb_iface->release_default_address(fun);
 	async_answer_0(callid, ret);
 }
@@ -397,5 +397,5 @@
 
 	const unsigned port = DEV_IPC_GET_ARG1(*call);
-	const int ret = usb_iface->device_enumerate(fun, port);
+	const errno_t ret = usb_iface->device_enumerate(fun, port);
 	async_answer_0(callid, ret);
 }
@@ -412,5 +412,5 @@
 
 	const unsigned port = DEV_IPC_GET_ARG1(*call);
-	const int ret = usb_iface->device_remove(fun, port);
+	const errno_t ret = usb_iface->device_remove(fun, port);
 	async_answer_0(callid, ret);
 }
@@ -435,5 +435,5 @@
 	unsigned interval = pack.arr[3];
 
-	const int ret = usb_iface->register_endpoint(fun, endpoint,
+	const errno_t ret = usb_iface->register_endpoint(fun, endpoint,
 	    transfer_type, direction, max_packet_size, packets, interval);
 
@@ -454,5 +454,5 @@
 	usb_direction_t direction = (usb_direction_t) DEV_IPC_GET_ARG2(*call);
 
-	int rc = usb_iface->unregister_endpoint(fun, endpoint, direction);
+	errno_t rc = usb_iface->unregister_endpoint(fun, endpoint, direction);
 
 	async_answer_0(callid, rc);
@@ -491,5 +491,5 @@
 }
 
-static void callback_out(int outcome, void *arg)
+static void callback_out(errno_t outcome, void *arg)
 {
 	async_transaction_t *trans = arg;
@@ -500,5 +500,5 @@
 }
 
-static void callback_in(int outcome, size_t actual_size, void *arg)
+static void callback_in(errno_t outcome, size_t actual_size, void *arg)
 {
 	async_transaction_t *trans = (async_transaction_t *)arg;
@@ -563,5 +563,5 @@
 	}
 
-	const int rc = usb_iface->read(
+	const errno_t rc = usb_iface->read(
 	    fun, ep, setup, trans->buffer, size, callback_in, trans);
 
@@ -601,5 +601,5 @@
 	size_t size = 0;
 	if (data_buffer_len > 0) {
-		const int rc = async_data_write_accept(&trans->buffer, false,
+		const errno_t rc = async_data_write_accept(&trans->buffer, false,
 		    1, data_buffer_len, 0, &size);
 
@@ -611,5 +611,5 @@
 	}
 
-	const int rc = usb_iface->write(
+	const errno_t rc = usb_iface->write(
 	    fun, ep, setup, trans->buffer, size, callback_out, trans);
 
Index: uspace/lib/drv/generic/remote_usbhc.c
===================================================================
--- uspace/lib/drv/generic/remote_usbhc.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_usbhc.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -96,5 +96,5 @@
 } usbhc_iface_funcs_t;
 
-int usbhc_read(async_exch_t *exch, usb_address_t address,
+errno_t usbhc_read(async_exch_t *exch, usb_address_t address,
     usb_endpoint_t endpoint, uint64_t setup, void *data, size_t size,
     size_t *rec_size)
@@ -131,6 +131,6 @@
 
 	/* Wait for the answer. */
-	int data_request_rc;
-	int opening_request_rc;
+	errno_t data_request_rc;
+	errno_t opening_request_rc;
 	async_wait_for(data_request, &data_request_rc);
 	async_wait_for(opening_request, &opening_request_rc);
@@ -139,11 +139,11 @@
 		/* Prefer the return code of the opening request. */
 		if (opening_request_rc != EOK) {
-			return (int) opening_request_rc;
+			return (errno_t) opening_request_rc;
 		} else {
-			return (int) data_request_rc;
+			return (errno_t) data_request_rc;
 		}
 	}
 	if (opening_request_rc != EOK) {
-		return (int) opening_request_rc;
+		return (errno_t) opening_request_rc;
 	}
 
@@ -152,5 +152,5 @@
 }
 
-int usbhc_write(async_exch_t *exch, usb_address_t address,
+errno_t usbhc_write(async_exch_t *exch, usb_address_t address,
     usb_endpoint_t endpoint, uint64_t setup, const void *data, size_t size)
 {
@@ -174,5 +174,5 @@
 	/* Send the data if any. */
 	if (size > 0) {
-		const int ret = async_data_write_start(exch, data, size);
+		const errno_t ret = async_data_write_start(exch, data, size);
 		if (ret != EOK) {
 			async_forget(opening_request);
@@ -182,8 +182,8 @@
 
 	/* Wait for the answer. */
-	int opening_request_rc;
+	errno_t opening_request_rc;
 	async_wait_for(opening_request, &opening_request_rc);
 
-	return (int) opening_request_rc;
+	return (errno_t) opening_request_rc;
 }
 
@@ -235,5 +235,5 @@
 }
 
-static void callback_out(int outcome, void *arg)
+static void callback_out(errno_t outcome, void *arg)
 {
 	async_transaction_t *trans = arg;
@@ -244,5 +244,5 @@
 }
 
-static void callback_in(int outcome, size_t actual_size, void *arg)
+static void callback_in(errno_t outcome, size_t actual_size, void *arg)
 {
 	async_transaction_t *trans = (async_transaction_t *)arg;
@@ -306,5 +306,5 @@
 	}
 
-	const int rc = hc_iface->read(
+	const errno_t rc = hc_iface->read(
 	    fun, target, setup, trans->buffer, size, callback_in, trans);
 
@@ -344,5 +344,5 @@
 	size_t size = 0;
 	if (data_buffer_len > 0) {
-		const int rc = async_data_write_accept(&trans->buffer, false,
+		const errno_t rc = async_data_write_accept(&trans->buffer, false,
 		    1, USB_MAX_PAYLOAD_SIZE,
 		    0, &size);
@@ -355,5 +355,5 @@
 	}
 
-	const int rc = hc_iface->write(
+	const errno_t rc = hc_iface->write(
 	    fun, target, setup, trans->buffer, size, callback_out, trans);
 
Index: uspace/lib/drv/generic/remote_usbhid.c
===================================================================
--- uspace/lib/drv/generic/remote_usbhid.c	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/generic/remote_usbhid.c	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -97,5 +97,5 @@
  *
  */
-int usbhid_dev_get_event_length(async_sess_t *dev_sess, size_t *size)
+errno_t usbhid_dev_get_event_length(async_sess_t *dev_sess, size_t *size)
 {
 	if (!dev_sess)
@@ -105,5 +105,5 @@
 	
 	sysarg_t len;
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
+	errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
 	    IPC_M_USBHID_GET_EVENT_LENGTH, &len);
 	
@@ -132,5 +132,5 @@
  *
  */
-int usbhid_dev_get_event(async_sess_t *dev_sess, uint8_t *buf,
+errno_t usbhid_dev_get_event(async_sess_t *dev_sess, uint8_t *buf,
     size_t size, size_t *actual_size, int *event_nr, unsigned int flags)
 {
@@ -174,6 +174,6 @@
 	}
 	
-	int data_request_rc;
-	int opening_request_rc;
+	errno_t data_request_rc;
+	errno_t opening_request_rc;
 	async_wait_for(data_request, &data_request_rc);
 	async_wait_for(opening_request, &opening_request_rc);
@@ -182,11 +182,11 @@
 		/* Prefer return code of the opening request. */
 		if (opening_request_rc != EOK)
-			return (int) opening_request_rc;
+			return (errno_t) opening_request_rc;
 		else
-			return (int) data_request_rc;
+			return (errno_t) data_request_rc;
 	}
 	
 	if (opening_request_rc != EOK)
-		return (int) opening_request_rc;
+		return (errno_t) opening_request_rc;
 	
 	size_t act_size = IPC_GET_ARG2(data_request_call);
@@ -204,5 +204,5 @@
 }
 
-int usbhid_dev_get_report_descriptor_length(async_sess_t *dev_sess,
+errno_t usbhid_dev_get_report_descriptor_length(async_sess_t *dev_sess,
     size_t *size)
 {
@@ -213,5 +213,5 @@
 	
 	sysarg_t arg_size;
-	int rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
+	errno_t rc = async_req_1_1(exch, DEV_IFACE_ID(USBHID_DEV_IFACE),
 	    IPC_M_USBHID_GET_REPORT_DESCRIPTOR_LENGTH, &arg_size);
 	
@@ -226,5 +226,5 @@
 }
 
-int usbhid_dev_get_report_descriptor(async_sess_t *dev_sess, uint8_t *buf,
+errno_t usbhid_dev_get_report_descriptor(async_sess_t *dev_sess, uint8_t *buf,
     size_t size, size_t *actual_size)
 {
@@ -259,6 +259,6 @@
 	}
 	
-	int data_request_rc;
-	int opening_request_rc;
+	errno_t data_request_rc;
+	errno_t opening_request_rc;
 	async_wait_for(data_request, &data_request_rc);
 	async_wait_for(opening_request, &opening_request_rc);
@@ -267,11 +267,11 @@
 		/* Prefer return code of the opening request. */
 		if (opening_request_rc != EOK)
-			return (int) opening_request_rc;
+			return (errno_t) opening_request_rc;
 		else
-			return (int) data_request_rc;
+			return (errno_t) data_request_rc;
 	}
 	
 	if (opening_request_rc != EOK)
-		return (int) opening_request_rc;
+		return (errno_t) opening_request_rc;
 	
 	size_t act_size = IPC_GET_ARG2(data_request_call);
@@ -362,5 +362,5 @@
 	}
 
-	int rc;
+	errno_t rc;
 
 	uint8_t *data = malloc(len);
@@ -438,5 +438,5 @@
 
 	size_t act_len = 0;
-	int rc = hid_iface->get_report_descriptor(fun, descriptor, len,
+	errno_t rc = hid_iface->get_report_descriptor(fun, descriptor, len,
 	    &act_len);
 	if (act_len > len) {
Index: uspace/lib/drv/include/ahci_iface.h
===================================================================
--- uspace/lib/drv/include/ahci_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ahci_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -43,17 +43,17 @@
 extern async_sess_t* ahci_get_sess(devman_handle_t, char **);
 
-extern int ahci_get_sata_device_name(async_sess_t *, size_t, char *);
-extern int ahci_get_num_blocks(async_sess_t *, uint64_t *);
-extern int ahci_get_block_size(async_sess_t *, size_t *);
-extern int ahci_read_blocks(async_sess_t *, uint64_t, size_t, void *);
-extern int ahci_write_blocks(async_sess_t *, uint64_t, size_t, void *);
+extern errno_t ahci_get_sata_device_name(async_sess_t *, size_t, char *);
+extern errno_t ahci_get_num_blocks(async_sess_t *, uint64_t *);
+extern errno_t ahci_get_block_size(async_sess_t *, size_t *);
+extern errno_t ahci_read_blocks(async_sess_t *, uint64_t, size_t, void *);
+extern errno_t ahci_write_blocks(async_sess_t *, uint64_t, size_t, void *);
 
 /** AHCI device communication interface. */
 typedef struct {
-	int (*get_sata_device_name)(ddf_fun_t *, size_t, char *);
-	int (*get_num_blocks)(ddf_fun_t *, uint64_t *);
-	int (*get_block_size)(ddf_fun_t *, size_t *);
-	int (*read_blocks)(ddf_fun_t *, uint64_t, size_t, void *);
-	int (*write_blocks)(ddf_fun_t *, uint64_t, size_t, void *);
+	errno_t (*get_sata_device_name)(ddf_fun_t *, size_t, char *);
+	errno_t (*get_num_blocks)(ddf_fun_t *, uint64_t *);
+	errno_t (*get_block_size)(ddf_fun_t *, size_t *);
+	errno_t (*read_blocks)(ddf_fun_t *, uint64_t, size_t, void *);
+	errno_t (*write_blocks)(ddf_fun_t *, uint64_t, size_t, void *);
 } ahci_iface_t;
 
Index: uspace/lib/drv/include/audio_mixer_iface.h
===================================================================
--- uspace/lib/drv/include/audio_mixer_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/audio_mixer_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -43,17 +43,17 @@
 #include "ddf/driver.h"
 
-int audio_mixer_get_info(async_exch_t *, const char **, unsigned *);
-int audio_mixer_get_item_info(async_exch_t *, unsigned,
+errno_t audio_mixer_get_info(async_exch_t *, const char **, unsigned *);
+errno_t audio_mixer_get_item_info(async_exch_t *, unsigned,
     const char **, unsigned *);
-int audio_mixer_get_item_level(async_exch_t *, unsigned, unsigned *);
-int audio_mixer_set_item_level(async_exch_t *, unsigned, unsigned);
+errno_t audio_mixer_get_item_level(async_exch_t *, unsigned, unsigned *);
+errno_t audio_mixer_set_item_level(async_exch_t *, unsigned, unsigned);
 
 
 /** Audio mixer communication interface. */
 typedef struct {
-	int (*get_info)(ddf_fun_t *, const char **, unsigned *);
-	int (*get_item_info)(ddf_fun_t *, unsigned, const char **, unsigned *);
-	int (*get_item_level)(ddf_fun_t *, unsigned, unsigned *);
-	int (*set_item_level)(ddf_fun_t *, unsigned, unsigned);
+	errno_t (*get_info)(ddf_fun_t *, const char **, unsigned *);
+	errno_t (*get_item_info)(ddf_fun_t *, unsigned, const char **, unsigned *);
+	errno_t (*get_item_level)(ddf_fun_t *, unsigned, unsigned *);
+	errno_t (*set_item_level)(ddf_fun_t *, unsigned, unsigned);
 } audio_mixer_iface_t;
 
Index: uspace/lib/drv/include/audio_pcm_iface.h
===================================================================
--- uspace/lib/drv/include/audio_pcm_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/audio_pcm_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -80,51 +80,51 @@
 void audio_pcm_close(audio_pcm_sess_t *);
 
-int audio_pcm_get_info_str(audio_pcm_sess_t *, const char **);
-int audio_pcm_test_format(audio_pcm_sess_t *, unsigned *, unsigned *,
+errno_t audio_pcm_get_info_str(audio_pcm_sess_t *, const char **);
+errno_t audio_pcm_test_format(audio_pcm_sess_t *, unsigned *, unsigned *,
     pcm_sample_format_t *);
-int audio_pcm_query_cap(audio_pcm_sess_t *, audio_cap_t, sysarg_t *);
-int audio_pcm_register_event_callback(audio_pcm_sess_t *,
+errno_t audio_pcm_query_cap(audio_pcm_sess_t *, audio_cap_t, sysarg_t *);
+errno_t audio_pcm_register_event_callback(audio_pcm_sess_t *,
     async_port_handler_t, void *);
-int audio_pcm_unregister_event_callback(audio_pcm_sess_t *);
+errno_t audio_pcm_unregister_event_callback(audio_pcm_sess_t *);
 
-int audio_pcm_get_buffer(audio_pcm_sess_t *, void **, size_t *);
-int audio_pcm_get_buffer_pos(audio_pcm_sess_t *, size_t *);
-int audio_pcm_release_buffer(audio_pcm_sess_t *);
+errno_t audio_pcm_get_buffer(audio_pcm_sess_t *, void **, size_t *);
+errno_t audio_pcm_get_buffer_pos(audio_pcm_sess_t *, size_t *);
+errno_t audio_pcm_release_buffer(audio_pcm_sess_t *);
 
-int audio_pcm_start_playback_fragment(audio_pcm_sess_t *, unsigned,
+errno_t audio_pcm_start_playback_fragment(audio_pcm_sess_t *, unsigned,
     unsigned, unsigned, pcm_sample_format_t);
-int audio_pcm_last_playback_fragment(audio_pcm_sess_t *);
+errno_t audio_pcm_last_playback_fragment(audio_pcm_sess_t *);
 
-int audio_pcm_start_playback(audio_pcm_sess_t *,
+errno_t audio_pcm_start_playback(audio_pcm_sess_t *,
     unsigned, unsigned, pcm_sample_format_t);
-int audio_pcm_stop_playback_immediate(audio_pcm_sess_t *);
-int audio_pcm_stop_playback(audio_pcm_sess_t *);
+errno_t audio_pcm_stop_playback_immediate(audio_pcm_sess_t *);
+errno_t audio_pcm_stop_playback(audio_pcm_sess_t *);
 
-int audio_pcm_start_capture_fragment(audio_pcm_sess_t *, unsigned,
+errno_t audio_pcm_start_capture_fragment(audio_pcm_sess_t *, unsigned,
     unsigned, unsigned, pcm_sample_format_t);
-int audio_pcm_last_capture_fragment(audio_pcm_sess_t *);
+errno_t audio_pcm_last_capture_fragment(audio_pcm_sess_t *);
 
-int audio_pcm_start_capture(audio_pcm_sess_t *,
+errno_t audio_pcm_start_capture(audio_pcm_sess_t *,
     unsigned, unsigned, pcm_sample_format_t);
-int audio_pcm_stop_capture_immediate(audio_pcm_sess_t *);
-int audio_pcm_stop_capture(audio_pcm_sess_t *);
+errno_t audio_pcm_stop_capture_immediate(audio_pcm_sess_t *);
+errno_t audio_pcm_stop_capture(audio_pcm_sess_t *);
 
 /** Audio pcm communication interface. */
 typedef struct {
-	int (*get_info_str)(ddf_fun_t *, const char **);
-	int (*test_format)(ddf_fun_t *, unsigned *, unsigned *,
+	errno_t (*get_info_str)(ddf_fun_t *, const char **);
+	errno_t (*test_format)(ddf_fun_t *, unsigned *, unsigned *,
 	    pcm_sample_format_t *);
 	unsigned (*query_cap)(ddf_fun_t *, audio_cap_t);
-	int (*get_buffer_pos)(ddf_fun_t *, size_t *);
-	int (*get_buffer)(ddf_fun_t *, void **, size_t *);
-	int (*release_buffer)(ddf_fun_t *);
-	int (*set_event_session)(ddf_fun_t *, async_sess_t *);
+	errno_t (*get_buffer_pos)(ddf_fun_t *, size_t *);
+	errno_t (*get_buffer)(ddf_fun_t *, void **, size_t *);
+	errno_t (*release_buffer)(ddf_fun_t *);
+	errno_t (*set_event_session)(ddf_fun_t *, async_sess_t *);
 	async_sess_t * (*get_event_session)(ddf_fun_t *);
-	int (*start_playback)(ddf_fun_t *, unsigned,
+	errno_t (*start_playback)(ddf_fun_t *, unsigned,
 	    unsigned, unsigned, pcm_sample_format_t);
-	int (*stop_playback)(ddf_fun_t *, bool);
-	int (*start_capture)(ddf_fun_t *, unsigned,
+	errno_t (*stop_playback)(ddf_fun_t *, bool);
+	errno_t (*start_capture)(ddf_fun_t *, unsigned,
 	    unsigned, unsigned, pcm_sample_format_t);
-	int (*stop_capture)(ddf_fun_t *, bool);
+	errno_t (*stop_capture)(ddf_fun_t *, bool);
 } audio_pcm_iface_t;
 
Index: uspace/lib/drv/include/battery_iface.h
===================================================================
--- uspace/lib/drv/include/battery_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/battery_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -49,6 +49,6 @@
 } battery_dev_method_t;
 
-extern int battery_status_get(async_sess_t *, battery_status_t *);
-extern int battery_charge_level_get(async_sess_t *, int *);
+extern errno_t battery_status_get(async_sess_t *, battery_status_t *);
+extern errno_t battery_charge_level_get(async_sess_t *, int *);
 
 #endif
Index: uspace/lib/drv/include/ddf/driver.h
===================================================================
--- uspace/lib/drv/include/ddf/driver.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ddf/driver.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -56,5 +56,5 @@
 	 * device.
 	 */
-	int (*open)(ddf_fun_t *);
+	errno_t (*open)(ddf_fun_t *);
 	
 	/**
@@ -88,17 +88,17 @@
 typedef struct driver_ops {
 	/** Callback method for passing a new device to the device driver */
-	int (*dev_add)(ddf_dev_t *);
+	errno_t (*dev_add)(ddf_dev_t *);
 	
 	/** Ask driver to remove a device */
-	int (*dev_remove)(ddf_dev_t *);
+	errno_t (*dev_remove)(ddf_dev_t *);
 	
 	/** Inform driver a device disappeared */
-	int (*dev_gone)(ddf_dev_t *);
+	errno_t (*dev_gone)(ddf_dev_t *);
 	
 	/** Ask driver to online a specific function */
-	int (*fun_online)(ddf_fun_t *);
+	errno_t (*fun_online)(ddf_fun_t *);
 	
 	/** Ask driver to offline a specific function */
-	int (*fun_offline)(ddf_fun_t *);
+	errno_t (*fun_offline)(ddf_fun_t *);
 } driver_ops_t;
 
@@ -124,14 +124,14 @@
 extern void *ddf_fun_data_get(ddf_fun_t *);
 extern const char *ddf_fun_get_name(ddf_fun_t *);
-extern int ddf_fun_set_name(ddf_fun_t *, const char *);
+extern errno_t ddf_fun_set_name(ddf_fun_t *, const char *);
 extern ddf_dev_t *ddf_fun_get_dev(ddf_fun_t *);
-extern int ddf_fun_bind(ddf_fun_t *);
-extern int ddf_fun_unbind(ddf_fun_t *);
-extern int ddf_fun_online(ddf_fun_t *);
-extern int ddf_fun_offline(ddf_fun_t *);
-extern int ddf_fun_add_match_id(ddf_fun_t *, const char *, int);
+extern errno_t ddf_fun_bind(ddf_fun_t *);
+extern errno_t ddf_fun_unbind(ddf_fun_t *);
+extern errno_t ddf_fun_online(ddf_fun_t *);
+extern errno_t ddf_fun_offline(ddf_fun_t *);
+extern errno_t ddf_fun_add_match_id(ddf_fun_t *, const char *, int);
 extern void ddf_fun_set_ops(ddf_fun_t *, const ddf_dev_ops_t *);
 extern void ddf_fun_set_conn_handler(ddf_fun_t *, async_port_handler_t);
-extern int ddf_fun_add_to_category(ddf_fun_t *, const char *);
+extern errno_t ddf_fun_add_to_category(ddf_fun_t *, const char *);
 
 #endif
Index: uspace/lib/drv/include/ddf/interrupt.h
===================================================================
--- uspace/lib/drv/include/ddf/interrupt.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ddf/interrupt.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -50,7 +50,7 @@
 typedef void interrupt_handler_t(ipc_call_t *, ddf_dev_t *);
 
-extern int register_interrupt_handler(ddf_dev_t *, int, interrupt_handler_t *,
+extern errno_t register_interrupt_handler(ddf_dev_t *, int, interrupt_handler_t *,
     const irq_code_t *, cap_handle_t *);
-extern int unregister_interrupt_handler(ddf_dev_t *, cap_handle_t);
+extern errno_t unregister_interrupt_handler(ddf_dev_t *, cap_handle_t);
 
 #endif
Index: uspace/lib/drv/include/ddf/log.h
===================================================================
--- uspace/lib/drv/include/ddf/log.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ddf/log.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -37,5 +37,5 @@
 #include <io/verify.h>
 
-extern int ddf_log_init(const char *);
+extern errno_t ddf_log_init(const char *);
 extern void ddf_msg(log_level_t, const char *, ...)
     PRINTF_ATTRIBUTE(2, 3);
Index: uspace/lib/drv/include/ieee80211_iface.h
===================================================================
--- uspace/lib/drv/include/ieee80211_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ieee80211_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -39,8 +39,8 @@
 #include <async.h>
 
-extern int ieee80211_get_scan_results(async_sess_t *,
+extern errno_t ieee80211_get_scan_results(async_sess_t *,
     ieee80211_scan_results_t *, bool);
-extern int ieee80211_connect(async_sess_t *, char *, char *);
-extern int ieee80211_disconnect(async_sess_t *);
+extern errno_t ieee80211_connect(async_sess_t *, char *, char *);
+extern errno_t ieee80211_disconnect(async_sess_t *);
 
 #endif
Index: uspace/lib/drv/include/nic_iface.h
===================================================================
--- uspace/lib/drv/include/nic_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/nic_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -47,67 +47,67 @@
 } nic_event_t;
 
-extern int nic_send_frame(async_sess_t *, void *, size_t);
-extern int nic_callback_create(async_sess_t *, async_port_handler_t, void *);
-extern int nic_get_state(async_sess_t *, nic_device_state_t *);
-extern int nic_set_state(async_sess_t *, nic_device_state_t);
-extern int nic_get_address(async_sess_t *, nic_address_t *);
-extern int nic_set_address(async_sess_t *, const nic_address_t *);
-extern int nic_get_stats(async_sess_t *, nic_device_stats_t *);
-extern int nic_get_device_info(async_sess_t *, nic_device_info_t *);
-extern int nic_get_cable_state(async_sess_t *, nic_cable_state_t *);
+extern errno_t nic_send_frame(async_sess_t *, void *, size_t);
+extern errno_t nic_callback_create(async_sess_t *, async_port_handler_t, void *);
+extern errno_t nic_get_state(async_sess_t *, nic_device_state_t *);
+extern errno_t nic_set_state(async_sess_t *, nic_device_state_t);
+extern errno_t nic_get_address(async_sess_t *, nic_address_t *);
+extern errno_t nic_set_address(async_sess_t *, const nic_address_t *);
+extern errno_t nic_get_stats(async_sess_t *, nic_device_stats_t *);
+extern errno_t nic_get_device_info(async_sess_t *, nic_device_info_t *);
+extern errno_t nic_get_cable_state(async_sess_t *, nic_cable_state_t *);
 
-extern int nic_get_operation_mode(async_sess_t *, int *, nic_channel_mode_t *,
+extern errno_t nic_get_operation_mode(async_sess_t *, int *, nic_channel_mode_t *,
     nic_role_t *);
-extern int nic_set_operation_mode(async_sess_t *, int, nic_channel_mode_t,
+extern errno_t nic_set_operation_mode(async_sess_t *, int, nic_channel_mode_t,
     nic_role_t);
-extern int nic_autoneg_enable(async_sess_t *, uint32_t);
-extern int nic_autoneg_disable(async_sess_t *);
-extern int nic_autoneg_probe(async_sess_t *, uint32_t *, uint32_t *,
+extern errno_t nic_autoneg_enable(async_sess_t *, uint32_t);
+extern errno_t nic_autoneg_disable(async_sess_t *);
+extern errno_t nic_autoneg_probe(async_sess_t *, uint32_t *, uint32_t *,
     nic_result_t *, nic_result_t *);
-extern int nic_autoneg_restart(async_sess_t *);
-extern int nic_get_pause(async_sess_t *, nic_result_t *, nic_result_t *,
+extern errno_t nic_autoneg_restart(async_sess_t *);
+extern errno_t nic_get_pause(async_sess_t *, nic_result_t *, nic_result_t *,
     uint16_t *);
-extern int nic_set_pause(async_sess_t *, int, int, uint16_t);
+extern errno_t nic_set_pause(async_sess_t *, int, int, uint16_t);
 
-extern int nic_unicast_get_mode(async_sess_t *, nic_unicast_mode_t *, size_t,
+extern errno_t nic_unicast_get_mode(async_sess_t *, nic_unicast_mode_t *, size_t,
     nic_address_t *, size_t *);
-extern int nic_unicast_set_mode(async_sess_t *, nic_unicast_mode_t,
+extern errno_t nic_unicast_set_mode(async_sess_t *, nic_unicast_mode_t,
     const nic_address_t *, size_t);
-extern int nic_multicast_get_mode(async_sess_t *, nic_multicast_mode_t *,
+extern errno_t nic_multicast_get_mode(async_sess_t *, nic_multicast_mode_t *,
     size_t, nic_address_t *, size_t *);
-extern int nic_multicast_set_mode(async_sess_t *, nic_multicast_mode_t,
+extern errno_t nic_multicast_set_mode(async_sess_t *, nic_multicast_mode_t,
     const nic_address_t *, size_t);
-extern int nic_broadcast_get_mode(async_sess_t *, nic_broadcast_mode_t *);
-extern int nic_broadcast_set_mode(async_sess_t *, nic_broadcast_mode_t);
-extern int nic_defective_get_mode(async_sess_t *, uint32_t *);
-extern int nic_defective_set_mode(async_sess_t *, uint32_t);
-extern int nic_blocked_sources_get(async_sess_t *, size_t, nic_address_t *,
+extern errno_t nic_broadcast_get_mode(async_sess_t *, nic_broadcast_mode_t *);
+extern errno_t nic_broadcast_set_mode(async_sess_t *, nic_broadcast_mode_t);
+extern errno_t nic_defective_get_mode(async_sess_t *, uint32_t *);
+extern errno_t nic_defective_set_mode(async_sess_t *, uint32_t);
+extern errno_t nic_blocked_sources_get(async_sess_t *, size_t, nic_address_t *,
     size_t *);
-extern int nic_blocked_sources_set(async_sess_t *, const nic_address_t *,
+extern errno_t nic_blocked_sources_set(async_sess_t *, const nic_address_t *,
     size_t);
 
-extern int nic_vlan_get_mask(async_sess_t *, nic_vlan_mask_t *);
-extern int nic_vlan_set_mask(async_sess_t *, const nic_vlan_mask_t *);
-extern int nic_vlan_set_tag(async_sess_t *, uint16_t, bool, bool);
+extern errno_t nic_vlan_get_mask(async_sess_t *, nic_vlan_mask_t *);
+extern errno_t nic_vlan_set_mask(async_sess_t *, const nic_vlan_mask_t *);
+extern errno_t nic_vlan_set_tag(async_sess_t *, uint16_t, bool, bool);
 
-extern int nic_wol_virtue_add(async_sess_t *, nic_wv_type_t, const void *,
+extern errno_t nic_wol_virtue_add(async_sess_t *, nic_wv_type_t, const void *,
     size_t, nic_wv_id_t *);
-extern int nic_wol_virtue_remove(async_sess_t *, nic_wv_id_t);
-extern int nic_wol_virtue_probe(async_sess_t *, nic_wv_id_t, nic_wv_type_t *,
+extern errno_t nic_wol_virtue_remove(async_sess_t *, nic_wv_id_t);
+extern errno_t nic_wol_virtue_probe(async_sess_t *, nic_wv_id_t, nic_wv_type_t *,
     size_t, void *, size_t *);
-extern int nic_wol_virtue_list(async_sess_t *, nic_wv_type_t, size_t,
+extern errno_t nic_wol_virtue_list(async_sess_t *, nic_wv_type_t, size_t,
     nic_wv_id_t *, size_t *);
-extern int nic_wol_virtue_get_caps(async_sess_t *, nic_wv_type_t, int *);
-extern int nic_wol_load_info(async_sess_t *, nic_wv_type_t *, size_t, uint8_t *,
+extern errno_t nic_wol_virtue_get_caps(async_sess_t *, nic_wv_type_t, int *);
+extern errno_t nic_wol_load_info(async_sess_t *, nic_wv_type_t *, size_t, uint8_t *,
     size_t *);
 
-extern int nic_offload_probe(async_sess_t *, uint32_t *, uint32_t *);
-extern int nic_offload_set(async_sess_t *, uint32_t, uint32_t);
+extern errno_t nic_offload_probe(async_sess_t *, uint32_t *, uint32_t *);
+extern errno_t nic_offload_set(async_sess_t *, uint32_t, uint32_t);
 
-extern int nic_poll_get_mode(async_sess_t *, nic_poll_mode_t *,
+extern errno_t nic_poll_get_mode(async_sess_t *, nic_poll_mode_t *,
     struct timeval *);
-extern int nic_poll_set_mode(async_sess_t *, nic_poll_mode_t,
+extern errno_t nic_poll_set_mode(async_sess_t *, nic_poll_mode_t,
     const struct timeval *);
-extern int nic_poll_now(async_sess_t *);
+extern errno_t nic_poll_now(async_sess_t *);
 
 #endif
Index: uspace/lib/drv/include/ops/battery_dev.h
===================================================================
--- uspace/lib/drv/include/ops/battery_dev.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ops/battery_dev.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -40,6 +40,6 @@
 
 typedef struct {
-	int (*battery_status_get)(ddf_fun_t *, battery_status_t *);
-	int (*battery_charge_level_get)(ddf_fun_t *, int *);
+	errno_t (*battery_status_get)(ddf_fun_t *, battery_status_t *);
+	errno_t (*battery_charge_level_get)(ddf_fun_t *, int *);
 } battery_dev_ops_t;
 
Index: uspace/lib/drv/include/ops/clock_dev.h
===================================================================
--- uspace/lib/drv/include/ops/clock_dev.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ops/clock_dev.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -40,6 +40,6 @@
 
 typedef struct {
-	int (*time_get)(ddf_fun_t *, struct tm *);
-	int (*time_set)(ddf_fun_t *, struct tm *);
+	errno_t (*time_get)(ddf_fun_t *, struct tm *);
+	errno_t (*time_set)(ddf_fun_t *, struct tm *);
 } clock_dev_ops_t;
 
Index: uspace/lib/drv/include/ops/hw_res.h
===================================================================
--- uspace/lib/drv/include/ops/hw_res.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ops/hw_res.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -44,9 +44,9 @@
 typedef struct {
 	hw_resource_list_t *(*get_resource_list)(ddf_fun_t *);
-	int (*enable_interrupt)(ddf_fun_t *, int);
-	int (*disable_interrupt)(ddf_fun_t *, int);
-	int (*clear_interrupt)(ddf_fun_t *, int);
-	int (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint32_t, uint8_t);
-	int (*dma_channel_remain)(ddf_fun_t *, unsigned, size_t *);
+	errno_t (*enable_interrupt)(ddf_fun_t *, int);
+	errno_t (*disable_interrupt)(ddf_fun_t *, int);
+	errno_t (*clear_interrupt)(ddf_fun_t *, int);
+	errno_t (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint32_t, uint8_t);
+	errno_t (*dma_channel_remain)(ddf_fun_t *, unsigned, size_t *);
 } hw_res_ops_t;
 
Index: uspace/lib/drv/include/ops/ieee80211.h
===================================================================
--- uspace/lib/drv/include/ops/ieee80211.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ops/ieee80211.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -51,5 +51,5 @@
 	 *
 	 */
-	int (*get_scan_results)(ddf_fun_t *, ieee80211_scan_results_t *, bool);
+	errno_t (*get_scan_results)(ddf_fun_t *, ieee80211_scan_results_t *, bool);
 	
 	/** Connect IEEE 802.11 device to specified network.
@@ -62,5 +62,5 @@
 	 *
 	 */
-	int (*connect)(ddf_fun_t *, char *, char *);
+	errno_t (*connect)(ddf_fun_t *, char *, char *);
 	
 	/** Disconnect IEEE 802.11 device from network.
@@ -71,5 +71,5 @@
 	 *
 	 */
-	int (*disconnect)(ddf_fun_t *);
+	errno_t (*disconnect)(ddf_fun_t *);
 } ieee80211_iface_t;
 
Index: uspace/lib/drv/include/ops/led_dev.h
===================================================================
--- uspace/lib/drv/include/ops/led_dev.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ops/led_dev.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -40,5 +40,5 @@
 
 typedef struct {
-	int (*color_set)(ddf_fun_t *, pixel_t);
+	errno_t (*color_set)(ddf_fun_t *, pixel_t);
 } led_dev_ops_t;
 
Index: uspace/lib/drv/include/ops/nic.h
===================================================================
--- uspace/lib/drv/include/ops/nic.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/ops/nic.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -44,68 +44,68 @@
 typedef struct nic_iface {
 	/** Mandatory methods */
-	int (*send_frame)(ddf_fun_t *, void *, size_t);
-	int (*callback_create)(ddf_fun_t *);
-	int (*get_state)(ddf_fun_t *, nic_device_state_t *);
-	int (*set_state)(ddf_fun_t *, nic_device_state_t);
-	int (*get_address)(ddf_fun_t *, nic_address_t *);
+	errno_t (*send_frame)(ddf_fun_t *, void *, size_t);
+	errno_t (*callback_create)(ddf_fun_t *);
+	errno_t (*get_state)(ddf_fun_t *, nic_device_state_t *);
+	errno_t (*set_state)(ddf_fun_t *, nic_device_state_t);
+	errno_t (*get_address)(ddf_fun_t *, nic_address_t *);
 	
 	/** Optional methods */
-	int (*set_address)(ddf_fun_t *, const nic_address_t *);
-	int (*get_stats)(ddf_fun_t *, nic_device_stats_t *);
-	int (*get_device_info)(ddf_fun_t *, nic_device_info_t *);
-	int (*get_cable_state)(ddf_fun_t *, nic_cable_state_t *);
+	errno_t (*set_address)(ddf_fun_t *, const nic_address_t *);
+	errno_t (*get_stats)(ddf_fun_t *, nic_device_stats_t *);
+	errno_t (*get_device_info)(ddf_fun_t *, nic_device_info_t *);
+	errno_t (*get_cable_state)(ddf_fun_t *, nic_cable_state_t *);
 	
-	int (*get_operation_mode)(ddf_fun_t *, int *, nic_channel_mode_t *,
+	errno_t (*get_operation_mode)(ddf_fun_t *, int *, nic_channel_mode_t *,
 	    nic_role_t *);
-	int (*set_operation_mode)(ddf_fun_t *, int, nic_channel_mode_t,
+	errno_t (*set_operation_mode)(ddf_fun_t *, int, nic_channel_mode_t,
 	    nic_role_t);
-	int (*autoneg_enable)(ddf_fun_t *, uint32_t);
-	int (*autoneg_disable)(ddf_fun_t *);
-	int (*autoneg_probe)(ddf_fun_t *, uint32_t *, uint32_t *,
+	errno_t (*autoneg_enable)(ddf_fun_t *, uint32_t);
+	errno_t (*autoneg_disable)(ddf_fun_t *);
+	errno_t (*autoneg_probe)(ddf_fun_t *, uint32_t *, uint32_t *,
 	    nic_result_t *, nic_result_t *);
-	int (*autoneg_restart)(ddf_fun_t *);
-	int (*get_pause)(ddf_fun_t *, nic_result_t *, nic_result_t *,
+	errno_t (*autoneg_restart)(ddf_fun_t *);
+	errno_t (*get_pause)(ddf_fun_t *, nic_result_t *, nic_result_t *,
 		uint16_t *);
-	int (*set_pause)(ddf_fun_t *, int, int, uint16_t);
+	errno_t (*set_pause)(ddf_fun_t *, int, int, uint16_t);
 	
-	int (*unicast_get_mode)(ddf_fun_t *, nic_unicast_mode_t *, size_t,
+	errno_t (*unicast_get_mode)(ddf_fun_t *, nic_unicast_mode_t *, size_t,
 	    nic_address_t *, size_t *);
-	int (*unicast_set_mode)(ddf_fun_t *, nic_unicast_mode_t,
+	errno_t (*unicast_set_mode)(ddf_fun_t *, nic_unicast_mode_t,
 	    const nic_address_t *, size_t);
-	int (*multicast_get_mode)(ddf_fun_t *, nic_multicast_mode_t *, size_t,
+	errno_t (*multicast_get_mode)(ddf_fun_t *, nic_multicast_mode_t *, size_t,
 	    nic_address_t *, size_t *);
-	int (*multicast_set_mode)(ddf_fun_t *, nic_multicast_mode_t,
+	errno_t (*multicast_set_mode)(ddf_fun_t *, nic_multicast_mode_t,
 	    const nic_address_t *, size_t);
-	int (*broadcast_get_mode)(ddf_fun_t *, nic_broadcast_mode_t *);
-	int (*broadcast_set_mode)(ddf_fun_t *, nic_broadcast_mode_t);
-	int (*defective_get_mode)(ddf_fun_t *, uint32_t *);
-	int (*defective_set_mode)(ddf_fun_t *, uint32_t);
-	int (*blocked_sources_get)(ddf_fun_t *, size_t, nic_address_t *,
+	errno_t (*broadcast_get_mode)(ddf_fun_t *, nic_broadcast_mode_t *);
+	errno_t (*broadcast_set_mode)(ddf_fun_t *, nic_broadcast_mode_t);
+	errno_t (*defective_get_mode)(ddf_fun_t *, uint32_t *);
+	errno_t (*defective_set_mode)(ddf_fun_t *, uint32_t);
+	errno_t (*blocked_sources_get)(ddf_fun_t *, size_t, nic_address_t *,
 	    size_t *);
-	int (*blocked_sources_set)(ddf_fun_t *, const nic_address_t *, size_t);
+	errno_t (*blocked_sources_set)(ddf_fun_t *, const nic_address_t *, size_t);
 	
-	int (*vlan_get_mask)(ddf_fun_t *, nic_vlan_mask_t *);
-	int (*vlan_set_mask)(ddf_fun_t *, const nic_vlan_mask_t *);
-	int (*vlan_set_tag)(ddf_fun_t *, uint16_t, bool, bool);
+	errno_t (*vlan_get_mask)(ddf_fun_t *, nic_vlan_mask_t *);
+	errno_t (*vlan_set_mask)(ddf_fun_t *, const nic_vlan_mask_t *);
+	errno_t (*vlan_set_tag)(ddf_fun_t *, uint16_t, bool, bool);
 	
-	int (*wol_virtue_add)(ddf_fun_t *, nic_wv_type_t, const void *,
+	errno_t (*wol_virtue_add)(ddf_fun_t *, nic_wv_type_t, const void *,
 	    size_t, nic_wv_id_t *);
-	int (*wol_virtue_remove)(ddf_fun_t *, nic_wv_id_t);
-	int (*wol_virtue_probe)(ddf_fun_t *, nic_wv_id_t, nic_wv_type_t *,
+	errno_t (*wol_virtue_remove)(ddf_fun_t *, nic_wv_id_t);
+	errno_t (*wol_virtue_probe)(ddf_fun_t *, nic_wv_id_t, nic_wv_type_t *,
 	    size_t, void *, size_t *);
-	int (*wol_virtue_list)(ddf_fun_t *, nic_wv_type_t, size_t,
+	errno_t (*wol_virtue_list)(ddf_fun_t *, nic_wv_type_t, size_t,
 	    nic_wv_id_t *, size_t *);
-	int (*wol_virtue_get_caps)(ddf_fun_t *, nic_wv_type_t, int *);
-	int (*wol_load_info)(ddf_fun_t *, nic_wv_type_t *, size_t,
+	errno_t (*wol_virtue_get_caps)(ddf_fun_t *, nic_wv_type_t, int *);
+	errno_t (*wol_load_info)(ddf_fun_t *, nic_wv_type_t *, size_t,
 	    uint8_t *, size_t *);
 	
-	int (*offload_probe)(ddf_fun_t *, uint32_t *, uint32_t *);
-	int (*offload_set)(ddf_fun_t *, uint32_t, uint32_t);
+	errno_t (*offload_probe)(ddf_fun_t *, uint32_t *, uint32_t *);
+	errno_t (*offload_set)(ddf_fun_t *, uint32_t, uint32_t);
 	
-	int (*poll_get_mode)(ddf_fun_t *, nic_poll_mode_t *,
+	errno_t (*poll_get_mode)(ddf_fun_t *, nic_poll_mode_t *,
 	    struct timeval *);
-	int (*poll_set_mode)(ddf_fun_t *, nic_poll_mode_t,
+	errno_t (*poll_set_mode)(ddf_fun_t *, nic_poll_mode_t,
 	    const struct timeval *);
-	int (*poll_now)(ddf_fun_t *);
+	errno_t (*poll_now)(ddf_fun_t *);
 } nic_iface_t;
 
Index: uspace/lib/drv/include/pci_dev_iface.h
===================================================================
--- uspace/lib/drv/include/pci_dev_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/pci_dev_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -45,21 +45,21 @@
 #define PCI_BASE_CLASS	0x0B
 
-extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *);
-extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *);
-extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *);
+extern errno_t pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *);
+extern errno_t pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *);
+extern errno_t pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *);
 
-extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t);
-extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t);
-extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t);
+extern errno_t pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t);
+extern errno_t pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t);
+extern errno_t pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t);
 
 /** PCI device communication interface. */
 typedef struct {
-	int (*config_space_read_8)(ddf_fun_t *, uint32_t address, uint8_t *data);
-	int (*config_space_read_16)(ddf_fun_t *, uint32_t address, uint16_t *data);
-	int (*config_space_read_32)(ddf_fun_t *, uint32_t address, uint32_t *data);
+	errno_t (*config_space_read_8)(ddf_fun_t *, uint32_t address, uint8_t *data);
+	errno_t (*config_space_read_16)(ddf_fun_t *, uint32_t address, uint16_t *data);
+	errno_t (*config_space_read_32)(ddf_fun_t *, uint32_t address, uint32_t *data);
 
-	int (*config_space_write_8)(ddf_fun_t *, uint32_t address, uint8_t data);
-	int (*config_space_write_16)(ddf_fun_t *, uint32_t address, uint16_t data);
-	int (*config_space_write_32)(ddf_fun_t *, uint32_t address, uint32_t data);
+	errno_t (*config_space_write_8)(ddf_fun_t *, uint32_t address, uint8_t data);
+	errno_t (*config_space_write_16)(ddf_fun_t *, uint32_t address, uint16_t data);
+	errno_t (*config_space_write_32)(ddf_fun_t *, uint32_t address, uint32_t data);
 } pci_dev_iface_t;
 
Index: uspace/lib/drv/include/usb_iface.h
===================================================================
--- uspace/lib/drv/include/usb_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/usb_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -95,47 +95,47 @@
 extern void usb_dev_disconnect(usb_dev_session_t *);
 
-extern int usb_get_my_interface(async_exch_t *, int *);
-extern int usb_get_my_device_handle(async_exch_t *, devman_handle_t *);
+extern errno_t usb_get_my_interface(async_exch_t *, int *);
+extern errno_t usb_get_my_device_handle(async_exch_t *, devman_handle_t *);
 
-extern int usb_reserve_default_address(async_exch_t *, usb_speed_t);
-extern int usb_release_default_address(async_exch_t *);
+extern errno_t usb_reserve_default_address(async_exch_t *, usb_speed_t);
+extern errno_t usb_release_default_address(async_exch_t *);
 
-extern int usb_device_enumerate(async_exch_t *, unsigned port);
-extern int usb_device_remove(async_exch_t *, unsigned port);
+extern errno_t usb_device_enumerate(async_exch_t *, unsigned port);
+extern errno_t usb_device_remove(async_exch_t *, unsigned port);
 
-extern int usb_register_endpoint(async_exch_t *, usb_endpoint_t,
+extern errno_t usb_register_endpoint(async_exch_t *, usb_endpoint_t,
     usb_transfer_type_t, usb_direction_t, size_t, unsigned, unsigned);
-extern int usb_unregister_endpoint(async_exch_t *, usb_endpoint_t,
+extern errno_t usb_unregister_endpoint(async_exch_t *, usb_endpoint_t,
     usb_direction_t);
-extern int usb_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t,
+extern errno_t usb_read(async_exch_t *, usb_endpoint_t, uint64_t, void *, size_t,
     size_t *);
-extern int usb_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *,
+extern errno_t usb_write(async_exch_t *, usb_endpoint_t, uint64_t, const void *,
     size_t);
 
 /** Callback for outgoing transfer. */
-typedef void (*usb_iface_transfer_out_callback_t)(int, void *);
+typedef void (*usb_iface_transfer_out_callback_t)(errno_t, void *);
 
 /** Callback for incoming transfer. */
-typedef void (*usb_iface_transfer_in_callback_t)(int, size_t, void *);
+typedef void (*usb_iface_transfer_in_callback_t)(errno_t, size_t, void *);
 
 /** USB device communication interface. */
 typedef struct {
-	int (*get_my_interface)(ddf_fun_t *, int *);
-	int (*get_my_device_handle)(ddf_fun_t *, devman_handle_t *);
+	errno_t (*get_my_interface)(ddf_fun_t *, int *);
+	errno_t (*get_my_device_handle)(ddf_fun_t *, devman_handle_t *);
 
-	int (*reserve_default_address)(ddf_fun_t *, usb_speed_t);
-	int (*release_default_address)(ddf_fun_t *);
+	errno_t (*reserve_default_address)(ddf_fun_t *, usb_speed_t);
+	errno_t (*release_default_address)(ddf_fun_t *);
 
-	int (*device_enumerate)(ddf_fun_t *, unsigned);
-	int (*device_remove)(ddf_fun_t *, unsigned);
+	errno_t (*device_enumerate)(ddf_fun_t *, unsigned);
+	errno_t (*device_remove)(ddf_fun_t *, unsigned);
 
-	int (*register_endpoint)(ddf_fun_t *, usb_endpoint_t,
+	errno_t (*register_endpoint)(ddf_fun_t *, usb_endpoint_t,
 	    usb_transfer_type_t, usb_direction_t, size_t, unsigned, unsigned);
-	int (*unregister_endpoint)(ddf_fun_t *, usb_endpoint_t,
+	errno_t (*unregister_endpoint)(ddf_fun_t *, usb_endpoint_t,
 	    usb_direction_t);
 
-	int (*read)(ddf_fun_t *, usb_endpoint_t, uint64_t, uint8_t *, size_t,
+	errno_t (*read)(ddf_fun_t *, usb_endpoint_t, uint64_t, uint8_t *, size_t,
 	    usb_iface_transfer_in_callback_t, void *);
-	int (*write)(ddf_fun_t *, usb_endpoint_t, uint64_t, const uint8_t *,
+	errno_t (*write)(ddf_fun_t *, usb_endpoint_t, uint64_t, const uint8_t *,
 	    size_t, usb_iface_transfer_out_callback_t, void *);
 } usb_iface_t;
Index: uspace/lib/drv/include/usbhc_iface.h
===================================================================
--- uspace/lib/drv/include/usbhc_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/usbhc_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -44,20 +44,20 @@
 #include <stdbool.h>
 
-extern int usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,
+extern errno_t usbhc_read(async_exch_t *, usb_address_t, usb_endpoint_t,
     uint64_t, void *, size_t, size_t *);
-extern int usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t,
+extern errno_t usbhc_write(async_exch_t *, usb_address_t, usb_endpoint_t,
     uint64_t, const void *, size_t);
 
 /** Callback for outgoing transfer. */
-typedef void (*usbhc_iface_transfer_out_callback_t)(int, void *);
+typedef void (*usbhc_iface_transfer_out_callback_t)(errno_t, void *);
 
 /** Callback for incoming transfer. */
-typedef void (*usbhc_iface_transfer_in_callback_t)(int, size_t, void *);
+typedef void (*usbhc_iface_transfer_in_callback_t)(errno_t, size_t, void *);
 
 /** USB host controller communication interface. */
 typedef struct {
-	int (*read)(ddf_fun_t *, usb_target_t, uint64_t, uint8_t *, size_t,
+	errno_t (*read)(ddf_fun_t *, usb_target_t, uint64_t, uint8_t *, size_t,
 	    usbhc_iface_transfer_in_callback_t, void *);
-	int (*write)(ddf_fun_t *, usb_target_t, uint64_t, const uint8_t *,
+	errno_t (*write)(ddf_fun_t *, usb_target_t, uint64_t, const uint8_t *,
 	    size_t, usbhc_iface_transfer_out_callback_t, void *);
 } usbhc_iface_t;
Index: uspace/lib/drv/include/usbhid_iface.h
===================================================================
--- uspace/lib/drv/include/usbhid_iface.h	(revision 84a1a546f62a2ba0f913f8f1bfce8d4bc68d7aa4)
+++ uspace/lib/drv/include/usbhid_iface.h	(revision 847844a5c1c6014e479cb00bf10c9d740927aa2d)
@@ -39,9 +39,9 @@
 #include "ddf/driver.h"
 
-extern int usbhid_dev_get_event_length(async_sess_t *, size_t *);
-extern int usbhid_dev_get_event(async_sess_t *, uint8_t *, size_t, size_t *,
+extern errno_t usbhid_dev_get_event_length(async_sess_t *, size_t *);
+extern errno_t usbhid_dev_get_event(async_sess_t *, uint8_t *, size_t, size_t *,
     int *, unsigned int);
-extern int usbhid_dev_get_report_descriptor_length(async_sess_t *, size_t *);
-extern int usbhid_dev_get_report_descriptor(async_sess_t *, uint8_t *, size_t,
+extern errno_t usbhid_dev_get_report_descriptor_length(async_sess_t *, size_t *);
+extern errno_t usbhid_dev_get_report_descriptor(async_sess_t *, uint8_t *, size_t,
     size_t *);
 
@@ -63,5 +63,5 @@
 	 * @return Error code.
 	 */
-	int (*get_event)(ddf_fun_t *fun, uint8_t *buffer, size_t size,
+	errno_t (*get_event)(ddf_fun_t *fun, uint8_t *buffer, size_t size,
 	    size_t *act_size, int *event_nr, unsigned int flags);
 	
@@ -81,5 +81,5 @@
 	 * @return Error code.
 	 */
-	int (*get_report_descriptor)(ddf_fun_t *fun, uint8_t *desc, 
+	errno_t (*get_report_descriptor)(ddf_fun_t *fun, uint8_t *desc, 
 	    size_t size, size_t *act_size);
 } usbhid_iface_t;
