Located under manual/
.
Contains both assembly and OS dependant versions of several functions, which makes it one of the most interesting directories.
It contains two kinds of specializations:
-
performance, e.g.
sysdeps/x86_64/multiarch/memcmp-sse4.S
which doesmemcmp
really well for SSE-4 -
system call related, which is dependent on the OS used. Linuxers will come again and again to:
sysdeps/unix/sysv/linux
TODO:
sysdeps/posix
contains many files which are also present insysdeps/unix/sysv/linux
. Why is that? Linux seems to prefer those undersysdeps/unix/sysv/linux
, which on the build go to the top-level, e.g.time/clock.o
. -
sysdeps/x86_64/dl-machine.h
: true entry point, even before_start
Each method also has a pure C implementation when possible, e.g. string/memcmp.c
, but that is likely to be much less efficient.
Basically every directory outside of sysdeps
contains only stub implementations of anything that is OS related.
E.g., in posix/getpid.c
:
int
__getpid (void)
{
__set_errno (ENOSYS);
return -1;
}
which simply sets errno
and returns a failure. Then if for a given system there was no implementation, we get ENOSYS
as required by POSIX.
Important header file that gets included into most files of the architecture, most of which are assembly code.
Example:
sysdeps/x86_64/sysdep.h
It seems that the C preprocessor is used on the assembly code, which does simply #include <sysdep.h>
.
TODO? as in sysdeps/x86_64/multiarch
Are those the object formats? Why are they needed on an stdlib? Why no PE as well?
TODO? What does it mean? Contains the entry points.
Argument parsing.
Extends POSIX getopt: http://stackoverflow.com/questions/7677562/whats-the-difference-between-argp-and-getopt
TODO what is the difference?
Low level IO?
Some things which are in each:
io
:read
libio
:puts
stdio-common
:printf
TODO
Generated code for direct system call APIs.