#ifndef __RTL_ERRNO_H__
#define __RTL_ERRNO_H__

#include <rtl_conf.h>
#include <asm/errno.h>

#ifdef CONFIG_RTL_ERRNO_THREADSAFE
#include <rtl_sched.h>
#define errno (RTL_CURRENT->errno_val)
#else
extern int errno;
#endif

#define __set_errno(x) do { errno = (x); } while (0)
#define __reterror(x, y) do { errno = (x); return y; } while (0)

#endif
