mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
8d1f8b2518
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().
24 lines
418 B
C
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
|