-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

System Programming Essentials with Go
By :

Several syscalls are happening in our programs every time under our noses. We can trace these calls using the strace
tool.
The strace
tool might not come pre-installed on all Linux distributions, but it’s available in most official repositories. Here’s how to install it on some major distributions.
Debian (using APT): Run the following command:
apt-get install strace -y
Red Hat family (using DNF and YUM)
yum
, run the following command:yum install strace
dnf
, run this command:dnf install strace
Arch Linux (using Pacman): Run the following command:
pacman -S strace
The basic way to use strace
is by calling the strace
utility followed by the program’s name; for example:
strace ls
This will produce an output showing system calls, their arguments, and return values. For instance, the execve
system call (https://man7.org/linux/man-pages/man2...