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