From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 7 Jun 2001 00:25:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 7 Jun 2001 00:25:06 -0400 Received: from mercury.rus.uni-stuttgart.de ([129.69.1.226]:28939 "EHLO mercury.rus.uni-stuttgart.de") by vger.kernel.org with ESMTP id ; Thu, 7 Jun 2001 00:24:58 -0400 To: linux-kernel@vger.kernel.org Subject: Re: PROBLEM: I/O system call never returns if file desc is closed in the In-Reply-To: From: Florian Weimer Date: 07 Jun 2001 06:24:38 +0200 In-Reply-To: (Matthias Urlichs's message of "Thu, 7 Jun 2001 05:25:30 +0200") Message-ID: User-Agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Matthias Urlichs writes: > Select is defined as to return, with the appropriate bit set, if/when > a nonblocking read/write on the file descriptor won't block. You'd get > EBADF in this case, therefore causing the select to return would be a > Good Thing. How do you avoid race conditions if more than one thread is creating file descriptors? I think you can only do that under very special circumstances, and it definitely requires some synchronization. -- Florian Weimer Florian.Weimer@RUS.Uni-Stuttgart.DE University of Stuttgart http://cert.uni-stuttgart.de/ RUS-CERT +49-711-685-5973/fax +49-711-685-5898