xref: /haiku/docs/user/posix/_libroot.dox (revision 2aad295eb28c467ea03cdcc1d3aa5f0d82a5f1c8)
1b966e837SAdrien Destugues/*
2b966e837SAdrien Destugues * Copyright 2019 Haiku, Inc. All rights reserved.
3b966e837SAdrien Destugues * Distributed under the terms of the MIT License.
4b966e837SAdrien Destugues *
5b966e837SAdrien Destugues * Authors:
6b966e837SAdrien Destugues *		Adrien Destugues, pulkomandy@pulkomandy.tk
7b966e837SAdrien Destugues */
8b966e837SAdrien Destugues
9b966e837SAdrien Destugues/*!
10b966e837SAdrien Destugues\page libroot C, POSIX, GNU and BSD functions
11b966e837SAdrien Destugues
12b966e837SAdrien DestuguesHaiku implements a standard library containing the standard functions from C
13b966e837SAdrien Destugues(https://www.iso.org/standard/29237.html) and POSIX
14b966e837SAdrien Destugues(https://pubs.opengroup.org/onlinepubs/9699919799/). These functions are
15b966e837SAdrien Destuguesavailable in libroot, which is linked in by default.
16b966e837SAdrien Destugues
17b966e837SAdrien DestuguesFor convenience and POSIX compatibility, empty "m" and "pthread" libraries are
18b966e837SAdrien Destuguesalso provided, but the math and thread functions are also defined in libroot.
19b966e837SAdrien Destugues
20b966e837SAdrien DestuguesThe C library also contains a number of GNU and BSD extensions to the C and
21b966e837SAdrien DestuguesPOSIX standards. The BSD extensions are enabled by default unless a specific
22b966e837SAdrien Destuguesversion of the C standard is requested from the compiler command line (for
23b966e837SAdrien Destuguesexample by using the --std=c99 switch). In case you want to set the compiler
24b966e837SAdrien Destuguesto strict C99 but still use these extensions, you need to define _DEFAULT_SOURCE
25*2aad295eSNiels Sascha Reedijk(with a \#define preprocessor directive, or from the command line).
26b966e837SAdrien Destugues
27b966e837SAdrien DestuguesThe GNU extensions are not enabled by default, but can be enabled by defining
28b966e837SAdrien Destugues_GNU_SOURCE.
29b966e837SAdrien Destugues
30b966e837SAdrien DestuguesThe GNU and BSD extensions are in a separate library, so the -lbsd linker flag
31b966e837SAdrien Destuguesmay be needed to use them.
32b966e837SAdrien Destugues
33b966e837SAdrien Destugues*/
34