From owner-freebsd-arch@FreeBSD.ORG Mon Jul 7 16:05:56 2008 Return-Path: Delivered-To: arch@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04A621065676; Mon, 7 Jul 2008 16:05:56 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id BA94E8FC15; Mon, 7 Jul 2008 16:05:55 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.64.3]) by phk.freebsd.dk (Postfix) with ESMTP id AB910170EB; Mon, 7 Jul 2008 16:05:54 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.2/8.14.2) with ESMTP id m67G5scU006883; Mon, 7 Jul 2008 16:05:54 GMT (envelope-from phk@critter.freebsd.dk) To: Robert Watson From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 07 Jul 2008 16:30:06 +0100." <20080707162733.V63144@fledge.watson.org> Date: Mon, 07 Jul 2008 16:05:54 +0000 Message-ID: <6882.1215446754@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: arch@FreeBSD.org, Sergey Babkin Subject: Re: Proposal: a revoke() system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jul 2008 16:05:56 -0000 In message <20080707162733.V63144@fledge.watson.org>, Robert Watson writes: >>> 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. I can't see how that could possibly work... If you do a dup2(), the original fd is closed, and that still does not release all threads that may be sleeing on it in device drivers. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.