2018-10-25 13:06:00 +03:00
|
|
|
#pragma once
|
|
|
|
|
2018-11-06 16:13:16 +03:00
|
|
|
#include <errno_numbers.h>
|
2019-05-28 12:53:16 +03:00
|
|
|
#include <sys/cdefs.h>
|
2018-10-25 13:06:00 +03:00
|
|
|
|
|
|
|
#define __RETURN_WITH_ERRNO(rc, good_ret, bad_ret) \
|
2019-05-28 12:53:16 +03:00
|
|
|
do { \
|
|
|
|
if (rc < 0) { \
|
|
|
|
errno = -rc; \
|
|
|
|
return (bad_ret); \
|
|
|
|
} else { \
|
|
|
|
errno = 0; \
|
|
|
|
return (good_ret); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2018-10-25 13:06:00 +03:00
|
|
|
|
2018-10-31 04:09:11 +03:00
|
|
|
__BEGIN_DECLS
|
2018-10-25 13:06:00 +03:00
|
|
|
|
2018-11-06 16:13:16 +03:00
|
|
|
extern const char* sys_errlist[];
|
|
|
|
extern int sys_nerr;
|
2018-10-25 13:06:00 +03:00
|
|
|
extern int errno;
|
|
|
|
|
2018-10-31 04:09:11 +03:00
|
|
|
__END_DECLS
|