On a first shell I run the command tail
with no argument.
On a second shell I kill the first tail using strace to monitor the system calls.
qdii@nomada ~ $ strace kill 1713
execve("/bin/kill", ["kill", "1713"], [/* 82 vars */]) = 0
brk(0) = 0x2533000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9dacfe8000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
I didn’t know the brk
command so I looked it up and found that it changes the end of the data segment of the process. Why would kill
do that? especially setting the data segment to 0
seems to make little sense.