>> Linux 2.6.18
>> Is there any system call to get number of open file descriptors in
>> some process?
>> ls /proc/<pid>/fd | wc -l
> But it is not system call.
No, there is no such system call. You must write the code yourself.
At the lowest level, see the manual page "man 2 getdents".
Also beware that the answer is time dependent: the answer can
change quickly (in milliseconds) by a large amount in either direction.
--