support for sys/poll

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
reakt
Posts: 22
Joined: Fri May 06, 2005 8:35 pm
Location: Basingstoke, UK

support for sys/poll

Post by reakt »

Hi,

I have two questions - firstly, is support for sys/poll something that is planned for PSPSDK?

Secondly, can somebody help me come up with a workaround for the timebeing?...

I'm working on a porting project and I need sys/poll.h. I notice this is not in the PSPSDK yet (unless I'm mistaken). Since I'm using Cygwin, I copied /usr/include/sys/poll.h to /usr/local/pspdev/psp/include/sys and the compiler is happy at least! The linker on the other hand is complaining of an undefined reference to poll. I did some searching and found that poll is part of the standard C library. I added -lc to my Makefile but still no luck. I always get the same error:

/cygdrive/d/code/test.cpp:156: undefined reference to `poll'

Any ideas? Thanks!

PS: Perhaps I can help with the porting of sys/poll to the PSPSDK - where do I start - i.e. which source files are used as the starting point? Thanks

UPDATE
---------
I found a workaround - to use select() instead of poll() - there was an example of how to do this in the source for libcurl. I do still need the datatypes from poll.h for this workaround, just not the implementation of poll().
danzel
Posts: 182
Joined: Fri Nov 04, 2005 11:03 pm

Post by danzel »

You should be able to use select fine with no work arounds, the include you need is <sys/fd_set.h> iirc
reakt
Posts: 22
Joined: Fri May 06, 2005 8:35 pm
Location: Basingstoke, UK

Post by reakt »

OK thanks. I will use select and socket events instead of POLLIN / POLLOUT, etc.
Post Reply