This repository contains standalone programs to demonstrate a feature or concept.
For assembly and systems programming concepts, refer to my sheharyaar/systems-assembly repository.
-
unshare
- unshare-files: demonstrates
CLONE_FILESflag 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_FSflag for unshare. This flag seperates current working directory, directory attributes, etc. from other processes. - unshare-pid: demonstrates
CLONE_NEWPIDflag for unshare. This flag creates the first child process to pid 1 which acts asinitfor that namespace.
- unshare-files: demonstrates
-
gcc-attributes
- constructor.c: demonstrated the use of
constructoranddestructorGCC attributes. - constructor-hook.c: expands on the previous example to use constructor with
LD_PRELOADto hook libc function. - noreturn.c: demonstrates
noreturnGCC attribute and C11 feature. - unused.c: demonstrates
unusedGCC attribute.
- constructor.c: demonstrated the use of
-
golang
- init-func.go: demonstrates the use of
initfunction in Go. - multiple-return-values.go: demonstrates the use of multiple return values in Go.
- struct-tags.go: demonstrates the use of struct tags in Go.
- json-structs.go: demonstrates the use of JSON structs in Go.
- happpens-before.go: demonstrates the concurrency concept of
happens-beforein Go.
- init-func.go: demonstrates the use of