1 /*****************************************************************************
2 * poll.c: I/O event multiplexing
3 *****************************************************************************
4 * Copyright © 2007 Rémi Denis-Courmont
7 * Author: Rémi Denis-Courmont
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
28 #include <vlc_common.h>
31 # include <vlc_network.h>
36 int vlc_poll (struct pollfd
*fds
, unsigned nfds
, int timeout
)
38 struct timespec tsbuf
, *ts
;
44 div_t d
= div (timeout
, 1000);
45 tsbuf
.tv_sec
= d
.quot
;
46 tsbuf
.tv_nsec
= d
.rem
* 1000000;
52 pthread_sigmask (SIG_BLOCK
, NULL
, &set
);
53 sigdelset (&set
, SIGRTMIN
);
55 canc
= vlc_savecancel ();
56 ret
= ppoll (fds
, nfds
, ts
, &set
);
57 vlc_restorecancel (canc
);
63 #elif defined (HAVE_POLL)
64 # include <vlc_network.h>
68 int vlc_poll (struct pollfd
*fds
, unsigned nfds
, int timeout
)
70 (void)fds
; (void)nfds
; (void)timeout
;
75 # error poll() not implemented!