Index: uspace/lib/bithenge/src/blob.c
===================================================================
--- uspace/lib/bithenge/src/blob.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/blob.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -49,5 +49,5 @@
  * @return EOK on success or an error code from errno.h.
  */
-int bithenge_init_random_access_blob(bithenge_blob_t *blob,
+errno_t bithenge_init_random_access_blob(bithenge_blob_t *blob,
     const bithenge_random_access_blob_ops_t *ops)
 {
@@ -67,5 +67,5 @@
 }
 
-static int sequential_buffer(bithenge_sequential_blob_t *blob, aoff64_t end)
+static errno_t sequential_buffer(bithenge_sequential_blob_t *blob, aoff64_t end)
 {
 	bool need_realloc = false;
@@ -81,5 +81,5 @@
 	}
 	aoff64_t size = end - blob->data_size;
-	int rc = blob->ops->read(blob, blob->buffer + blob->data_size, &size);
+	errno_t rc = blob->ops->read(blob, blob->buffer + blob->data_size, &size);
 	if (rc != EOK)
 		return rc;
@@ -100,8 +100,8 @@
 }
 
-static int sequential_size(bithenge_blob_t *base, aoff64_t *size)
+static errno_t sequential_size(bithenge_blob_t *base, aoff64_t *size)
 {
 	bithenge_sequential_blob_t *blob = blob_as_sequential(base);
-	int rc;
+	errno_t rc;
 	if (blob->ops->size) {
 		rc = blob->ops->size(blob, size);
@@ -121,5 +121,5 @@
 }
 
-static int sequential_read(bithenge_blob_t *base, aoff64_t offset,
+static errno_t sequential_read(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size)
 {
@@ -127,5 +127,5 @@
 	aoff64_t end = offset + *size;
 	if (end > blob->data_size) {
-		int rc = sequential_buffer(blob, end);
+		errno_t rc = sequential_buffer(blob, end);
 		if (rc != EOK)
 			return rc;
@@ -158,5 +158,5 @@
  * @return EOK on success or an error code from errno.h.
  */
-int bithenge_init_sequential_blob(bithenge_sequential_blob_t *blob,
+errno_t bithenge_init_sequential_blob(bithenge_sequential_blob_t *blob,
     const bithenge_sequential_blob_ops_t *ops)
 {
@@ -167,5 +167,5 @@
 	// ops->size is optional
 
-	int rc = bithenge_init_random_access_blob(sequential_as_blob(blob),
+	errno_t rc = bithenge_init_random_access_blob(sequential_as_blob(blob),
 	    &sequential_ops);
 	if (rc != EOK)
@@ -195,5 +195,5 @@
 }
 
-static int memory_size(bithenge_blob_t *base, aoff64_t *size)
+static errno_t memory_size(bithenge_blob_t *base, aoff64_t *size)
 {
 	memory_blob_t *blob = blob_as_memory(base);
@@ -204,5 +204,5 @@
 }
 
-static int memory_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
+static errno_t memory_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
     aoff64_t *size)
 {
@@ -240,8 +240,8 @@
  * function fails or the blob is destroyed.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_blob_from_buffer(bithenge_node_t **out, const void *buffer,
+errno_t bithenge_new_blob_from_buffer(bithenge_node_t **out, const void *buffer,
     size_t len, bool needs_free)
 {
-	int rc;
+	errno_t rc;
 	assert(buffer || !len);
 
@@ -278,5 +278,5 @@
  * @param len The length of the data.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_blob_from_data(bithenge_node_t **out, const void *data,
+errno_t bithenge_new_blob_from_data(bithenge_node_t **out, const void *data,
     size_t len)
 {
@@ -309,5 +309,5 @@
 }
 
-static int subblob_size(bithenge_blob_t *base, aoff64_t *size)
+static errno_t subblob_size(bithenge_blob_t *base, aoff64_t *size)
 {
 	subblob_t *blob = blob_as_subblob(base);
@@ -316,5 +316,5 @@
 		return EOK;
 	} else {
-		int rc = bithenge_blob_size(blob->source, size);
+		errno_t rc = bithenge_blob_size(blob->source, size);
 		*size -= blob->offset;
 		return rc;
@@ -322,5 +322,5 @@
 }
 
-static int subblob_read(bithenge_blob_t *base, aoff64_t offset,
+static errno_t subblob_read(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size)
 {
@@ -335,5 +335,5 @@
 }
 
-static int subblob_read_bits(bithenge_blob_t *base, aoff64_t offset,
+static errno_t subblob_read_bits(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size, bool little_endian)
 {
@@ -368,10 +368,10 @@
 }
 
-static int new_subblob(bithenge_node_t **out, bithenge_blob_t *source,
+static errno_t new_subblob(bithenge_node_t **out, bithenge_blob_t *source,
     aoff64_t offset, aoff64_t size, bool size_matters)
 {
 	assert(out);
 	assert(source);
-	int rc;
+	errno_t rc;
 	subblob_t *blob = 0;
 
@@ -436,5 +436,5 @@
  * @param offset The offset within the input blob at which the new blob will start.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_offset_blob(bithenge_node_t **out, bithenge_blob_t *source,
+errno_t bithenge_new_offset_blob(bithenge_node_t **out, bithenge_blob_t *source,
     aoff64_t offset)
 {
@@ -449,5 +449,5 @@
  * @param size The size of the new blob.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_subblob(bithenge_node_t **out, bithenge_blob_t *source,
+errno_t bithenge_new_subblob(bithenge_node_t **out, bithenge_blob_t *source,
     aoff64_t offset, aoff64_t size)
 {
@@ -461,5 +461,5 @@
  * @return EOK on success, or an error code from errno.h.
  */
-int bithenge_blob_equal(bool *out, bithenge_blob_t *a, bithenge_blob_t *b)
+errno_t bithenge_blob_equal(bool *out, bithenge_blob_t *a, bithenge_blob_t *b)
 {
 	assert(a);
@@ -467,5 +467,5 @@
 	assert(b);
 	assert(b->base.blob_ops);
-	int rc;
+	errno_t rc;
 	char buffer_a[4096], buffer_b[4096];
 	aoff64_t offset = 0, size_a = sizeof(buffer_a), size_b = sizeof(buffer_b);
Index: uspace/lib/bithenge/src/common.h
===================================================================
--- uspace/lib/bithenge/src/common.h	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/common.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -40,5 +40,5 @@
 #include "failure.h"
 #else
-static inline int bithenge_should_fail(void)
+static inline errno_t bithenge_should_fail(void)
 {
 	return 0;
Index: uspace/lib/bithenge/src/compound.c
===================================================================
--- uspace/lib/bithenge/src/compound.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/compound.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -62,8 +62,8 @@
 }
 
-static int compose_apply(bithenge_transform_t *base, bithenge_scope_t *scope,
+static errno_t compose_apply(bithenge_transform_t *base, bithenge_scope_t *scope,
     bithenge_node_t *in, bithenge_node_t **out)
 {
-	int rc;
+	errno_t rc;
 	compose_transform_t *self = transform_as_compose(base);
 	bithenge_node_inc_ref(in);
@@ -84,5 +84,5 @@
 }
 
-static int compose_prefix_length(bithenge_transform_t *base,
+static errno_t compose_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, aoff64_t *out)
 {
@@ -115,5 +115,5 @@
  * @param num The number of transforms.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_composed_transform(bithenge_transform_t **out,
+errno_t bithenge_new_composed_transform(bithenge_transform_t **out,
     bithenge_transform_t **xforms, size_t num)
 {
@@ -126,5 +126,5 @@
 	}
 
-	int rc;
+	errno_t rc;
 	compose_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -168,9 +168,9 @@
 }
 
-static int if_transform_choose(if_transform_t *self, bithenge_scope_t *scope,
+static errno_t if_transform_choose(if_transform_t *self, bithenge_scope_t *scope,
     bool *out)
 {
 	bithenge_node_t *cond_node;
-	int rc = bithenge_expression_evaluate(self->expr, scope, &cond_node);
+	errno_t rc = bithenge_expression_evaluate(self->expr, scope, &cond_node);
 	if (rc != EOK)
 		return rc;
@@ -184,10 +184,10 @@
 }
 
-static int if_transform_apply(bithenge_transform_t *base,
+static errno_t if_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
 	if_transform_t *self = transform_as_if(base);
 	bool cond;
-	int rc = if_transform_choose(self, scope, &cond);
+	errno_t rc = if_transform_choose(self, scope, &cond);
 	if (rc != EOK)
 		return rc;
@@ -196,10 +196,10 @@
 }
 
-static int if_transform_prefix_length(bithenge_transform_t *base,
+static errno_t if_transform_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *in, aoff64_t *out)
 {
 	if_transform_t *self = transform_as_if(base);
 	bool cond;
-	int rc = if_transform_choose(self, scope, &cond);
+	errno_t rc = if_transform_choose(self, scope, &cond);
 	if (rc != EOK)
 		return rc;
@@ -231,9 +231,9 @@
  * @param false_xform The transform to apply if the expression is false.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_if_transform(bithenge_transform_t **out,
+errno_t bithenge_if_transform(bithenge_transform_t **out,
     bithenge_expression_t *expr, bithenge_transform_t *true_xform,
     bithenge_transform_t *false_xform)
 {
-	int rc;
+	errno_t rc;
 	if_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -282,5 +282,5 @@
 }
 
-static int partial_transform_apply(bithenge_transform_t *base,
+static errno_t partial_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -309,8 +309,8 @@
  * @param xform The subtransform to apply.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_partial_transform(bithenge_transform_t **out,
+errno_t bithenge_partial_transform(bithenge_transform_t **out,
     bithenge_transform_t *xform)
 {
-	int rc;
+	errno_t rc;
 	partial_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
Index: uspace/lib/bithenge/src/expression.c
===================================================================
--- uspace/lib/bithenge/src/expression.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/expression.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -48,5 +48,5 @@
  * @param[in] ops Operations provided by the expression.
  * @return EOK or an error code from errno.h. */
-int bithenge_init_expression(bithenge_expression_t *self,
+errno_t bithenge_init_expression(bithenge_expression_t *self,
     const bithenge_expression_ops_t *ops)
 {
@@ -88,8 +88,8 @@
 }
 
-static int binary_expression_evaluate(bithenge_expression_t *base,
+static errno_t binary_expression_evaluate(bithenge_expression_t *base,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
-	int rc;
+	errno_t rc;
 	binary_expression_t *self = expression_as_binary(base);
 	bithenge_node_t *a, *b;
@@ -250,9 +250,9 @@
  * @param b The second operand.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_binary_expression(bithenge_expression_t **out,
+errno_t bithenge_binary_expression(bithenge_expression_t **out,
     bithenge_binary_op_t op, bithenge_expression_t *a,
     bithenge_expression_t *b)
 {
-	int rc;
+	errno_t rc;
 	binary_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -283,5 +283,5 @@
 /***************** in_node_expression                        *****************/
 
-static int in_node_evaluate(bithenge_expression_t *self,
+static errno_t in_node_evaluate(bithenge_expression_t *self,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -306,5 +306,5 @@
  * @param[out] out Holds the new expression.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_in_node_expression(bithenge_expression_t **out)
+errno_t bithenge_in_node_expression(bithenge_expression_t **out)
 {
 	if (bithenge_should_fail())
@@ -319,5 +319,5 @@
 /***************** current_node_expression                   *****************/
 
-static int current_node_evaluate(bithenge_expression_t *self,
+static errno_t current_node_evaluate(bithenge_expression_t *self,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -340,5 +340,5 @@
  * @param[out] out Holds the new expression.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_current_node_expression(bithenge_expression_t **out)
+errno_t bithenge_current_node_expression(bithenge_expression_t **out)
 {
 	bithenge_expression_inc_ref(&current_node_expression);
@@ -368,5 +368,5 @@
 }
 
-static int param_expression_evaluate(bithenge_expression_t *base,
+static errno_t param_expression_evaluate(bithenge_expression_t *base,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -390,7 +390,7 @@
  * @param index The index of the parameter to get.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_param_expression(bithenge_expression_t **out, int index)
-{
-	int rc;
+errno_t bithenge_param_expression(bithenge_expression_t **out, int index)
+{
+	errno_t rc;
 	param_expression_t *self = malloc(sizeof(*self));
 	if (!self)
@@ -430,5 +430,5 @@
 }
 
-static int const_expression_evaluate(bithenge_expression_t *base,
+static errno_t const_expression_evaluate(bithenge_expression_t *base,
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -455,8 +455,8 @@
  * @param node The constant.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_const_expression(bithenge_expression_t **out,
+errno_t bithenge_const_expression(bithenge_expression_t **out,
     bithenge_node_t *node)
 {
-	int rc;
+	errno_t rc;
 	const_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -501,5 +501,5 @@
 }
 
-static int scope_member_expression_evaluate(bithenge_expression_t *base, 
+static errno_t scope_member_expression_evaluate(bithenge_expression_t *base, 
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
@@ -511,5 +511,5 @@
 			continue;
 		bithenge_node_inc_ref(self->key);
-		int rc = bithenge_node_get(cur, self->key, out);
+		errno_t rc = bithenge_node_get(cur, self->key, out);
 		bithenge_node_dec_ref(cur);
 		if (rc != ENOENT) /* EOK or error */
@@ -537,8 +537,8 @@
  * @param key The key to search for in nodes being created.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_scope_member_expression(bithenge_expression_t **out,
+errno_t bithenge_scope_member_expression(bithenge_expression_t **out,
     bithenge_node_t *key)
 {
-	int rc;
+	errno_t rc;
 	scope_member_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -582,10 +582,10 @@
 }
 
-static int subblob_expression_evaluate(bithenge_expression_t *base, 
+static errno_t subblob_expression_evaluate(bithenge_expression_t *base, 
     bithenge_scope_t *scope, bithenge_node_t **out)
 {
 	subblob_expression_t *self = expression_as_subblob(base);
 	bithenge_node_t *start_node;
-	int rc = bithenge_expression_evaluate(self->start, scope, &start_node);
+	errno_t rc = bithenge_expression_evaluate(self->start, scope, &start_node);
 	if (rc != EOK)
 		return rc;
@@ -658,9 +658,9 @@
  * it is relative to the start.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_subblob_expression(bithenge_expression_t **out,
+errno_t bithenge_subblob_expression(bithenge_expression_t **out,
     bithenge_expression_t *blob, bithenge_expression_t *start,
     bithenge_expression_t *limit, bool absolute_limit)
 {
-	int rc;
+	errno_t rc;
 	subblob_expression_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -709,8 +709,8 @@
 }
 
-static int param_wrapper_fill_scope(param_wrapper_t *self, bithenge_scope_t
+static errno_t param_wrapper_fill_scope(param_wrapper_t *self, bithenge_scope_t
     *inner, bithenge_scope_t *outer)
 {
-	int rc;
+	errno_t rc;
 	int num_params = bithenge_transform_num_params(self->transform);
 	rc = bithenge_scope_alloc_params(inner, num_params);
@@ -730,10 +730,10 @@
 }
 
-static int param_wrapper_apply(bithenge_transform_t *base,
+static errno_t param_wrapper_apply(bithenge_transform_t *base,
     bithenge_scope_t *outer, bithenge_node_t *in, bithenge_node_t **out)
 {
 	param_wrapper_t *self = transform_as_param_wrapper(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, outer);
+	errno_t rc = bithenge_scope_new(&inner, outer);
 	if (rc != EOK)
 		return rc;
@@ -750,10 +750,10 @@
 }
 
-static int param_wrapper_prefix_length(bithenge_transform_t *base,
+static errno_t param_wrapper_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *outer, bithenge_blob_t *in, aoff64_t *out)
 {
 	param_wrapper_t *self = transform_as_param_wrapper(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, outer);
+	errno_t rc = bithenge_scope_new(&inner, outer);
 	if (rc != EOK)
 		return rc;
@@ -770,5 +770,5 @@
 }
 
-static int param_wrapper_prefix_apply(bithenge_transform_t *base,
+static errno_t param_wrapper_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *outer, bithenge_blob_t *in, bithenge_node_t **out_node,
     aoff64_t *out_length)
@@ -776,5 +776,5 @@
 	param_wrapper_t *self = transform_as_param_wrapper(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, outer);
+	errno_t rc = bithenge_scope_new(&inner, outer);
 	if (rc != EOK)
 		return rc;
@@ -816,8 +816,8 @@
  * @param params The expressions used to calculate the parameters.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_param_wrapper(bithenge_transform_t **out,
+errno_t bithenge_param_wrapper(bithenge_transform_t **out,
     bithenge_transform_t *transform, bithenge_expression_t **params)
 {
-	int rc;
+	errno_t rc;
 	int num_params = bithenge_transform_num_params(transform);
 	param_wrapper_t *self = malloc(sizeof(*self));
@@ -868,10 +868,10 @@
 }
 
-static int expression_transform_apply(bithenge_transform_t *base,
+static errno_t expression_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
 	expression_transform_t *self = transform_as_expression(base);
 	bithenge_scope_t *inner;
-	int rc = bithenge_scope_new(&inner, scope);
+	errno_t rc = bithenge_scope_new(&inner, scope);
 	if (rc != EOK)
 		return rc;
@@ -900,8 +900,8 @@
  * @param expr The expression to evaluate.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_expression_transform(bithenge_transform_t ** out,
+errno_t bithenge_expression_transform(bithenge_transform_t ** out,
     bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	expression_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -929,5 +929,5 @@
 /***************** inputless_transform            *****************/
 
-static int inputless_transform_prefix_length(bithenge_transform_t *base,
+static errno_t inputless_transform_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *in, aoff64_t *out)
 {
@@ -936,5 +936,5 @@
 }
 
-static int inputless_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t inputless_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *in, bithenge_node_t **out_node,
     aoff64_t *out_size)
@@ -957,8 +957,8 @@
  * @param expr The expression to evaluate.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_inputless_transform(bithenge_transform_t ** out,
+errno_t bithenge_inputless_transform(bithenge_transform_t ** out,
     bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	expression_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -1004,10 +1004,10 @@
 }
 
-static int concat_blob_evaluate_b(concat_blob_t *self)
+static errno_t concat_blob_evaluate_b(concat_blob_t *self)
 {
 	if (self->b)
 		return EOK;
 	bithenge_node_t *b_node;
-	int rc = bithenge_expression_evaluate(self->b_expr, self->scope,
+	errno_t rc = bithenge_expression_evaluate(self->b_expr, self->scope,
 	    &b_node);
 	if (rc != EOK)
@@ -1026,8 +1026,8 @@
 }
 
-static int concat_blob_size(bithenge_blob_t *base, aoff64_t *size)
+static errno_t concat_blob_size(bithenge_blob_t *base, aoff64_t *size)
 {
 	concat_blob_t *self = blob_as_concat(base);
-	int rc = concat_blob_evaluate_b(self);
+	errno_t rc = concat_blob_evaluate_b(self);
 	if (rc != EOK)
 		return rc;
@@ -1037,8 +1037,8 @@
 }
 
-static int concat_blob_read(bithenge_blob_t *base, aoff64_t offset,
+static errno_t concat_blob_read(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size)
 {
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = blob_as_concat(base);
 
@@ -1065,8 +1065,8 @@
 }
 
-static int concat_blob_read_bits(bithenge_blob_t *base, aoff64_t offset,
+static errno_t concat_blob_read_bits(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size, bool little_endian)
 {
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = blob_as_concat(base);
 
@@ -1118,5 +1118,5 @@
  * @param b The second blob.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_concat_blob(bithenge_node_t **out, bithenge_blob_t *a,
+errno_t bithenge_concat_blob(bithenge_node_t **out, bithenge_blob_t *a,
     bithenge_blob_t *b)
 {
@@ -1124,5 +1124,5 @@
 	assert(a);
 	assert(b);
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -1160,5 +1160,5 @@
  * @param scope The scope in which @a b_expr should be evaluated.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_concat_blob_lazy(bithenge_node_t **out, bithenge_blob_t *a,
+errno_t bithenge_concat_blob_lazy(bithenge_node_t **out, bithenge_blob_t *a,
     bithenge_expression_t *b_expr, bithenge_scope_t *scope)
 {
@@ -1167,5 +1167,5 @@
 	assert(b_expr);
 	assert(scope);
-	int rc;
+	errno_t rc;
 	concat_blob_t *self = malloc(sizeof(*self));
 	if (!self) {
Index: uspace/lib/bithenge/src/failure.c
===================================================================
--- uspace/lib/bithenge/src/failure.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/failure.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -85,5 +85,5 @@
 {
 	g_initialized = 1;
-	int rc = atexit(atexit_handler);
+	errno_t rc = atexit(atexit_handler);
 	if (rc)
 		exit(127);
@@ -96,5 +96,5 @@
 /* Record a hit for a backtrace address and return whether this is the first
  * hit. */
-static inline int backtrace_item_hit(void *addr)
+static inline errno_t backtrace_item_hit(void *addr)
 {
 	backtrace_item_t **bip;
@@ -120,5 +120,5 @@
 }
 
-int bithenge_should_fail(void)
+errno_t bithenge_should_fail(void)
 {
 	g_failure_index++;
@@ -202,5 +202,5 @@
 }
 
-int bithenge_failure_ferror(FILE *stream)
+errno_t bithenge_failure_ferror(FILE *stream)
 {
 	if (bithenge_should_fail())
@@ -216,5 +216,5 @@
 }
 
-int bithenge_failure_open(const char *pathname, int flags)
+errno_t bithenge_failure_open(const char *pathname, int flags)
 {
 	if (bithenge_should_fail()) {
@@ -225,5 +225,5 @@
 }
 
-int bithenge_failure_fstat(int fd, struct stat *buf)
+errno_t bithenge_failure_fstat(int fd, struct stat *buf)
 {
 	if (bithenge_should_fail()) {
Index: uspace/lib/bithenge/src/failure.h
===================================================================
--- uspace/lib/bithenge/src/failure.h	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/failure.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -44,13 +44,13 @@
 #include <stddef.h>
 
-int bithenge_should_fail(void);
+errno_t bithenge_should_fail(void);
 void *bithenge_failure_malloc(size_t);
 void *bithenge_failure_realloc(void *, size_t);
 ssize_t bithenge_failure_read(int, void *, size_t);
 off_t bithenge_failure_lseek(int, off_t, int);
-int bithenge_failure_ferror(FILE *);
+errno_t bithenge_failure_ferror(FILE *);
 char *bithenge_failure_str_ndup(const char *, size_t);
-int bithenge_failure_open(const char *, int);
-int bithenge_failure_fstat(int, struct stat *);
+errno_t bithenge_failure_open(const char *, int);
+errno_t bithenge_failure_fstat(int, struct stat *);
 
 #ifndef BITHENGE_FAILURE_DECLS_ONLY
Index: uspace/lib/bithenge/src/file.c
===================================================================
--- uspace/lib/bithenge/src/file.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/file.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -63,5 +63,5 @@
 }
 
-static int file_size(bithenge_blob_t *base, aoff64_t *size)
+static errno_t file_size(bithenge_blob_t *base, aoff64_t *size)
 {
 	file_blob_t *blob = blob_as_file(base);
@@ -70,5 +70,5 @@
 }
 
-static int file_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
+static errno_t file_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
     aoff64_t *size)
 {
@@ -78,5 +78,5 @@
 
 	size_t amount_read;
-	int rc = vfs_read(blob->fd, &offset, buffer, *size, &amount_read);
+	errno_t rc = vfs_read(blob->fd, &offset, buffer, *size, &amount_read);
 	if (rc != EOK)
 		return errno;
@@ -98,10 +98,10 @@
 };
 
-static int new_file_blob(bithenge_node_t **out, int fd, bool needs_close)
+static errno_t new_file_blob(bithenge_node_t **out, int fd, bool needs_close)
 {
 	assert(out);
 
 	struct stat stat;
-	int rc = vfs_stat(fd, &stat);
+	errno_t rc = vfs_stat(fd, &stat);
 	if (rc != EOK) {
 		if (needs_close)
@@ -141,10 +141,10 @@
  * @param filename The name of the file.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_file_blob(bithenge_node_t **out, const char *filename)
+errno_t bithenge_new_file_blob(bithenge_node_t **out, const char *filename)
 {
 	assert(filename);
 
 	int fd;
-	int rc = vfs_lookup_open(filename, WALK_REGULAR, MODE_READ, &fd);
+	errno_t rc = vfs_lookup_open(filename, WALK_REGULAR, MODE_READ, &fd);
 	if (rc != EOK)
 		return rc;
@@ -158,5 +158,5 @@
  * @param fd The file descriptor.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_file_blob_from_fd(bithenge_node_t **out, int fd)
+errno_t bithenge_new_file_blob_from_fd(bithenge_node_t **out, int fd)
 {
 	return new_file_blob(out, fd, false);
@@ -168,5 +168,5 @@
  * @param file The file pointer.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_file_blob_from_file(bithenge_node_t **out, FILE *file)
+errno_t bithenge_new_file_blob_from_file(bithenge_node_t **out, FILE *file)
 {
 	int fd = fileno(file);
Index: uspace/lib/bithenge/src/helenos/block.c
===================================================================
--- uspace/lib/bithenge/src/helenos/block.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/helenos/block.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -61,5 +61,5 @@
 }
 
-static int block_size(bithenge_blob_t *base, aoff64_t *size)
+static errno_t block_size(bithenge_blob_t *base, aoff64_t *size)
 {
 	block_blob_t *self = blob_as_block(base);
@@ -68,5 +68,5 @@
 }
 
-static int block_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
+static errno_t block_read(bithenge_blob_t *base, aoff64_t offset, char *buffer,
     aoff64_t *size)
 {
@@ -96,10 +96,10 @@
  * @param service_id The service ID of the block device.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_block_blob(bithenge_node_t **out, service_id_t service_id)
+errno_t bithenge_new_block_blob(bithenge_node_t **out, service_id_t service_id)
 {
 	assert(out);
 
 	// Initialize libblock
-	int rc;
+	errno_t rc;
 	rc = block_init(service_id, 2048);
 	if (rc != EOK)
Index: uspace/lib/bithenge/src/helenos/block.h
===================================================================
--- uspace/lib/bithenge/src/helenos/block.h	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/helenos/block.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -41,5 +41,5 @@
 #include <bithenge/tree.h>
 
-int bithenge_new_block_blob(bithenge_node_t **, service_id_t);
+errno_t bithenge_new_block_blob(bithenge_node_t **, service_id_t);
 
 #endif
Index: uspace/lib/bithenge/src/helenos/common.h
===================================================================
--- uspace/lib/bithenge/src/helenos/common.h	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/helenos/common.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -64,5 +64,5 @@
 }
 
-static inline int string_iterator_next(string_iterator_t *i, wchar_t *out)
+static inline errno_t string_iterator_next(string_iterator_t *i, wchar_t *out)
 {
 	*out = i->ch;
@@ -81,9 +81,9 @@
 }
 
-static inline int bithenge_parse_int(const char *start, bithenge_int_t *result)
+static inline errno_t bithenge_parse_int(const char *start, bithenge_int_t *result)
 {
 	const char *real_start = *start == '-' ? start + 1 : start;
 	uint64_t val;
-	int rc = str_uint64_t(real_start, NULL, 10, false, &val);
+	errno_t rc = str_uint64_t(real_start, NULL, 10, false, &val);
 	*result = val;
 	if (*start == '-')
Index: uspace/lib/bithenge/src/linux/common.h
===================================================================
--- uspace/lib/bithenge/src/linux/common.h	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/linux/common.h	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -55,5 +55,5 @@
 }
 
-static inline int string_iterator_next(string_iterator_t *i, wchar_t *out)
+static inline errno_t string_iterator_next(string_iterator_t *i, wchar_t *out)
 {
 	wint_t rc = btowc(*(*i)++); // TODO
@@ -82,5 +82,5 @@
 }
 
-static inline int str_lcmp(const char *s1, const char *s2, size_t max_len)
+static inline errno_t str_lcmp(const char *s1, const char *s2, size_t max_len)
 {
 	return strncmp(s1, s2, max_len);
@@ -132,5 +132,5 @@
 }
 
-static inline int bithenge_parse_int(const char *start, bithenge_int_t *result)
+static inline errno_t bithenge_parse_int(const char *start, bithenge_int_t *result)
 {
 	errno = 0;
Index: uspace/lib/bithenge/src/print.c
===================================================================
--- uspace/lib/bithenge/src/print.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/print.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -73,5 +73,5 @@
 }
 
-static int print_node(state_t *, bithenge_node_t *);
+static errno_t print_node(state_t *, bithenge_node_t *);
 
 static void newline(state_t *state)
@@ -93,8 +93,8 @@
 }
 
-static int print_internal_func(bithenge_node_t *key, bithenge_node_t *value, void *data)
+static errno_t print_internal_func(bithenge_node_t *key, bithenge_node_t *value, void *data)
 {
 	state_t *state = (state_t *)data;
-	int rc = EOK;
+	errno_t rc = EOK;
 	if (!state->first)
 		state_printf(state, ",");
@@ -120,7 +120,7 @@
 }
 
-static int print_internal(state_t *state, bithenge_node_t *node)
-{
-	int rc;
+static errno_t print_internal(state_t *state, bithenge_node_t *node)
+{
+	errno_t rc;
 	state_printf(state, "{");
 	increase_depth(state);
@@ -137,5 +137,5 @@
 }
 
-static int print_boolean(state_t *state, bithenge_node_t *node)
+static errno_t print_boolean(state_t *state, bithenge_node_t *node)
 {
 	bool value = bithenge_boolean_node_value(node);
@@ -151,5 +151,5 @@
 }
 
-static int print_integer(state_t *state, bithenge_node_t *node)
+static errno_t print_integer(state_t *state, bithenge_node_t *node)
 {
 	bithenge_int_t value = bithenge_integer_node_value(node);
@@ -158,5 +158,5 @@
 }
 
-static int print_string(state_t *state, bithenge_node_t *node)
+static errno_t print_string(state_t *state, bithenge_node_t *node)
 {
 	const char *value = bithenge_string_node_value(node);
@@ -164,5 +164,5 @@
 	for (string_iterator_t i = string_iterator(value); !string_iterator_done(&i); ) {
 		wchar_t ch;
-		int rc = string_iterator_next(&i, &ch);
+		errno_t rc = string_iterator_next(&i, &ch);
 		if (rc != EOK)
 			return rc;
@@ -179,5 +179,5 @@
 }
 
-static int print_blob(state_t *state, bithenge_node_t *node)
+static errno_t print_blob(state_t *state, bithenge_node_t *node)
 {
 	bithenge_blob_t *blob = bithenge_node_as_blob(node);
@@ -185,5 +185,5 @@
 	uint8_t buffer[1024];
 	aoff64_t size = sizeof(buffer);
-	int rc;
+	errno_t rc;
 	state_printf(state,
 	    state->type == BITHENGE_PRINT_PYTHON ? "b\"" : "\"");
@@ -201,5 +201,5 @@
 }
 
-static int print_node(state_t *state, bithenge_node_t *tree)
+static errno_t print_node(state_t *state, bithenge_node_t *tree)
 {
 	switch (bithenge_node_type(tree)) {
@@ -222,5 +222,5 @@
  * @param tree The root node of the tree to print.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_print_node(bithenge_print_type_t type, bithenge_node_t *tree)
+errno_t bithenge_print_node(bithenge_print_type_t type, bithenge_node_t *tree)
 {
 	state_t state = {type, true, 0, NULL, 0};
@@ -236,9 +236,9 @@
  * @param tree The root node of the tree to print.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_print_node_to_string(char **str, size_t *size,
+errno_t bithenge_print_node_to_string(char **str, size_t *size,
     bithenge_print_type_t type, bithenge_node_t *tree)
 {
 	state_t state = {type, true, 0, *str, *size};
-	int rc = print_node(&state, tree);
+	errno_t rc = print_node(&state, tree);
 	*str = state.buffer;
 	*size = state.buffer_size;
Index: uspace/lib/bithenge/src/script.c
===================================================================
--- uspace/lib/bithenge/src/script.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/script.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -99,5 +99,5 @@
 	/** Rather than constantly checking return values, the parser uses this
 	 * to indicate whether an error has occurred. */
-	int error;
+	errno_t error;
 
 	/** The list of named transforms. */
@@ -148,5 +148,5 @@
 
 /** Note that an error has occurred if error is not EOK. */
-static void error_errno(state_t *state, int error)
+static void error_errno(state_t *state, errno_t error)
 {
 	// Don't overwrite a previous error.
@@ -276,5 +276,5 @@
 			state->buffer_pos++;
 		state->token = TOKEN_INTEGER;
-		int rc = bithenge_parse_int(state->buffer +
+		errno_t rc = bithenge_parse_int(state->buffer +
 		    state->old_buffer_pos, &state->token_int);
 		error_errno(state, rc);
@@ -520,5 +520,5 @@
 static bithenge_expression_t *parse_term(state_t *state)
 {
-	int rc;
+	errno_t rc;
 	if (state->token == TOKEN_TRUE || state->token == TOKEN_FALSE) {
 		bool val = state->token == TOKEN_TRUE;
@@ -630,5 +630,5 @@
 static bithenge_expression_t *parse_postfix_expression(state_t *state)
 {
-	int rc;
+	errno_t rc;
 	bithenge_expression_t *expr = parse_term(state);
 	while (state->error == EOK) {
@@ -737,5 +737,5 @@
 			break;
 		}
-		int rc = bithenge_binary_expression(&expr, op, expr, expr2);
+		errno_t rc = bithenge_binary_expression(&expr, op, expr, expr2);
 		if (rc != EOK) {
 			expr = NULL;
@@ -797,5 +797,5 @@
 
 	if (num_params) {
-		int rc = bithenge_param_wrapper(&result, result, params);
+		errno_t rc = bithenge_param_wrapper(&result, result, params);
 		if (rc != EOK) {
 			error_errno(state, rc);
@@ -813,5 +813,5 @@
 {
 	bithenge_node_t *node;
-	int rc = bithenge_new_empty_internal_node(&node);
+	errno_t rc = bithenge_new_empty_internal_node(&node);
 	if (rc != EOK) {
 		error_errno(state, rc);
@@ -869,5 +869,5 @@
 
 	bithenge_transform_t *if_xform;
-	int rc = bithenge_if_transform(&if_xform, expr, true_xform,
+	errno_t rc = bithenge_if_transform(&if_xform, expr, true_xform,
 	    false_xform);
 	if (rc != EOK) {
@@ -893,5 +893,5 @@
 			next_token(state);
 			bithenge_node_t *node;
-			int rc = bithenge_new_boolean_node(&node, true);
+			errno_t rc = bithenge_new_boolean_node(&node, true);
 			if (rc != EOK) {
 				error_errno(state, rc);
@@ -907,5 +907,5 @@
 			if (state->error == EOK) {
 				bithenge_expression_inc_ref(ref_expr);
-				int rc = bithenge_binary_expression(&expr,
+				errno_t rc = bithenge_binary_expression(&expr,
 				    BITHENGE_EXPRESSION_EQUALS, ref_expr,
 				    expr);
@@ -947,5 +947,5 @@
 	while (state->error == EOK && num >= 1) {
 		num--;
-		int rc = bithenge_if_transform(&switch_xform, exprs[num],
+		errno_t rc = bithenge_if_transform(&switch_xform, exprs[num],
 		    xforms[num], switch_xform);
 		if (rc != EOK) {
@@ -987,5 +987,5 @@
 
 	bithenge_transform_t *repeat_xform;
-	int rc = bithenge_repeat_transform(&repeat_xform, xform, expr);
+	errno_t rc = bithenge_repeat_transform(&repeat_xform, xform, expr);
 	if (rc != EOK) {
 		error_errno(state, rc);
@@ -1013,5 +1013,5 @@
 
 	bithenge_transform_t *do_while_xform;
-	int rc = bithenge_do_while_transform(&do_while_xform, xform, expr);
+	errno_t rc = bithenge_do_while_transform(&do_while_xform, xform, expr);
 	if (rc != EOK) {
 		error_errno(state, rc);
@@ -1031,5 +1031,5 @@
 
 		bithenge_expression_t *in_expr;
-		int rc = bithenge_in_node_expression(&in_expr);
+		errno_t rc = bithenge_in_node_expression(&in_expr);
 		if (rc != EOK)
 			error_errno(state, rc);
@@ -1061,5 +1061,5 @@
 	}
 
-	int rc = bithenge_partial_transform(&xform, xform);
+	errno_t rc = bithenge_partial_transform(&xform, xform);
 	if (rc != EOK) {
 		error_errno(state, rc);
@@ -1130,5 +1130,5 @@
 	subxforms[num].transform = NULL;
 	bithenge_transform_t *result;
-	int rc = bithenge_new_struct(&result, subxforms);
+	errno_t rc = bithenge_new_struct(&result, subxforms);
 	if (rc != EOK) {
 		error_errno(state, rc);
@@ -1153,5 +1153,5 @@
 
 		bithenge_transform_t *xform;
-		int rc;
+		errno_t rc;
 		if (state->in_node_used)
 			rc = bithenge_expression_transform(&xform, expr);
@@ -1211,5 +1211,5 @@
 	if (xforms) {
 		xforms[0] = result;
-		int rc = bithenge_new_composed_transform(&result, xforms, num);
+		errno_t rc = bithenge_new_composed_transform(&result, xforms, num);
 		if (rc != EOK) {
 			error_errno(state, rc);
@@ -1244,5 +1244,5 @@
 	bithenge_transform_t *barrier = NULL;
 	if (state->error == EOK) {
-		int rc = bithenge_new_barrier_transform(&barrier,
+		errno_t rc = bithenge_new_barrier_transform(&barrier,
 		    state->num_params);
 		if (rc != EOK) {
@@ -1259,5 +1259,5 @@
 
 	if (state->error == EOK) {
-		int rc = bithenge_barrier_transform_set_subtransform(barrier,
+		errno_t rc = bithenge_barrier_transform_set_subtransform(barrier,
 		    xform);
 		xform = NULL;
@@ -1321,5 +1321,5 @@
  * @return EOK on success, EINVAL on syntax error, or an error code from
  * errno.h. */
-int bithenge_parse_script(const char *filename, bithenge_transform_t **out)
+errno_t bithenge_parse_script(const char *filename, bithenge_transform_t **out)
 {
 	state_t state;
@@ -1328,5 +1328,5 @@
 		parse_definition(&state);
 	*out = get_named_transform(&state, "main");
-	int rc = state.error;
+	errno_t rc = state.error;
 	state_destroy(&state);
 	if (rc == EOK && !*out) {
Index: uspace/lib/bithenge/src/sequence.c
===================================================================
--- uspace/lib/bithenge/src/sequence.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/sequence.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -58,5 +58,5 @@
 
 typedef struct seq_node_ops {
-	int (*get_transform)(seq_node_t *self, bithenge_transform_t **out,
+	errno_t (*get_transform)(seq_node_t *self, bithenge_transform_t **out,
 	    bithenge_int_t index);
 } seq_node_ops_t;
@@ -72,5 +72,5 @@
 }
 
-static int seq_node_field_offset(seq_node_t *self, aoff64_t *out, size_t index)
+static errno_t seq_node_field_offset(seq_node_t *self, aoff64_t *out, size_t index)
 {
 	if (index == 0) {
@@ -83,5 +83,5 @@
 	for (; self->num_ends <= index; self->num_ends++) {
 		bithenge_transform_t *subxform;
-		int rc = self->ops->get_transform(self, &subxform,
+		errno_t rc = self->ops->get_transform(self, &subxform,
 		    self->num_ends);
 		if (rc != EOK)
@@ -136,9 +136,9 @@
 }
 
-static int seq_node_subtransform(seq_node_t *self, bithenge_node_t **out,
+static errno_t seq_node_subtransform(seq_node_t *self, bithenge_node_t **out,
     size_t index)
 {
 	aoff64_t start_pos;
-	int rc = seq_node_field_offset(self, &start_pos, index);
+	errno_t rc = seq_node_field_offset(self, &start_pos, index);
 	if (rc != EOK)
 		return rc;
@@ -194,5 +194,5 @@
 	} else {
 		aoff64_t end_pos;
-		int rc = seq_node_field_offset(self, &end_pos, index + 1);
+		errno_t rc = seq_node_field_offset(self, &end_pos, index + 1);
 		if (rc != EOK) {
 			bithenge_transform_dec_ref(subxform);
@@ -220,8 +220,8 @@
 }
 
-static int seq_node_complete(seq_node_t *self, bool *out)
+static errno_t seq_node_complete(seq_node_t *self, bool *out)
 {
 	aoff64_t blob_size, end_pos;
-	int rc = bithenge_blob_size(self->blob, &blob_size);
+	errno_t rc = bithenge_blob_size(self->blob, &blob_size);
 	if (rc != EOK)
 		return rc;
@@ -251,5 +251,5 @@
 }
 
-static int seq_node_init(seq_node_t *self, const seq_node_ops_t *ops,
+static errno_t seq_node_init(seq_node_t *self, const seq_node_ops_t *ops,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_int_t num_xforms,
     bool end_on_empty)
@@ -319,8 +319,8 @@
 }
 
-static int struct_node_for_each(bithenge_node_t *base,
+static errno_t struct_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
-	int rc = EOK;
+	errno_t rc = EOK;
 	struct_node_t *self = node_as_struct(base);
 	bithenge_named_transform_t *subxforms =
@@ -368,10 +368,10 @@
 }
 
-static int struct_node_get(bithenge_node_t *base, bithenge_node_t *key,
+static errno_t struct_node_get(bithenge_node_t *base, bithenge_node_t *key,
     bithenge_node_t **out)
 {
 	struct_node_t *self = node_as_struct(base);
 
-	int rc = ENOENT;
+	errno_t rc = ENOENT;
 	if (bithenge_node_type(key) != BITHENGE_NODE_STRING)
 		goto end;
@@ -455,5 +455,5 @@
 };
 
-static int struct_node_get_transform(seq_node_t *base,
+static errno_t struct_node_get_transform(seq_node_t *base,
     bithenge_transform_t **out, bithenge_int_t index)
 {
@@ -468,5 +468,5 @@
 };
 
-static int struct_transform_make_node(struct_transform_t *self,
+static errno_t struct_transform_make_node(struct_transform_t *self,
     bithenge_node_t **out, bithenge_scope_t *scope, bithenge_blob_t *blob,
     bool prefix)
@@ -476,5 +476,5 @@
 		return ENOMEM;
 
-	int rc = bithenge_init_internal_node(struct_as_node(node),
+	errno_t rc = bithenge_init_internal_node(struct_as_node(node),
 	    &struct_node_ops);
 	if (rc != EOK) {
@@ -513,5 +513,5 @@
 }
 
-static int struct_transform_apply(bithenge_transform_t *base,
+static errno_t struct_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -523,10 +523,10 @@
 }
 
-static int struct_transform_prefix_length(bithenge_transform_t *base,
+static errno_t struct_transform_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, aoff64_t *out)
 {
 	struct_transform_t *self = transform_as_struct(base);
 	bithenge_node_t *struct_node;
-	int rc = struct_transform_make_node(self, &struct_node, scope, blob,
+	errno_t rc = struct_transform_make_node(self, &struct_node, scope, blob,
 	    true);
 	if (rc != EOK)
@@ -539,10 +539,10 @@
 }
 
-static int struct_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t struct_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
 {
 	struct_transform_t *self = transform_as_struct(base);
-	int rc = struct_transform_make_node(self, out_node, scope, blob,
+	errno_t rc = struct_transform_make_node(self, out_node, scope, blob,
 	    true);
 	if (rc != EOK)
@@ -592,8 +592,8 @@
  * @param subtransforms The subtransforms and field names.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_struct(bithenge_transform_t **out,
+errno_t bithenge_new_struct(bithenge_transform_t **out,
     bithenge_named_transform_t *subtransforms)
 {
-	int rc;
+	errno_t rc;
 	struct_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -669,8 +669,8 @@
 }
 
-static int repeat_node_for_each(bithenge_node_t *base,
+static errno_t repeat_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
-	int rc = EOK;
+	errno_t rc = EOK;
 	repeat_node_t *self = node_as_repeat(base);
 
@@ -712,5 +712,5 @@
 }
 
-static int repeat_node_get(bithenge_node_t *base, bithenge_node_t *key,
+static errno_t repeat_node_get(bithenge_node_t *base, bithenge_node_t *key,
     bithenge_node_t **out)
 {
@@ -743,5 +743,5 @@
 };
 
-static int repeat_node_get_transform(seq_node_t *base,
+static errno_t repeat_node_get_transform(seq_node_t *base,
     bithenge_transform_t **out, bithenge_int_t index)
 {
@@ -756,5 +756,5 @@
 };
 
-static int repeat_transform_make_node(repeat_transform_t *self,
+static errno_t repeat_transform_make_node(repeat_transform_t *self,
     bithenge_node_t **out, bithenge_scope_t *scope, bithenge_blob_t *blob,
     bool prefix)
@@ -763,5 +763,5 @@
 	if (self->expr != NULL) {
 		bithenge_node_t *count_node;
-		int rc = bithenge_expression_evaluate(self->expr, scope,
+		errno_t rc = bithenge_expression_evaluate(self->expr, scope,
 		    &count_node);
 		if (rc != EOK)
@@ -781,5 +781,5 @@
 		return ENOMEM;
 
-	int rc = bithenge_init_internal_node(repeat_as_node(node),
+	errno_t rc = bithenge_init_internal_node(repeat_as_node(node),
 	    &repeat_node_ops);
 	if (rc != EOK) {
@@ -803,5 +803,5 @@
 }
 
-static int repeat_transform_apply(bithenge_transform_t *base,
+static errno_t repeat_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -813,10 +813,10 @@
 }
 
-static int repeat_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t repeat_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
 {
 	repeat_transform_t *self = transform_as_repeat(base);
-	int rc = repeat_transform_make_node(self, out_node, scope, blob, true);
+	errno_t rc = repeat_transform_make_node(self, out_node, scope, blob, true);
 	if (rc != EOK)
 		return rc;
@@ -871,8 +871,8 @@
  * May be NULL, in which case @a xform will be applied indefinitely.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_repeat_transform(bithenge_transform_t **out,
+errno_t bithenge_repeat_transform(bithenge_transform_t **out,
     bithenge_transform_t *xform, bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	repeat_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -947,8 +947,8 @@
 }
 
-static int do_while_node_for_each(bithenge_node_t *base,
+static errno_t do_while_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
-	int rc = EOK;
+	errno_t rc = EOK;
 	do_while_node_t *self = node_as_do_while(base);
 
@@ -1018,5 +1018,5 @@
 };
 
-static int do_while_node_get_transform(seq_node_t *base,
+static errno_t do_while_node_get_transform(seq_node_t *base,
     bithenge_transform_t **out, bithenge_int_t index)
 {
@@ -1031,5 +1031,5 @@
 };
 
-static int do_while_transform_make_node(do_while_transform_t *self,
+static errno_t do_while_transform_make_node(do_while_transform_t *self,
     bithenge_node_t **out, bithenge_scope_t *scope, bithenge_blob_t *blob)
 {
@@ -1038,5 +1038,5 @@
 		return ENOMEM;
 
-	int rc = bithenge_init_internal_node(do_while_as_node(node),
+	errno_t rc = bithenge_init_internal_node(do_while_as_node(node),
 	    &do_while_node_ops);
 	if (rc != EOK) {
@@ -1061,5 +1061,5 @@
 }
 
-static int for_each_noop(bithenge_node_t *key, bithenge_node_t *value,
+static errno_t for_each_noop(bithenge_node_t *key, bithenge_node_t *value,
     void *data)
 {
@@ -1069,10 +1069,10 @@
 }
 
-static int do_while_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t do_while_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
 {
 	do_while_transform_t *self = transform_as_do_while(base);
-	int rc = do_while_transform_make_node(self, out_node, scope, blob);
+	errno_t rc = do_while_transform_make_node(self, out_node, scope, blob);
 	if (rc != EOK)
 		return rc;
@@ -1116,8 +1116,8 @@
  * determine whether there will be more.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_do_while_transform(bithenge_transform_t **out,
+errno_t bithenge_do_while_transform(bithenge_transform_t **out,
     bithenge_transform_t *xform, bithenge_expression_t *expr)
 {
-	int rc;
+	errno_t rc;
 	do_while_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
Index: uspace/lib/bithenge/src/source.c
===================================================================
--- uspace/lib/bithenge/src/source.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/source.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -58,5 +58,5 @@
 }
 
-static int blob_from_hex(bithenge_node_t **out, const char *hex)
+static errno_t blob_from_hex(bithenge_node_t **out, const char *hex)
 {
 	size_t size = str_length(hex);
@@ -85,5 +85,5 @@
  * @param source Specifies the node to be created.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_node_from_source(bithenge_node_t **out, const char *source)
+errno_t bithenge_node_from_source(bithenge_node_t **out, const char *source)
 {
 	if (str_chr(source, ':')) {
@@ -95,5 +95,5 @@
 			// Example: block:bd/initrd
 			service_id_t service_id;
-			int rc = loc_service_get_id(source + 6, &service_id, 0);
+			errno_t rc = loc_service_get_id(source + 6, &service_id, 0);
 			if (rc != EOK)
 				return rc;
Index: uspace/lib/bithenge/src/transform.c
===================================================================
--- uspace/lib/bithenge/src/transform.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/transform.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -57,5 +57,5 @@
  * within.
  * @return EOK or an error code from errno.h. */
-int bithenge_init_transform(bithenge_transform_t *self,
+errno_t bithenge_init_transform(bithenge_transform_t *self,
     const bithenge_transform_ops_t *ops, int num_params)
 {
@@ -83,5 +83,5 @@
  * @param[out] out Where the output tree will be stored.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_transform_apply(bithenge_transform_t *self,
+errno_t bithenge_transform_apply(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -94,5 +94,5 @@
 		return EINVAL;
 	aoff64_t self_size, whole_size;
-	int rc = bithenge_transform_prefix_apply(self, scope,
+	errno_t rc = bithenge_transform_prefix_apply(self, scope,
 	    bithenge_node_as_blob(in), out, &self_size);
 	if (rc != EOK)
@@ -119,5 +119,5 @@
  * @return EOK on success, ENOTSUP if not supported, or another error code from
  * errno.h. */
-int bithenge_transform_prefix_length(bithenge_transform_t *self,
+errno_t bithenge_transform_prefix_length(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_blob_t *blob, aoff64_t *out)
 {
@@ -130,5 +130,5 @@
 
 	bithenge_node_t *node;
-	int rc = bithenge_transform_prefix_apply(self, scope, blob, &node,
+	errno_t rc = bithenge_transform_prefix_apply(self, scope, blob, &node,
 	    out);
 	if (rc != EOK)
@@ -150,5 +150,5 @@
  * @return EOK on success, ENOTSUP if not supported, or another error code from
  * errno.h. */
-int bithenge_transform_prefix_apply(bithenge_transform_t *self,
+errno_t bithenge_transform_prefix_apply(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
@@ -163,5 +163,5 @@
 
 	aoff64_t size;
-	int rc = bithenge_transform_prefix_length(self, scope, blob, &size);
+	errno_t rc = bithenge_transform_prefix_length(self, scope, blob, &size);
 	if (rc != EOK)
 		return rc;
@@ -188,5 +188,5 @@
  * @param outer The outer scope, or NULL.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_scope_new(bithenge_scope_t **out, bithenge_scope_t *outer)
+errno_t bithenge_scope_new(bithenge_scope_t **out, bithenge_scope_t *outer)
 {
 	bithenge_scope_t *self = malloc(sizeof(*self));
@@ -251,5 +251,5 @@
  * @param format The format string.
  * @return EINVAL normally, or another error code from errno.h. */
-int bithenge_scope_error(bithenge_scope_t *scope, const char *format, ...)
+errno_t bithenge_scope_error(bithenge_scope_t *scope, const char *format, ...)
 {
 	if (scope->error)
@@ -271,5 +271,5 @@
 		if (format[0] == '%' && format[1] == 't') {
 			format += 2;
-			int rc = bithenge_print_node_to_string(&out,
+			errno_t rc = bithenge_print_node_to_string(&out,
 			    &space_left, BITHENGE_PRINT_PYTHON,
 			    va_arg(ap, bithenge_node_t *));
@@ -364,5 +364,5 @@
  * @param num_params The number of parameters to allocate.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_scope_alloc_params(bithenge_scope_t *scope, int num_params)
+errno_t bithenge_scope_alloc_params(bithenge_scope_t *scope, int num_params)
 {
 	scope->params = malloc(sizeof(*scope->params) * num_params);
@@ -382,5 +382,5 @@
  * @param node The value to store in the parameter.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_scope_set_param( bithenge_scope_t *scope, int i,
+errno_t bithenge_scope_set_param( bithenge_scope_t *scope, int i,
     bithenge_node_t *node)
 {
@@ -401,5 +401,5 @@
  * @param[out] out Stores a new reference to the parameter.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_scope_get_param(bithenge_scope_t *scope, int i,
+errno_t bithenge_scope_get_param(bithenge_scope_t *scope, int i,
     bithenge_node_t **out)
 {
@@ -436,10 +436,10 @@
 }
 
-static int barrier_transform_apply(bithenge_transform_t *base,
+static errno_t barrier_transform_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
 	barrier_transform_t *self = transform_as_barrier(base);
 	bithenge_scope_t *inner_scope;
-	int rc = bithenge_scope_new(&inner_scope, scope);
+	errno_t rc = bithenge_scope_new(&inner_scope, scope);
 	if (rc != EOK)
 		return rc;
@@ -451,10 +451,10 @@
 }
 
-static int barrier_transform_prefix_length(bithenge_transform_t *base,
+static errno_t barrier_transform_prefix_length(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *in, aoff64_t *out)
 {
 	barrier_transform_t *self = transform_as_barrier(base);
 	bithenge_scope_t *inner_scope;
-	int rc = bithenge_scope_new(&inner_scope, scope);
+	errno_t rc = bithenge_scope_new(&inner_scope, scope);
 	if (rc != EOK)
 		return rc;
@@ -467,5 +467,5 @@
 }
 
-static int barrier_transform_prefix_apply(bithenge_transform_t *base,
+static errno_t barrier_transform_prefix_apply(bithenge_transform_t *base,
     bithenge_scope_t *scope, bithenge_blob_t *in, bithenge_node_t **out_node,
     aoff64_t *out_length)
@@ -473,5 +473,5 @@
 	barrier_transform_t *self = transform_as_barrier(base);
 	bithenge_scope_t *inner_scope;
-	int rc = bithenge_scope_new(&inner_scope, scope);
+	errno_t rc = bithenge_scope_new(&inner_scope, scope);
 	if (rc != EOK)
 		return rc;
@@ -503,5 +503,5 @@
  * @param transform The subtransform to use for all operations.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_barrier_transform_set_subtransform(bithenge_transform_t *base,
+errno_t bithenge_barrier_transform_set_subtransform(bithenge_transform_t *base,
     bithenge_transform_t *transform)
 {
@@ -527,7 +527,7 @@
  * @param num_params The number of parameters to require, which may be 0.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_barrier_transform(bithenge_transform_t **out, int num_params)
-{
-	int rc;
+errno_t bithenge_new_barrier_transform(bithenge_transform_t **out, int num_params)
+{
+	errno_t rc;
 	barrier_transform_t *self = malloc(sizeof(*self));
 	if (!self) {
@@ -551,8 +551,8 @@
 /***************** ascii                                     *****************/
 
-static int ascii_apply(bithenge_transform_t *self, bithenge_scope_t *scope,
+static errno_t ascii_apply(bithenge_transform_t *self, bithenge_scope_t *scope,
     bithenge_node_t *in, bithenge_node_t **out)
 {
-	int rc;
+	errno_t rc;
 	if (bithenge_node_type(in) != BITHENGE_NODE_BLOB)
 		return EINVAL;
@@ -596,5 +596,5 @@
 /***************** bit                                       *****************/
 
-static int bit_prefix_apply(bithenge_transform_t *self,
+static errno_t bit_prefix_apply(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
@@ -602,5 +602,5 @@
 	char buffer;
 	aoff64_t size = 1;
-	int rc = bithenge_blob_read_bits(blob, 0, &buffer, &size, true);
+	errno_t rc = bithenge_blob_read_bits(blob, 0, &buffer, &size, true);
 	if (rc != EOK)
 		return rc;
@@ -642,8 +642,8 @@
 }
 
-static int bits_xe_size(bithenge_blob_t *base, aoff64_t *out)
+static errno_t bits_xe_size(bithenge_blob_t *base, aoff64_t *out)
 {
 	bits_xe_blob_t *self = blob_as_bits_xe(base);
-	int rc = bithenge_blob_size(self->bytes, out);
+	errno_t rc = bithenge_blob_size(self->bytes, out);
 	*out *= 8;
 	return rc;
@@ -658,5 +658,5 @@
 }
 
-static int bits_xe_read_bits(bithenge_blob_t *base, aoff64_t offset,
+static errno_t bits_xe_read_bits(bithenge_blob_t *base, aoff64_t offset,
     char *buffer, aoff64_t *size, bool little_endian)
 {
@@ -676,5 +676,5 @@
 		bytes_buffer = (uint8_t *)buffer;
 
-	int rc = bithenge_blob_read(self->bytes, bytes_offset,
+	errno_t rc = bithenge_blob_read(self->bytes, bytes_offset,
 	    (char *)bytes_buffer, &bytes_size);
 	if (rc != EOK)
@@ -715,5 +715,5 @@
 };
 
-static int bits_xe_apply(bithenge_transform_t *self, bithenge_scope_t *scope,
+static errno_t bits_xe_apply(bithenge_transform_t *self, bithenge_scope_t *scope,
     bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -723,5 +723,5 @@
 	if (!blob)
 		return ENOMEM;
-	int rc = bithenge_init_random_access_blob(bits_xe_as_blob(blob),
+	errno_t rc = bithenge_init_random_access_blob(bits_xe_as_blob(blob),
 	    &bits_xe_blob_ops);
 	if (rc != EOK) {
@@ -757,5 +757,5 @@
 /***************** invalid                                   *****************/
 
-static int invalid_apply(bithenge_transform_t *self, bithenge_scope_t *scope,
+static errno_t invalid_apply(bithenge_transform_t *self, bithenge_scope_t *scope,
     bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -777,9 +777,9 @@
 /***************** known_length                              *****************/
 
-static int known_length_apply(bithenge_transform_t *self,
+static errno_t known_length_apply(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
 	bithenge_node_t *length_node;
-	int rc = bithenge_scope_get_param(scope, 0, &length_node);
+	errno_t rc = bithenge_scope_get_param(scope, 0, &length_node);
 	if (rc != EOK)
 		return rc;
@@ -805,9 +805,9 @@
 }
 
-static int known_length_prefix_length(bithenge_transform_t *self,
+static errno_t known_length_prefix_length(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_blob_t *in, aoff64_t *out)
 {
 	bithenge_node_t *length_node;
-	int rc = bithenge_scope_get_param(scope, 0, &length_node);
+	errno_t rc = bithenge_scope_get_param(scope, 0, &length_node);
 	if (rc != EOK)
 		return rc;
@@ -834,5 +834,5 @@
 };
 
-static int nonzero_boolean_apply(bithenge_transform_t *self,
+static errno_t nonzero_boolean_apply(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
@@ -853,5 +853,5 @@
 };
 
-static int prefix_length_1(bithenge_transform_t *self, bithenge_scope_t *scope,
+static errno_t prefix_length_1(bithenge_transform_t *self, bithenge_scope_t *scope,
     bithenge_blob_t *blob, aoff64_t *out)
 {
@@ -860,5 +860,5 @@
 }
 
-static int prefix_length_2(bithenge_transform_t *self, bithenge_scope_t *scope,
+static errno_t prefix_length_2(bithenge_transform_t *self, bithenge_scope_t *scope,
     bithenge_blob_t *blob, aoff64_t *out)
 {
@@ -867,5 +867,5 @@
 }
 
-static int prefix_length_4(bithenge_transform_t *self, bithenge_scope_t *scope,
+static errno_t prefix_length_4(bithenge_transform_t *self, bithenge_scope_t *scope,
     bithenge_blob_t *blob, aoff64_t *out)
 {
@@ -874,5 +874,5 @@
 }
 
-static int prefix_length_8(bithenge_transform_t *self, bithenge_scope_t *scope,
+static errno_t prefix_length_8(bithenge_transform_t *self, bithenge_scope_t *scope,
     bithenge_blob_t *blob, aoff64_t *out)
 {
@@ -883,9 +883,9 @@
 /** @cond internal */
 #define MAKE_UINT_TRANSFORM(NAME, TYPE, ENDIAN, PREFIX_LENGTH_FUNC)            \
-	static int NAME##_apply(bithenge_transform_t *self,                    \
+	static errno_t NAME##_apply(bithenge_transform_t *self,                    \
 	    bithenge_scope_t *scope, bithenge_node_t *in,                      \
 	    bithenge_node_t **out)                                             \
 	{                                                                      \
-		int rc;                                                        \
+		errno_t rc;                                                        \
 		if (bithenge_node_type(in) != BITHENGE_NODE_BLOB)              \
 			return EINVAL;                                         \
@@ -927,5 +927,5 @@
 /***************** uint_be, uint_le                          *****************/
 
-static int uint_xe_prefix_apply(bithenge_transform_t *self,
+static errno_t uint_xe_prefix_apply(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_blob_t *blob, bithenge_node_t **out_node,
     aoff64_t *out_size)
@@ -933,5 +933,5 @@
 	bool little_endian = (self == &bithenge_uint_le_transform);
 	bithenge_node_t *num_bits_node;
-	int rc = bithenge_scope_get_param(scope, 0, &num_bits_node);
+	errno_t rc = bithenge_scope_get_param(scope, 0, &num_bits_node);
 	if (rc != EOK)
 		return rc;
@@ -997,8 +997,8 @@
 /***************** zero_terminated                           *****************/
 
-static int zero_terminated_apply(bithenge_transform_t *self,
+static errno_t zero_terminated_apply(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_node_t *in, bithenge_node_t **out)
 {
-	int rc;
+	errno_t rc;
 	if (bithenge_node_type(in) != BITHENGE_NODE_BLOB)
 		return EINVAL;
@@ -1021,8 +1021,8 @@
 }
 
-static int zero_terminated_prefix_length(bithenge_transform_t *self,
+static errno_t zero_terminated_prefix_length(bithenge_transform_t *self,
     bithenge_scope_t *scope, bithenge_blob_t *blob, aoff64_t *out)
 {
-	int rc;
+	errno_t rc;
 	char buffer[4096];
 	aoff64_t offset = 0, size_read = sizeof(buffer);
Index: uspace/lib/bithenge/src/tree.c
===================================================================
--- uspace/lib/bithenge/src/tree.c	(revision f77c1c90c1f223647872d5cefa2d86f63bc846d7)
+++ uspace/lib/bithenge/src/tree.c	(revision b7fd2a02e4161f4edd38548e7f8456b8021549be)
@@ -86,10 +86,10 @@
 } get_for_each_data_t;
 
-static int get_for_each_func(bithenge_node_t *key, bithenge_node_t *value,
+static errno_t get_for_each_func(bithenge_node_t *key, bithenge_node_t *value,
     void *raw_data)
 {
 	get_for_each_data_t *data = (get_for_each_data_t *)raw_data;
 	bool equal;
-	int rc = bithenge_node_equal(&equal, key, data->key);
+	errno_t rc = bithenge_node_equal(&equal, key, data->key);
 	bithenge_node_dec_ref(key);
 	if (rc != EOK)
@@ -113,5 +113,5 @@
  * @return EOK on success, ENOENT if not found, or another error code from
  * errno.h. */
-int bithenge_node_get(bithenge_node_t *self, bithenge_node_t *key,
+errno_t bithenge_node_get(bithenge_node_t *self, bithenge_node_t *key,
     bithenge_node_t **out)
 {
@@ -125,5 +125,5 @@
 		uint8_t byte;
 		aoff64_t size = 1;
-		int rc = bithenge_blob_read(bithenge_node_as_blob(self),
+		errno_t rc = bithenge_blob_read(bithenge_node_as_blob(self),
 		    offset, (char *)&byte, &size);
 		if (rc != EOK)
@@ -140,5 +140,5 @@
 	*out = NULL;
 	get_for_each_data_t data = {key, out};
-	int rc = bithenge_node_for_each(self, get_for_each_func, &data);
+	errno_t rc = bithenge_node_for_each(self, get_for_each_func, &data);
 	bithenge_node_dec_ref(key);
 	if (rc == EEXIST && *out)
@@ -155,5 +155,5 @@
  * @param[in] ops The operations provided.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_init_internal_node(bithenge_node_t *self,
+errno_t bithenge_init_internal_node(bithenge_node_t *self,
     const bithenge_internal_node_ops_t *ops)
 {
@@ -169,5 +169,5 @@
 }
 
-static int empty_internal_node_for_each(bithenge_node_t *base,
+static errno_t empty_internal_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
@@ -175,5 +175,5 @@
 }
 
-static int empty_internal_node_get(bithenge_node_t *self, bithenge_node_t *key,
+static errno_t empty_internal_node_get(bithenge_node_t *self, bithenge_node_t *key,
     bithenge_node_t **out)
 {
@@ -196,5 +196,5 @@
  * @param[out] out Holds the created node.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_empty_internal_node(bithenge_node_t **out)
+errno_t bithenge_new_empty_internal_node(bithenge_node_t **out)
 {
 	if (bithenge_should_fail())
@@ -223,8 +223,8 @@
 }
 
-static int simple_internal_node_for_each(bithenge_node_t *base,
+static errno_t simple_internal_node_for_each(bithenge_node_t *base,
     bithenge_for_each_func_t func, void *data)
 {
-	int rc;
+	errno_t rc;
 	simple_internal_node_t *self = node_as_simple(base);
 	for (bithenge_int_t i = 0; i < self->len; i++) {
@@ -264,8 +264,8 @@
  * the nodes array rather than just dereferencing each node inside it.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_simple_internal_node(bithenge_node_t **out,
+errno_t bithenge_new_simple_internal_node(bithenge_node_t **out,
     bithenge_node_t **nodes, bithenge_int_t len, bool needs_free)
 {
-	int rc;
+	errno_t rc;
 	assert(out);
 	simple_internal_node_t *self = malloc(sizeof(*self));
@@ -300,5 +300,5 @@
  * @param value The value for the node to hold.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_boolean_node(bithenge_node_t **out, bool value)
+errno_t bithenge_new_boolean_node(bithenge_node_t **out, bool value)
 {
 	assert(out);
@@ -315,5 +315,5 @@
  * @param value The value for the node to hold.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
+errno_t bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
 {
 	assert(out);
@@ -335,5 +335,5 @@
  * destroyed.
  * @return EOK on success or an error code from errno.h. */
-int bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
+errno_t bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
 {
 	assert(out);
@@ -359,5 +359,5 @@
  * @return EOK on success or an error code from errno.h.
  * @todo Add support for internal nodes. */
-int bithenge_node_equal(bool *out, bithenge_node_t *a, bithenge_node_t *b)
+errno_t bithenge_node_equal(bool *out, bithenge_node_t *a, bithenge_node_t *b)
 {
 	if (a->type != b->type) {
