What does a syscall buy you in a perl script?
How do you handle "new" things gracefully with a syscall?
How do you handle dynamic things gracefully with a syscall?
In short, there are several things going for the /proc implementation:
- you can use _generic_ tools on it (not just perl, although perl is
obviously a good tool)
- it has a very obvious extension mechanism
- it has built-in name services (using the normal UNIX name service: the
filesystem structure). Think of the /proc filesystem like the "DNS"
for kernel information..
A system call is faster, agreed. And if there are _real_ problems with
the /proc approach, and there is something performance-critical that
needs some specific information, we'll add a system call for it. But
system calls are a lot harder to make dynamic, and if you try you'd
probably end up doing what /proc already does.
Linus