Wednesday, September 5, 2012

Intresting Questions

1. What is the use of syscall system call?

    It is an indirect system call.

Sometimes the kernel adds system calls and it takes a while for the C library to support them.
Or maybe you are compiling on an old Linux distribution, but want to run on a newer one.
But in general, there is no advantage to using syscall if the C library in your compilation environment has what you need. (For one thing, it is even less portable than using a Linux-specific interface, since the system call numbers vary by CPU.)

2. View Pipe details of a process.


1) ls -l /proc/pid/fd

This will list the pipes

lr-x------ 1 prabagaran prabagaran 64 Sep  5 23:01 14 -> pipe:[57729]<br>
l-wx------ 1 prabagaran prabagaran 64 Sep  5 23:01 15 -> pipe:[57728]<br>
lr-x------ 1 prabagaran prabagaran 64 Sep  5 23:01 16 -> pipe:[57731]<br>
lr-x------ 1 prabagaran prabagaran 64 Sep  5 23:01 17 -> pipe:[57730]<br>

2). lsof | grep 57731

wineserve 3641 prabagaran   76w     FIFO        0,8       0t0   57731 pipe<br>
winedevic 3651 prabagaran   16r     FIFO        0,8       0t0   57731 pipe

These are the pipe information related to the given process id.

No comments:

Post a Comment