OUR EXPERT
Mihalis Tsoukalos is a systems engineer and a technical writer. You can find him at @mactsouk.
QUICK TIP
QUICK TIP
ABOUT UNIX SIGNALS
QUICK TIP
TYPES OF LINUX PROCESSES
OUR EXPERT
QUICK TIP
Get the code for this tutorial from the Linux Format archive: www.linuxformat.com/archives?issue=291.
You can learn more about Rust at www.rust-lang.org.
Get the code for this tutorial from the Linux Format archive: www.linuxformat.com/archives?issue=291.
Having an expect() or unwrap() part on the Rust statements that you execute is considered good practice, so do not forget to add one of them in your statements. Always be prepared for the unexpected!
UNIX Signals are software interrupts that offer a method of handling asynchronous events on a UNIX system. Every application, apart from the trivial ones, must be able to deal with signals. Each signal can be identified either by its name or a numeric value; the former approach is easier to remember and therefore is the recommended way. To send a signal to a running application, you should have the right privileges or just be root. The most critical use of signals is for avoiding blocking situations. Blocking can happen when waiting for user input, reading a file or reading from a device.
If you put an underscore at the beginning of a variable name, the Rust compiler isn’t going to complain if that variable isn’t being used. Put simply, it tells the Rust compiler that this is intentional.
A process is an execution environment that contains instructions, user data and system data parts, and other types of resources that are obtained during runtime. On the other hand, a program is a binary file that contains instructions and data that are used for initialising the instruction and user data parts of a process. Put simply, a process is a program that runs. Each running UNIX process is uniquely identified by an unsigned integer, which is called the process ID of the process.
Mihalis Tsoukalos is a systems engineer and a technical writer. You can find him at @mactsouk.