@@ -21,6 +21,17 @@ extern "C" {
2121#include <sys/socket.h>
2222#include <sys/select.h>
2323
24+ #define SCE_NET_INET_POLLIN 0x0001
25+ #define SCE_NET_INET_POLLPRI 0x0002
26+ #define SCE_NET_INET_POLLOUT 0x0004
27+ #define SCE_NET_INET_POLLERR 0x0008
28+ #define SCE_NET_INET_POLLHUP 0x0010
29+ #define SCE_NET_INET_POLLNVAL 0x0020
30+ #define SCE_NET_INET_POLLRDNORM 0x0040
31+ #define SCE_NET_INET_POLLRDBAND 0x0080
32+ #define SCE_NET_INET_POLLWRBAND 0x0100
33+ #define SCE_NET_INET_POLLWRNORM SCE_NET_INET_POLLOUT
34+
2435/**
2536 * This struct is needed because tv_sec size is different from what newlib expect
2637 * Newlib expects 64bits for seconds and PSP expects 32bits
@@ -30,6 +41,15 @@ struct SceNetInetTimeval {
3041 uint32_t tv_usec ;
3142};
3243
44+ struct SceNetInetPollfd {
45+ /* file descriptor */
46+ int fd ;
47+ /* requested events */
48+ short events ;
49+ /* returned events */
50+ short revents ;
51+ };
52+
3353int sceNetInetInit (void );
3454int sceNetInetSelect (int n , fd_set * readfds , fd_set * writefds , fd_set * exceptfds , struct SceNetInetTimeval * timeout );
3555int sceNetInetTerm (void );
@@ -52,6 +72,7 @@ int sceNetInetGetpeername(int s, struct sockaddr *name, socklen_t *namelen);
5272int sceNetInetGetsockname (int s , struct sockaddr * name , socklen_t * namelen );
5373ssize_t sceNetInetSendmsg (int s , const struct msghdr * msg , int flags );
5474ssize_t sceNetInetRecvmsg (int s , struct msghdr * msg , int flags );
75+ int sceNetInetPoll (struct SceNetInetPollfd * fds , size_t nfds , int timeout );
5576
5677#ifdef __cplusplus
5778}
0 commit comments