Hi,
Here is the scenario:
I have a shared lib which is written to profile some web servers, the
lib collects some statistics from runs and logs it to files or over
sockets.
Some of these servers close all file descriptors under some
conditions, I am not sure whether this is the right programming
proactice, but they do it.
Due to which my logging fails, I have a way here to check the validity
of file descriptor every time before I write, but this cases latency
since we are doing
two system calls instead of one.
Is there any way using which, I can tell kernel to reserver some fds
for my lib so that these fds are immune to being closed by anyone
other than my lib itself?
Any setrlimit() magic using which I can just reserve the fd and then
change back the limits and application just does not see my fds.
-Leo.