summaryrefslogtreecommitdiff
path: root/spectro/pollem.h
blob: f8a86ee902002b8ab23a77ccec6f40c4d029087e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

#ifndef POLLEN_H

 /* Unix serial I/O class poll() emulation. */

/* 
 * Argyll Color Correction System
 *
 * Author: Graeme W. Gill
 * Date:   12/9/2004
 *
 * Copyright 2004, 2010 Graeme W. Gill
 * All rights reserved.
 *
 * This material is licenced under the GNU GENERAL PUBLIC LICENSE Version 2 or later :-
 * see the License2.txt file for licencing details.
 */

#ifdef __cplusplus
	extern "C" {
#endif

#ifdef UNIX

/* Fake up poll() support on systems that only support select() */

/* Fake poll array structure */
struct pollfd {
	int fd;			/* File descriptor */
	short events;	/* Requested events */
	short revents;	/* Returned events */
};

/* Fake Poll flag values supported */
#define POLLIN	0x01
#define	POLLPRI	0x02
#define	POLLOUT	0x04

/* Timeout is in milliseconds, -1 == wait forever */
int pollem(struct pollfd fds[], unsigned long nfds, int timeout);

#define POLLEN_H
#endif /* POLLEN_H */

#endif /* UNIX */

#ifdef __cplusplus
	}
#endif