Lines Matching +full:a +full:- +full:h

1 /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
2 /* nolibc.h
3 * Copyright (C) 2017-2018 Willy Tarreau <w@1wt.eu>
7 * This file is designed to be used as a libc alternative for minimal programs
8 * with very limited requirements. It consists of a small number of syscall and
14 * - The lower level is the arch-specific syscall() definition, consisting in
17 * are castto a long stored in a register. These expressions always return
18 * the syscall's return value as a signed long value which is often either
19 * a pointer or the negated errno value.
21 * - The second level is mostly architecture-independent. It is made of
26 * A few of them are architecture-specific because the syscalls are not all
31 * - The third level is the libc call definition. It exposes the lower raw
32 * sys_<name>() calls in a way that looks like what a libc usually does,
38 * optimized away if not used. However this means that a program made of
40 * the type of programs this project targets it usually is not a problem. The
44 * Some stdint-like integer types are defined. These are valid on all currently
46 * 32 bits, longs the size of a pointer and long long 64 bits. If more
52 * The definitions start with the architecture-specific parts, which are picked
55 * target architecture, cross-compiling normally works out of the box without
58 * Finally some very common libc-level functions are provided. It is the case
59 * for a few functions usually found in string.h, ctype.h, or stdlib.h.
61 * The nolibc.h file is only a convenient entry point which includes all other
62 * files. It also defines the NOLIBC macro, so that it is possible for a
66 * A simple static executable may be built this way :
67 * $ gcc -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \
68 * -static -include nolibc.h -o hello hello.c -lgcc
71 * only a few common includes, may also be built by simply making the include
73 * $ gcc -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib \
74 * -I../nolibc -o hello hello.c -lgcc
77 * ctype.h, errno.h, signal.h, stdarg.h, stdbool.h stdio.h, stdlib.h,
78 * string.h, time.h
81 * float.h, stddef.h
84 * assert.h, locale.h, math.h, setjmp.h, limits.h
86 * A very useful calling convention table may be found here :
87 * http://man7.org/linux/man-pages/man2/syscall.2.html
96 #include "std.h"
97 #include "arch.h"
98 #include "types.h"
99 #include "sys.h"
100 #include "ctype.h"
101 #include "signal.h"
102 #include "unistd.h"
103 #include "stdio.h"
104 #include "stdlib.h"
105 #include "string.h"
106 #include "time.h"
107 #include "stackprotector.h"