ladybird/LibC/errno.h
Andreas Kling 8d1f8b2518 Add sys_nerr and sys_errlist.
Also keep the canonical errno list in LibC for now. The kernel gets it
from there. This makes building 3rd party code easier.

..also fix broken strchr().
2018-11-06 14:42:28 +01:00

24 lines
418 B
C

#pragma once
#include <sys/cdefs.h>
#include <errno_numbers.h>
#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)
__BEGIN_DECLS
extern const char* sys_errlist[];
extern int sys_nerr;
extern int errno;
__END_DECLS