RUID vs EUID

In a UNIX system, one can easily become confused by the concepts of RUID and EUID. This note aims to clarify and differentiate between them to help users identify these identifiers more easily. Environment Setup To explore these concepts further, we will need to create an executable file and a plain-text file to observe how they behave in various scenarios. We can utilize the functions getpid, getuid, geteuid, getgid, and getegid to obtain information about the running process, including its PID, RUID, RGID, EUID, and EGID....

October 15, 2024

How to use fork(), wait(), and exec()

“Glimpse of the Lepoard” is a literal translation of an idiom from Chinese “管中窥豹”. Which states that through looking at one single spot on a leopard, one is able to understand the whole creature. I wish to explain the usage of these three functions and give you a good understanding of system calls. The Linux system is written in C and assembly language, and the system calls are encapsulated in the C language library....

October 10, 2021