From: Leonidas . on
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/