From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27579 invoked by alias); 27 Sep 2019 15:32:49 -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 27552 invoked by uid 89); 27 Sep 2019 15:32:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=likes, Alternatively, HX-Languages-Length:825 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; Fri, 27 Sep 2019 15:32:47 +0000 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iDsEe-0006NG-Px; Fri, 27 Sep 2019 11:32:44 -0400 Received: from [176.228.60.248] (port=2575 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iDsEd-0004Gy-PB; Fri, 27 Sep 2019 11:32:44 -0400 Date: Fri, 27 Sep 2019 15:32:00 -0000 Message-Id: <83tv8xiwku.fsf@gnu.org> From: Eli Zaretskii To: Pedro Alves CC: tom@tromey.com, gdb-patches@sourceware.org In-reply-to: <1a09dab3-9dc2-f864-00aa-5e3b3a0e2b13@redhat.com> (message from Pedro Alves on Fri, 27 Sep 2019 15:53:36 +0100) Subject: Re: [RFC 00/17] Merge event loop implementations References: <20190224165153.5062-1-tom@tromey.com> <3ae5ab8e-c219-6510-bb54-b30c1cf2d074@redhat.com> <87mueqslhn.fsf@tromey.com> <52b71425-e839-99fa-5045-8aaa02eafaef@redhat.com> <362e3e88-6e13-598c-6167-91076a6c478e@redhat.com> <8336ghkegs.fsf@gnu.org> <1a09dab3-9dc2-f864-00aa-5e3b3a0e2b13@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00558.txt.bz2 > Cc: tom@tromey.com, gdb-patches@sourceware.org > From: Pedro Alves > Date: Fri, 27 Sep 2019 15:53:36 +0100 > > Alternatively, if someone feels up to it, we could also borrow > what gnulib's socket replacement does, which is to use these > two macros to convert between a socket and a file descriptor: > > #define FD_TO_SOCKET(fd) ((SOCKET) _get_osfhandle ((fd))) > #define SOCKET_TO_FD(fh) (_open_osfhandle ((intptr_t) (fh), O_RDWR | O_BINARY)) If you want to use sockets in calls to the likes of 'read' and 'write', then the above is the only way, AFAIK. > In conclusion, I suggest sweeping the issue under the rug for now > and cast SOCKET to int for this series, like GDB already does. I'd suggest to at least have a comment about this somewhere.