|Sergey Babkin||Jul 6, 2008 10:30 pm|
|Robert Watson||Jul 6, 2008 11:05 pm|
|Poul-Henning Kamp||Jul 7, 2008 7:50 am|
|Sergey Babkin||Jul 7, 2008 3:05 pm|
|Sergey Babkin||Jul 7, 2008 3:12 pm|
|Robert Watson||Jul 7, 2008 3:29 pm|
|Coleman Kane||Jul 7, 2008 3:39 pm|
|Poul-Henning Kamp||Jul 7, 2008 4:03 pm|
|Poul-Henning Kamp||Jul 7, 2008 4:05 pm|
|Robert Watson||Jul 7, 2008 4:33 pm|
|Sergey Babkin||Jul 7, 2008 5:28 pm|
|Sergey Babkin||Jul 7, 2008 5:32 pm|
|Sergey Babkin||Jul 7, 2008 6:49 pm|
|David Schultz||Jul 7, 2008 6:52 pm|
|Ken Smith||Jul 7, 2008 7:32 pm|
|Poul-Henning Kamp||Jul 7, 2008 7:55 pm|
|Bruce Evans||Jul 7, 2008 8:03 pm|
|Sergey Babkin||Jul 7, 2008 9:50 pm|
|Sergey Babkin||Jul 7, 2008 9:56 pm|
|Robert Watson||Jul 7, 2008 11:06 pm|
|Robert Watson||Jul 7, 2008 11:15 pm|
|Robert Watson||Jul 7, 2008 11:22 pm|
|Poul-Henning Kamp||Jul 8, 2008 6:09 am|
|Dag-Erling Smørgrav||Jul 8, 2008 11:16 am|
|Sergey Babkin||Jul 8, 2008 12:27 pm|
|Sergey Babkin||Jul 8, 2008 2:45 pm|
|Robert Watson||Jul 8, 2008 3:26 pm|
|Ed Schouten||Jul 8, 2008 3:36 pm|
|David Schultz||Jul 8, 2008 4:46 pm|
|Robert Watson||Jul 8, 2008 4:54 pm|
|John Baldwin||Jul 10, 2008 2:24 am|
|Subject:||Proposal: a revoke() system call|
|From:||Robert Watson (rwat...@FreeBSD.org)|
|Date:||Jul 7, 2008 3:29:51 pm|
On Mon, 7 Jul 2008, Sergey Babkin wrote:
On Sun, 6 Jul 2008, Sergey Babkin wrote:
int revoke(int fd, int flags)
Seems like that conflicts with our existing revoke(2) system call. You could
Aha, I guess when I've checked, I've looked at a real old version of FreeBSD. Sure, the name can be changed.
I won't point you at the HISTORY section of the revoke(2) system call then :-).
achieve something of the same end by opening /dev/null and then dup2()'ing to the file descriptor you want to revoke, perhaps? Right now there's a known
That's a great idea. I haven't thought about it. It should do everything.
Right, and possibly this means that no additional kernel support is required -- we just make it a libc or libutil interface.
issue that calling close(2) on a socket from one thread doesn't interrupt a socket in a blocking I/O call from another thread -- you first have to call shutdown(2), and then close(2). This has caused problems for Java in the past, but I'm not sure that it's really a bug given that it's not unreasonable behavior not rejected by the spec :-).
Maybe I'll see if I can fix that.
Well, fixing this is easy -- instead of holding a reference to the file descriptor over the system call, hold a reference to the socket. The problem with that is that it creates a lot more contention on the socket locks when the reference count is dropped, not to mention more locking operations. This can be fixed but requires quite a lot of work, whereas this rather minor semantic issue is a non-problem in practice. I do have dealing with this reference issue on my todo list, but it's very low on the list because there are lots of other areas where we can significantly improve performance or semantics more easily and more quickly :-).
Robert N M Watson Computer Laboratory University of Cambridge