| 1 |
|
| 2 | |
| 3 | * Minimal errno definitions for NOLIBC
|
| 4 | * Copyright (C) 2017-2022 Willy Tarreau <[email protected]>
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 | #include "nolibc.h"
|
| 9 |
|
| 10 | #ifndef _NOLIBC_ERRNO_H
|
| 11 | #define _NOLIBC_ERRNO_H
|
| 12 |
|
| 13 | #include <linux/errno.h>
|
| 14 |
|
| 15 | #ifndef NOLIBC_IGNORE_ERRNO
|
| 16 | #define SET_ERRNO(v) do { errno = (v); } while (0)
|
| 17 | int errno __attribute__((weak));
|
| 18 | char *program_invocation_name __attribute__((weak)) = (char *)"";
|
| 19 | char *program_invocation_short_name __attribute__((weak)) = (char *)"";
|
| 20 | #else
|
| 21 | #define SET_ERRNO(v) do { } while (0)
|
| 22 | #define program_invocation_name ""
|
| 23 | #define program_invocation_short_name ""
|
| 24 | #endif
|
| 25 |
|
| 26 |
|
| 27 | |
| 28 | * because they all correspond to the highest addressable memory page.
|
| 29 |
|
| 30 | #define MAX_ERRNO 4095
|
| 31 |
|
| 32 | #endif
|