[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GNUnet-developers] The function of GNUNET_SCHEDULER_FdInfo->sock

From: Christian Grothoff
Subject: Re: [GNUnet-developers] The function of GNUNET_SCHEDULER_FdInfo->sock
Date: Mon, 15 Apr 2019 17:17:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

I'm not sure what exactly you do not understand here, but the
"fdset_test_native" call is simply checking if the given file
descriptor/socket ("int" on UNIX) is in the "fd_set" represented by the
first argument. Usually/often we use the variants with the FileHandle,
but sometimes we don't have the "boxed" abstraction at hand and then
directly test with the 'int'. This can be used for sockets as well as
for file descriptors or completely other things (like event FDs).

The call is "native" in the sense that it is not expected to be
portable, as W32 AFAIK requires the use of HANDLE instead of 'int', so
this call should not be used in code that is expected to run on W32.
(That said, maybe given the new Windows 10 "linux" personality, we can
reduce our porting efforts for W32 and drop all of the W32 ABI stuff

On 4/15/19 1:53 PM, LRN wrote:
> What is it used for? I did grep the code, but some things are unclear.
> Specifically, this field is sometimes used with the calls that look like:
>             GNUNET_NETWORK_fdset_test_native (ws,
>                                               pos->fdi->sock))
> Does that imply that the sock field is interpreted as a socket descriptor in
> these cases? I.e. GNUnet is not trying to fill fdset with file descriptors for
> local files?
> _______________________________________________
> GNUnet-developers mailing list
> address@hidden

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]