How to Generate Truly Random Numbers in POSIX Systems

Everyone knows about the rand() and srand() functions in the C Standard Library (or any of the equivalents in other programming languages). These functions work together to generate pseudo-random numbers from a seed, thus lending some nondeterminism to the program. But what about truly random numbers? What if you want a stream of random data … Continue reading How to Generate Truly Random Numbers in POSIX Systems

How to Write a Daemon Process in C

I thought I'd do another C tutorial, since I haven't done anything on C programming in a while. In this tutorial I'd like to show you how you can write your own daemon processes, also sometimes known as servers. I'm not going to show you how to write a web server or anything like that, … Continue reading How to Write a Daemon Process in C

How to Get the Dimensions of a Linux Terminal Window in C

Here I will be addressing a topic of interest to those of you who want to write full-screen applications for the Linux terminal. Yes, you could use a library like curses for this, but I'm going to go a bit deeper than that and show you how it all works under the hood. Or at … Continue reading How to Get the Dimensions of a Linux Terminal Window in C