From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58113 invoked by alias); 25 Feb 2019 20:30:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 57971 invoked by uid 89); 25 Feb 2019 20:30:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=nowhere, adaptations X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (209.51.188.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Feb 2019 20:30:00 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45222) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyMst-0008JN-Oe; Mon, 25 Feb 2019 15:29:58 -0500 Received: from [176.228.60.248] (port=1661 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gyMsi-00039p-It; Mon, 25 Feb 2019 15:29:51 -0500 Date: Mon, 25 Feb 2019 20:30:00 -0000 Message-Id: <83lg23mx18.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey CC: gdb-patches@sourceware.org In-reply-to: <87imx7vdxe.fsf@tromey.com> (message from Tom Tromey on Mon, 25 Feb 2019 12:57:49 -0700) Subject: Re: [RFC 00/17] Merge event loop implementations References: <20190224165153.5062-1-tom@tromey.com> <83sgwdnm6r.fsf@gnu.org> <87va19jdy4.fsf@tromey.com> <83r2bxnkrb.fsf@gnu.org> <87imx7vdxe.fsf@tromey.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00420.txt.bz2 > From: Tom Tromey > Cc: Tom Tromey , gdb-patches@sourceware.org > Date: Mon, 25 Feb 2019 12:57:49 -0700 > > By my reading of the code, gdbserver on Windows can call select with > just two file descriptors: one that is a socket that is being 'listen'd > to, and another which is the result of 'accept'. Can you point me to the gdbserver code which calls 'socket' and 'accept' on Windows, whose results are used in 'select'? I'd like to see what it does on Windows, to be able to have a better idea of what adaptations would be necessary for Gnulib's 'select'. > Eli> The long-term goal is probably to import the Gnulib implementation of > Eli> 'select', which AFAIR supports any kind of descriptors. But that > Eli> would need some adaptation work. > > Do you know offhand what is needed? I didn't know that gnulib had > this... this does seem like a good way to go if possible. Offhand, I think we'd need just the trivial adaptations, like make sure gdbserver uses file descriptors instead of HSOCKETs on Windows as well. Probably it would be best to import Gnulib's 'socket' and 'accept' as well, and use their SOCKET_TO_FD and FD_TO_SOCKET macros if/where needed (hopefully nowhere). Are there any more related APIs, besides those 3? I guess, 'close' (which should call 'closesocket' on Windows) and perhaps 'ioctl'? Gnulib has those as well.