You need to have a C compiler, which supports the C11 standard, and CMake v3.9 or higher installed in order to run the examples.
Some examples depend on external libraries. Those external libraries' availability are checked by CMake before the build. So if you got a CMake error, it's probably because of a missing library. Anyway, to install run the examples, just clone the repository using the following commands, and you are good to go.
$ git clone https://github.com/umut-sahin/c-examples.git
$ cd c-examples
You can use the following command to build every single example.
$ make build verbose=1
$ make run target=<example-name>
Also, you can pass arguments like so
$ make run target=<example-name> args="[arguments...]"
Note that there are some examples, which are in the form of a library, therefore, does not come with an executable. For those examples, you may use the test command like so
$ make test target=<example-name>
- command-line-arguments
- http-hello-world-server
- memory-mapped-io
- parking-pthreads
- pthreads
- read-from-console
- signalfd-with-epoll
- tcp-echo-server-with-epoll
- write-to-console
See CHANGELOG.
This repository is released under MIT license. Please see the LICENSE for further information.
Contributions are welcome! Please see CONTRIBUTING for guidance.
See AUTHORS.