mirror of
https://review.haiku-os.org/haiku
synced 2025-02-01 03:06:08 +01:00
2a2e7ad562
Based on the feedback from Maya Posch in https://mayaposch.wordpress.com/2024/01/20/porting-nymphcast-to-the-haiku-operating-system/ Thanks for noting that the information was missing! Change-Id: I4a9f709b17cb3a4a771f167b5af0fc83843ec5ad Reviewed-on: https://review.haiku-os.org/c/haiku/+/7406 Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com> Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
40 lines
1.6 KiB
Plaintext
40 lines
1.6 KiB
Plaintext
/*
|
|
* Copyright 2019-2024 Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Adrien Destugues, pulkomandy@pulkomandy.tk
|
|
*/
|
|
|
|
/*!
|
|
\page libroot C, POSIX, GNU and BSD functions
|
|
|
|
Haiku implements a standard library containing the standard functions from C
|
|
(https://www.iso.org/standard/29237.html) and POSIX
|
|
(https://pubs.opengroup.org/onlinepubs/9699919799/). These functions are
|
|
available in libroot, which is linked in by default.
|
|
|
|
For convenience and POSIX compatibility, empty "m" and "pthread" libraries are
|
|
also provided, but the math and thread functions are also defined in libroot. However, this is
|
|
currently not the case for "rt" and "trace" (both also part of the standard libraries required
|
|
in POSIX).
|
|
|
|
The C library also contains a number of GNU and BSD extensions to the C and
|
|
POSIX standards. The BSD extensions are enabled by default unless a specific
|
|
version of the C standard is requested from the compiler command line (for
|
|
example by using the --std=c99 switch). In case you want to set the compiler
|
|
to strict C99 but still use these extensions, you need to define _DEFAULT_SOURCE
|
|
(with a \#define preprocessor directive, or from the command line).
|
|
|
|
The GNU extensions are not enabled by default, but can be enabled by defining
|
|
_GNU_SOURCE.
|
|
|
|
The GNU and BSD extensions are in a separate library, so the -lbsd linker flag
|
|
may be needed to use them.
|
|
|
|
On the other hand, network socket functions (socket, connect, bind, accept, ...) are provided in
|
|
a separate library, libnetwork.so. To use these functions you will need to use the -lnetwork
|
|
linker command line switch (instead of the POSIX specified -lxnet).
|
|
|
|
*/
|