Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Fri, 5 Oct 2001 12:19:12 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Fri, 5 Oct 2001 12:19:03 -0400 Received: from leibniz.math.psu.edu ([146.186.130.2]:42463 "EHLO math.psu.edu") by vger.kernel.org with ESMTP id ; Fri, 5 Oct 2001 12:18:44 -0400 Date: Fri, 5 Oct 2001 12:19:12 -0400 (EDT) From: Alexander Viro To: lkv@isg.de cc: "Kernel, Linux" Subject: Re: Desperately missing a working "pselect()" or similar... In-Reply-To: <3BBDD37D.56D7B359@isg.de> Message-ID: 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 On Fri, 5 Oct 2001 lkv@isg.de wrote: > A somewhat bizarre solution would be to have the process create > a pipe-pair, select on the reading end, and let the signal-handler > write a byte to the pipe - but this has at least the drawback > you always spoil one "select-cycle" for each signal you get - as > the first return from the select() call happenes without any > fds being flagged as readable, only when you enter select() once > more the pipe will cause the return and tell you what happened... fork() is cheap. Create a child, have a pipe between child and parent and do select() on the other end of pipe. I.e. signal handler writes into pipe and that triggers select() in the second process. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/