Re: closefd: closes a file of any process

From: Manfred Spraul (
Date: Fri Jun 23 2000 - 12:40:25 EST

From: "Tigran Aivazian" <>
> So, I still think that at the moment there is NO (neither kernel nor
> userspace) way to close a given process' file descriptor. To do that one
> needs to (at least, there are lots of other issues!) enhance the lock
> subsystem to get rid of all references to 'current' context (used for
> deadlock avoidance detection, presumably).

I don't see the the deadlock, where is the problem?

* one thread can close another threads file descriptor, so noone should rely
on "current" for the fd synchonization.
* it's possible to attach to another processes fd with
open("/proc/<pid>/fd/<x>"), AFAICS it should be possible to close another
processes fd with the same sequence (fs/proc/base.c, proc_lookupfd())

The only problem is that this close would be asynchoneous, it's possible
that a syscall on the closed fd is still running when force_close() returns.


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:26 EST