≡ Menu

C Programming

Suppose we want to add some extra functionality in the Linux kernel. So the first idea that strikes the mind is to enhance the kernel by adding more code to it, compiling the code and getting the new kernel up. But this process has the following drawbacks among several others: The added code adds to [...]

{ 13 comments }

In this article, we will start from a small explanation of process IDs and then we will quickly jump on to the practical aspects where-in we will discuss some process related C functions like fork(), execv() and wait() . Linux Processes Series: part 1, part 2, part 3 (this article). Process IDs Process IDs are the [...]

{ 10 comments }

SWIG Perl Examples – How to Interface Perl to C Using SWIG

SWIG stands for Simplified Wrapper and Interface Generator. SWIG is used to simplify the task of interfacing different languages to C and C++ programs. For our discussion, in this article we will explain how to use SWIG to interface from Perl to C programs. Some may think, why would one write Perl programs and call [...]

{ 4 comments }

In the 1st part of the Linux processes series of articles, we build up the understanding on Linux processes by discussing about the main() function, and environment related C functions. In this article, we will discuss about the memory layout of a process and the process terminating C functions. Linux Processes Series: part 1, part [...]

{ 8 comments }

This is the 1st article of a new series on the processes in Linux. The focus of this series would be on the practical aspects of process environment, process control, process relationships etc. In this article, we will discuss how to get and set environment variables inside a C program. Linux Processes Series: part 1 [...]

{ 9 comments }

In the part 1 of the Linux Signals series, we learned about the fundamental concepts behind Linux signals. Building on the previous part, in this article we will learn about how to catch signals in a process. We will present the practical aspect of signal handling using C program code snippets. Catching a Signal As [...]

{ 21 comments }

10 Practical Linux nm Command Examples

The nm commands provides information on the symbols being used in an object file or executable file. The default information that the ‘nm’ command provides is : Virtual address of the symbol A character which depicts the symbol type. If the character is in lower case then the symbol is local but if the character [...]

{ 8 comments }

A daemon process is a process which runs in background and has no controlling terminal. Since a daemon process usually has no controlling terminal so almost no user interaction is required. Daemon processes are used to provide services that can well be done in background without any user interaction. For example a process that runs [...]

{ 27 comments }