Lines Matching +full:poll +full:- +full:only
4 Subject: [PATCH] Rename poll.h into vm_poll.h to fix build failure on musl
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 musl libc redirects include of sys/poll.h to poll.h. But since poll.h is
14 …host/i586-buildroot-linux-musl/sysroot/usr/include/sys/poll.h:1:2: warning: #warning redirecting i…
15 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
18 pfd[i].fd = asock[i]->fd;
27 So rename poll.h into vm_poll.h as suggested by srowe in
28 https://github.com/vmware/open-vm-tools/issues/359#issuecomment-533529956
31 - http://autobuild.buildroot.org/results/4f575ef42bbc4387a07e396205052b2da081c64d
35 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
36 [Upstream status: https://github.com/vmware/open-vm-tools/pull/383]
37 ---
38 lib/asyncsocket/asyncsocket.c | 4 +-
39 lib/hgfsServer/hgfsServer.c | 2 +-
40 lib/include/asyncsocket.h | 2 +-
41 lib/include/poll.h | 330 --------------------
42 lib/include/pollImpl.h | 2 +-
44 lib/rpcIn/rpcin.c | 2 +-
45 7 files changed, 336 insertions(+), 336 deletions(-)
46 delete mode 100644 open-vm-tools/lib/include/poll.h
47 create mode 100644 open-vm-tools/lib/include/vm_poll.h
49 diff --git a/lib/asyncsocket/asyncsocket.c b/lib/asyncsocket/asyncsocket.c
51 --- a/lib/asyncsocket/asyncsocket.c
53 @@ -69,8 +69,8 @@
57 +#include <poll.h>
59 -#include <sys/poll.h>
63 @@ -86,7 +86,7 @@
67 -#include "poll.h"
72 diff --git a/lib/hgfsServer/hgfsServer.c b/lib/hgfsServer/hgfsServer.c
74 --- a/lib/hgfsServer/hgfsServer.c
76 @@ -48,7 +48,7 @@
80 -#include "poll.h"
85 diff --git a/lib/include/asyncsocket.h b/lib/include/asyncsocket.h
87 --- a/lib/include/asyncsocket.h
89 @@ -164,7 +164,7 @@ typedef struct AsyncSocket AsyncSocket;
90 * Or the client can specify its favorite poll class and locking behavior.
91 * Use of IVmdbPoll is only supported for regular sockets and for Attach.
93 -#include "poll.h"
97 int flags; /* Default 0, only POLL_FLAG_NO_BULL is valid */
98 diff --git a/lib/include/poll.h b/lib/include/poll.h
101 --- a/lib/include/poll.h
103 @@ -1,330 +0,0 @@
104 -/*********************************************************
105 - * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
106 - *
107 - * This program is free software; you can redistribute it and/or modify it
108 - * under the terms of the GNU Lesser General Public License as published
109 - * by the Free Software Foundation version 2.1 and no later version.
110 - *
111 - * This program is distributed in the hope that it will be useful, but
112 - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
113 - * or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
114 - * License for more details.
115 - *
116 - * You should have received a copy of the GNU Lesser General Public License
117 - * along with this program; if not, write to the Free Software Foundation, Inc.,
118 - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
119 - *
120 - *********************************************************/
121 -
122 -/*********************************************************
123 - * The contents of this file are subject to the terms of the Common
124 - * Development and Distribution License (the "License") version 1.0
125 - * and no later version. You may not use this file except in
126 - * compliance with the License.
127 - *
128 - * You can obtain a copy of the License at
129 - * http://www.opensource.org/licenses/cddl1.php
130 - *
131 - * See the License for the specific language governing permissions
132 - * and limitations under the License.
133 - *
134 - *********************************************************/
135 -
136 -
137 -#ifndef _POLL_H_
138 -#define _POLL_H_
139 -
140 -#define INCLUDE_ALLOW_USERLEVEL
141 -#define INCLUDE_ALLOW_VMCORE
142 -#include "includeCheck.h"
143 -
144 -#include "vm_basic_types.h"
145 -#include "vm_basic_defs.h"
146 -#include "vmware.h"
147 -#include "userlock.h"
148 -
149 -#if defined(__cplusplus)
150 -extern "C" {
151 -#endif
152 -
153 -#ifdef _WIN32
154 -#define HZ 100
155 -#elif defined linux
156 -#include <asm/param.h>
157 -#elif __APPLE__
158 -#include <TargetConditionals.h>
159 -/*
160 - * Old SDKs don't define TARGET_OS_IPHONE at all.
161 - * New ones define it to 0 on Mac OS X, 1 on iOS.
162 - */
163 -#if !defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE == 0
164 -#include <sys/kernel.h>
165 -#endif
166 -#include <sys/poll.h>
167 -#define HZ 100
168 -#endif
169 -#ifdef __ANDROID__
170 -/*
171 - * <poll.h> of android should be included, but its name is same
172 - * with this file. So its content is put here to avoid conflict.
173 - */
174 -#include <asm/poll.h>
175 -#define HZ 100
176 -typedef unsigned int nfds_t;
177 -int poll(struct pollfd *, nfds_t, long);
178 -#endif
179 -
180 -
181 -/*
182 - * Poll event types: each type has a different reason for firing,
183 - * or condition that must be met before firing.
184 - */
185 -
186 -typedef enum {
187 - /*
188 - * Actual Poll queue types against which you can register callbacks.
189 - */
190 - POLL_VIRTUALREALTIME = -1, /* Negative because it doesn't have its own Q */
191 - POLL_VTIME = 0,
192 - POLL_REALTIME,
193 - POLL_DEVICE,
194 - POLL_MAIN_LOOP,
195 - POLL_NUM_QUEUES
196 -} PollEventType;
197 -
198 -
199 -/*
200 - * Classes of events
201 - *
202 - * These are the predefined classes. More can be declared
203 - * with Poll_AllocClass().
204 - */
205 -
206 -typedef enum PollClass {
207 - POLL_CLASS_MAIN,
208 - POLL_CLASS_PAUSE,
209 - POLL_CLASS_IPC,
210 - POLL_CLASS_CPT,
211 - POLL_CLASS_MKS,
212 - POLL_FIXED_CLASSES,
213 - POLL_DEFAULT_FIXED_CLASSES,
214 - /* Size enum to maximum */
215 - POLL_MAX_CLASSES = 31,
216 -} PollClass;
217 -
218 -/*
219 - * Do not use; Special pseudo private poll class supported by
220 - * PollDefault only
221 - */
222 -#define POLL_DEFAULT_CLASS_NET POLL_FIXED_CLASSES
223 -#define POLL_DEFAULT_CS_NET PollClassSet_Singleton(POLL_DEFAULT_CLASS_NET)
224 -
225 -/*
226 - * Each callback is registered in a set of classes
227 - */
228 -
229 -typedef struct PollClassSet {
230 - uintptr_t bits;
231 -} PollClassSet;
232 -
233 -/* An empty PollClassSet. */
234 -static INLINE PollClassSet
235 -PollClassSet_Empty(void)
236 -{
237 - PollClassSet set = { 0 };
238 - return set;
239 -}
240 -
241 -/* A PollClassSet with the single member. */
242 -static INLINE PollClassSet
243 -PollClassSet_Singleton(PollClass c)
244 -{
245 - PollClassSet s = PollClassSet_Empty();
246 -
247 - ASSERT_ON_COMPILE(POLL_MAX_CLASSES < sizeof s.bits * 8);
248 - ASSERT(c < POLL_MAX_CLASSES);
249 -
250 - s.bits = CONST3264U(1) << c;
251 - return s;
252 -}
253 -
254 -/* Combine two PollClassSets. */
255 -static INLINE PollClassSet
256 -PollClassSet_Union(PollClassSet lhs, PollClassSet rhs)
257 -{
258 - PollClassSet set;
259 - set.bits = lhs.bits | rhs.bits;
260 - return set;
261 -}
262 -
263 -/* Add single class to PollClassSet. */
264 -static INLINE PollClassSet
265 -PollClassSet_Include(PollClassSet set, PollClass c)
266 -{
267 - return PollClassSet_Union(set, PollClassSet_Singleton(c));
268 -}
269 -
270 -
271 -#define POLL_CS_MAIN PollClassSet_Singleton(POLL_CLASS_MAIN)
272 -#define POLL_CS_PAUSE PollClassSet_Union(POLL_CS_MAIN, \
273 - PollClassSet_Singleton(POLL_CLASS_PAUSE))
274 -#define POLL_CS_CPT PollClassSet_Union(POLL_CS_PAUSE, \
275 - PollClassSet_Singleton(POLL_CLASS_CPT))
276 -#define POLL_CS_IPC PollClassSet_Union(POLL_CS_CPT, \
277 - PollClassSet_Singleton(POLL_CLASS_IPC))
278 -#define POLL_CS_VMDB POLL_CS_PAUSE /* POLL_CLASS_VMDB is retired */
279 -#define POLL_CS_MKS PollClassSet_Singleton(POLL_CLASS_MKS)
280 -/*
281 - * DANGER. You don't need POLL_CS_ALWAYS. Really. So don't use it.
282 - */
283 -#define POLL_CS_ALWAYS PollClassSet_Union(POLL_CS_CPT, POLL_CS_IPC)
284 -
285 -/*
286 - * Poll class-set taxonomy:
287 - * POLL_CS_MAIN
288 - * - Unless you NEED another class, use POLL_CS_MAIN.
289 - * POLL_CS_PAUSE
290 - * - For callbacks that must occur even if the guest is paused.
291 - * Most VMDB or Foundry commands are in this category.
292 - * POLL_CS_CPT
293 - * - Only for callbacks which can trigger intermediate Checkpoint
294 - * transitions.
295 - * The ONLY such callback is Migrate.
296 - * POLL_CS_IPC
297 - * - Only for callbacks which can contain Msg_(Post|Hint|Question)
298 - * responses, and for signal handlers (why)?
299 - * Vigor, VMDB, and Foundry can contain Msg_* responses.
300 - * POLL_CS_MKS
301 - * - Callback runs in MKS thread.
302 - * POLL_CS_ALWAYS
303 - * - Only for events that must be processed immediately.
304 - * The ONLY such callback is OvhdMemVmxSizeCheck.
305 - */
306 -
307 -
308 -/*
309 - * Poll_Callback flags
310 - */
311 -
312 -#define POLL_FLAG_PERIODIC 0x01 // keep after firing
313 -#define POLL_FLAG_REMOVE_AT_POWEROFF 0x02 // self-explanatory
314 -#define POLL_FLAG_READ 0x04 // device is ready for reading
315 -#define POLL_FLAG_WRITE 0x08 // device is ready for writing
316 -#define POLL_FLAG_SOCKET 0x10 // device is a Windows socket
317 -#define POLL_FLAG_NO_BULL 0x20 // callback does its own locking
318 -#define POLL_FLAG_WINSOCK 0x40 // Winsock style write events
319 -#define POLL_FLAG_FD 0x80 // device is a Windows file descriptor.
320 -#define POLL_FLAG_ACCEPT_INVALID_FDS 0x100 // For broken 3rd party libs, e.g. curl
321 -#define POLL_FLAG_THUNK_TO_WND 0x200 // thunk callback to window message loop
322 -
323 -
324 -typedef void (*PollerFunction)(void *clientData);
325 -typedef void (*PollerFireWrapper)(PollerFunction func,
326 - void *funcData,
327 - void *wrapperData);
328 -typedef Bool (*PollerErrorFn)(const char *errorStr);
329 -
330 -/*
331 - * Initialisers:
332 - *
333 - * For the sake of convenience, we declare the initialisers
334 - * for custom implmentations here, even though the actual
335 - * implementations are distinct from the core poll code.
336 - */
337 -
338 -typedef struct PollOptions {
339 - Bool locked; // Use internal MXUser for locking
340 - Bool allowFullQueue; // Don't assert when device event queue is full.
341 - VThreadID windowsMsgThread; // thread that processes Windows messages
342 - PollerFireWrapper fireWrapperFn; // optional; may be useful for stats
343 - void *fireWrapperData; // optional
344 - PollerErrorFn errorFn; // optional; called upon unrecoverable error
345 -} PollOptions;
346 -
347 -
348 -void Poll_InitDefault(void);
349 -void Poll_InitDefaultEx(const PollOptions *opts);
350 -void Poll_InitGtk(void); // On top of glib for Linux
351 -void Poll_InitCF(void); // On top of CoreFoundation for OSX
352 -
353 -
354 -/*
355 - * Functions
356 - */
357 -int Poll_SocketPair(Bool vmci, Bool stream, int fds[2]);
358 -void Poll_Loop(Bool loop, Bool *exit, PollClass c);
359 -void Poll_LoopTimeout(Bool loop, Bool *exit, PollClass c, int timeout);
360 -Bool Poll_LockingEnabled(void);
361 -void Poll_Exit(void);
362 -
363 -
364 -/*
365 - * Poll_Callback adds a callback regardless of whether an identical one exists.
366 - * The exception to this rule is POLL_DEVICE callbacks: there is a maximum of
367 - * one read and one write callback per fd.
368 - *
369 - * Poll_CallbackRemove removes one callback. If there are multiple identical
370 - * callbacks, which one is removed is an implementation detail. Note that in
371 - * the case of POLL_DEVICE and POLL_REALTIME callbacks, the fd/delay used to
372 - * create the callback is not specified when removing, so all callbacks
373 - * of those types with the same flags, function, and clientData are considered
374 - * "identical" even if their fd/delay differed.
375 - */
376 -
377 -VMwareStatus Poll_Callback(PollClassSet classSet,
378 - int flags,
379 - PollerFunction f,
380 - void *clientData,
381 - PollEventType type,
382 - PollDevHandle info, // fd/microsec delay
383 - MXUserRecLock *lck);
384 -Bool Poll_CallbackRemove(PollClassSet classSet,
385 - int flags,
386 - PollerFunction f,
387 - void *clientData,
388 - PollEventType type);
389 -Bool Poll_CallbackRemoveOneByCB(PollClassSet classSet,
390 - int flags,
391 - PollerFunction f,
392 - PollEventType type,
393 - void **clientData);
394 -
395 -void Poll_NotifyChange(PollClassSet classSet);
396 -
397 -/*
398 - * Wrappers for Poll_Callback and Poll_CallbackRemove that present
399 - * simpler subsets of those interfaces.
400 - */
401 -
402 -VMwareStatus Poll_CB_Device(PollerFunction f,
403 - void *clientData,
404 - PollDevHandle device,
405 - Bool periodic);
406 -
407 -Bool Poll_CB_DeviceRemove(PollerFunction f,
408 - void *clientData,
409 - Bool periodic);
410 -
411 -
412 -VMwareStatus Poll_CB_RTime(PollerFunction f,
413 - void *clientData,
414 - int64 delay, // microseconds
415 - Bool periodic,
416 - MXUserRecLock *lock);
417 -
418 -Bool Poll_CB_RTimeRemove(PollerFunction f,
419 - void *clientData,
420 - Bool periodic);
421 -
422 -
423 -#ifdef _WIN32
424 -void Poll_SetPumpsWindowsMessages(Bool pumps);
425 -void Poll_SetWindowMessageRecipient(HWND hWnd, UINT msg, Bool alwaysThunk);
426 -Bool Poll_FireWndCallback(void *lparam);
427 -#endif
428 -
429 -#if defined(__cplusplus)
430 -} // extern "C"
431 -#endif
432 -
433 -#endif // _POLL_H_
434 diff --git a/lib/include/pollImpl.h b/lib/include/pollImpl.h
436 --- a/lib/include/pollImpl.h
438 @@ -44,7 +44,7 @@
442 -#include "poll.h"
447 diff --git a/lib/include/vm_poll.h b/lib/include/vm_poll.h
450 --- /dev/null
452 @@ -0,0 +1,330 @@
454 + * Copyright (C) 1998-2018 VMware, Inc. All rights reserved.
467 + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
515 +#include <sys/poll.h>
520 + * <poll.h> of android should be included, but its name is same
523 +#include <asm/poll.h>
526 +int poll(struct pollfd *, nfds_t, long);
531 + * Poll event types: each type has a different reason for firing,
537 + * Actual Poll queue types against which you can register callbacks.
539 + POLL_VIRTUALREALTIME = -1, /* Negative because it doesn't have its own Q */
568 + * Do not use; Special pseudo private poll class supported by
569 + * PollDefault only
635 + * Poll class-set taxonomy:
637 + * - Unless you NEED another class, use POLL_CS_MAIN.
639 + * - For callbacks that must occur even if the guest is paused.
642 + * - Only for callbacks which can trigger intermediate Checkpoint
644 + * The ONLY such callback is Migrate.
646 + * - Only for callbacks which can contain Msg_(Post|Hint|Question)
650 + * - Callback runs in MKS thread.
652 + * - Only for events that must be processed immediately.
653 + * The ONLY such callback is OvhdMemVmxSizeCheck.
662 +#define POLL_FLAG_REMOVE_AT_POWEROFF 0x02 // self-explanatory
684 + * implementations are distinct from the core poll code.
783 diff --git a/lib/rpcIn/rpcin.c b/lib/rpcIn/rpcin.c
785 --- a/lib/rpcIn/rpcin.c
787 @@ -57,7 +57,7 @@
791 -# include "poll.h"
796 --