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 entirely???) 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 > GNUnet-developers@gnu.org > https://lists.gnu.org/mailman/listinfo/gnunet-developers >
signature.asc
Description: OpenPGP digital signature
_______________________________________________ GNUnet-developers mailing list GNUnet-developers@gnu.org https://lists.gnu.org/mailman/listinfo/gnunet-developers