From the course: Advanced Linux: The Linux Kernel
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Solution: System calls (syscalls) - Linux Tutorial
From the course: Advanced Linux: The Linux Kernel
Solution: System calls (syscalls)
(upbeat music) - [Instructor] All right, I hope you were ready for those, kind of tricky. So first of all, we wanted to look at how to get strace to just summarize, you know, to count the number of system calls. So if we did a man on strace, and maybe we looked for count, keep searching, right there, it says -c so let's try that. So we do strace -c and we want to see date command. And if we look through that number of calls, the most number of calls was 31 for the open at system call. And then we got a lot of single calls and so forth. It's sorted by percentage of time. Alright, the next thing is we want to strace the cd command. This is tricky. If we say whereis cd. Turns out there's no executable program for cd. This is important. CD does map to a system call, but changing directory is something that changes the state of your shell. When you have an ordinary executable command, the shell will start a new process, like for the date command, it starts a new process and the new process…
Contents
-
-
-
Discover and control hardware5m 55s
-
(Locked)
Challenge: Hardware26s
-
(Locked)
Solution: Hardware1m 32s
-
(Locked)
System calls in-depth4m 30s
-
(Locked)
Challenge: System calls (syscalls)1m 51s
-
(Locked)
Solution: System calls (syscalls)4m 45s
-
(Locked)
Read messages from the kernel and /proc3m 34s
-
(Locked)
Challenge: kernel messages and proc1m 12s
-
(Locked)
Solution: kernel messages and proc2m 19s
-
(Locked)
Introduction to /sys2m 30s
-
(Locked)
Challenge: sysfs1m 17s
-
Solution: sysfs3m 38s
-
(Locked)
Device drivers and device files4m 17s
-
(Locked)
Challenge: Drivers and device files44s
-
(Locked)
Solution: Drivers and device files2m 47s
-
-
-
-
-
-