winsock2.h equivalent for fd_set in android-ndk?

1,187 views
Skip to first unread message

Riasat Abir

unread,
Apr 6, 2011, 2:50:44 AM4/6/11
to android-ndk, nasifn
Hi,

I wanted to know that if its right or wrong I've done.

My code uses fd_set which is defined in winsock2.h: 

typedef struct fd_set {
        u_int fd_count;               /* how many are SET? */
        SOCKET  fd_array[FD_SETSIZE];   /* an array of SOCKETs */
} fd_set;

What should be the equivalent header in Android ndk that defines the fd_set.

I found that in C:\Android\android-ndk-r5b\platforms\android-9\arch-arm\usr\include\sys\select.h it is typedef as: typedef __kernel_fd_set   fd_set;
so i've included it (select.h) as the header file for the code. [previously it was giving undefined reference to fd_set]

So was it wrong?

--

HimHim

Riasat Abir

unread,
Apr 8, 2011, 4:05:17 AM4/8/11
to android-ndk, nasifn
David, Alan or can anyone tell what will be the equivalent header of winsock2.h in the android ndk that defines the fd_set?
--

HimHim

Angus Lees

unread,
Apr 8, 2011, 4:17:25 AM4/8/11
to andro...@googlegroups.com, Riasat Abir, nasifn
Yes, you want <sys/select.h> on Unix.  See any Unix select(2) manpage (a websearch shows many HTML versions of this).

 - Gus

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

Riasat Abir

unread,
Apr 8, 2011, 8:21:15 AM4/8/11
to android-ndk
Thanks,
Then I was right including the <sys/select.h> for the defination of fd_set in android ndk.
--

HimHim

Reply all
Reply to author
Forward
0 new messages