Search notes:

The Standard C Library

«Enhances» C with

Some functions and function families

arg_parse
alarm
Error related functions such as perror()
exit
getc
getopt
ioctl
Memory allocation such as malloc.
String and array functions (such as strcmp to compare strings).
Date and time
open and fopen
fseek and lseek
signal handling
sleep / nanosleep
tsearch and tfind to implement an associative array.
stat
wait
With the <stdarg.h> include file, it is possible to access variadic arguments in functions.

gets / fgets

gets() reads a line, terminated by a new line or EOF. For this reason, gets should almost never be used because in normal circustances, it's impossible to know in advance how long the line will be.
fgets() reads from a file rather than from stdin and allows to specify the maximum amount to be read.

printf family

Gone here.

scanf family

Gone here

syscall

Call a Linux kernel syscall directly, »without« libc (that is except using libc's syscall):
// #define _GNU_SOURCE
#include <unistd.h>
#include <sys/syscall.h>

int main() {
 //
 // Write some text to STDOUT (1). The lenght of the
 // text is 12 (last paramter).
 //
    syscall(SYS_write, 1, "Hello World\n", 12);
}
Github repository about-libc, path: /syscall.c

include files

string.h

Reserved names: Names that begin with str, mem or wcs and are followed by a lowercase letter are reserved because they might be added in the declarations in the <string.h> header file.

glibc

As per this stackoverflow answer, GNU's libc (glibc) is Linux specific and won't work on Windows.

musl

musl claims to be a lightweight, fast, simple, free standard library.

TODO

sysdeps/x86_64/elf/start.S
The relation of dirent struct (<dirent.h>) to the dentry struct in Linux.

See also

libc: building a test version
/usr/lib/libc.a
The gcc options -nostartfiles, -nodefaultlibs, -nolibc and -nostdlib.
Input/output
The FILE struct.
C++ Standard Library

Links

The GNU C Library

Index