Re: [PATCH v2 13/14] daemon: use select() instead of poll()

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

 



On Freitag, 15. Januar 2010, Erik Faye-Lund wrote:
> +#undef FD_SET
> +#define FD_SET(fd, set) do { \
> +	((fd_set*)(set))->fd_array[((fd_set *)(set))->fd_count++] =
> _get_osfhandle(fd); \ +	} while(0)
> +#undef FD_ISSET
> +#define FD_ISSET(fd, set) __WSAFDIsSet(_get_osfhandle(fd), (fd_set
> *)(set)) +

I'm worried about the internals that you have to use here. Isn't it possible 
save the original macro text and use it in the new definition, like (this is 
for exposition only):

#define ORIG_FD_SET(fd, set) FD_SET(fd, set)
#undef FD_SET
#define FD_SET(fd, set) ORIG_FD_SET(_get_osfhandle(fd), set)

Another approach would be to extend the poll emulation such that it uses 
select if all FDs to wait for are sockets, and I think this would be the case 
in this application.

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]