This repository contains standalone programs to demonstrate a feature or concept.
-
unshare
- unshare-files: demonstrates
CLONE_FILES
flag for unshare. This flag creates a seperate copy of descriptor table so that the other processes doen't affect the file descriptors on this one. - unshare-fs: demonstrates
CLONE_FS
flag for unshare. This flag seperates current working directory, directory attributes, etc. from other processes. - unshare-pid: demonstrates
CLONE_NEWPID
flag for unshare. This flag creates the first child process to pid 1 which acts asinit
for that namespace.
- unshare-files: demonstrates
-
gcc-attributes
- constructor.c: demonstrated the use of
constructor
anddestructor
GCC attributes. - constructor-hook.c: expands on the previous example to use constructor with
LD_PRELOAD
to hook libc function. - noreturn.c: demonstrates
noreturn
GCC attribute and C11 feature. - unused.c: demonstrates
unused
GCC attribute.
- constructor.c: demonstrated the use of