1 | /* $Id: winpoll.h 93115 2022-01-01 11:31:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * NAT Network - poll(2) for winsock, definitions and declarations.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2013-2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef VBOX_INCLUDED_SRC_NAT_winpoll_h
|
---|
19 | #define VBOX_INCLUDED_SRC_NAT_winpoll_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 | # include <iprt/cdefs.h>
|
---|
24 | /**
|
---|
25 | * WinSock2 has definition for POLL* and pollfd, but it defined for _WIN32_WINNT > 0x0600
|
---|
26 | * and used in WSAPoll, which has very unclear history.
|
---|
27 | */
|
---|
28 | # if(_WIN32_WINNT < 0x0600)
|
---|
29 | # define POLLRDNORM 0x0100
|
---|
30 | # define POLLRDBAND 0x0200
|
---|
31 | # define POLLIN (POLLRDNORM | POLLRDBAND)
|
---|
32 | # define POLLPRI 0x0400
|
---|
33 |
|
---|
34 | # define POLLWRNORM 0x0010
|
---|
35 | # define POLLOUT (POLLWRNORM)
|
---|
36 | # define POLLWRBAND 0x0020
|
---|
37 |
|
---|
38 | # define POLLERR 0x0001
|
---|
39 | # define POLLHUP 0x0002
|
---|
40 | # define POLLNVAL 0x0004
|
---|
41 |
|
---|
42 | struct pollfd {
|
---|
43 |
|
---|
44 | SOCKET fd;
|
---|
45 | SHORT events;
|
---|
46 | SHORT revents;
|
---|
47 |
|
---|
48 | };
|
---|
49 | #endif
|
---|
50 | RT_C_DECLS_BEGIN
|
---|
51 | int RTWinPoll(struct pollfd *pFds, unsigned int nfds, int timeout, int *pNready);
|
---|
52 | RT_C_DECLS_END
|
---|
53 | #endif /* !VBOX_INCLUDED_SRC_NAT_winpoll_h */
|
---|