17777dab0Sopenharmony_ci/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
27777dab0Sopenharmony_ci *
37777dab0Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a copy
47777dab0Sopenharmony_ci * of this software and associated documentation files (the "Software"), to
57777dab0Sopenharmony_ci * deal in the Software without restriction, including without limitation the
67777dab0Sopenharmony_ci * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
77777dab0Sopenharmony_ci * sell copies of the Software, and to permit persons to whom the Software is
87777dab0Sopenharmony_ci * furnished to do so, subject to the following conditions:
97777dab0Sopenharmony_ci *
107777dab0Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
117777dab0Sopenharmony_ci * all copies or substantial portions of the Software.
127777dab0Sopenharmony_ci *
137777dab0Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
147777dab0Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
157777dab0Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
167777dab0Sopenharmony_ci * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
177777dab0Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
187777dab0Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
197777dab0Sopenharmony_ci * IN THE SOFTWARE.
207777dab0Sopenharmony_ci */
217777dab0Sopenharmony_ci
227777dab0Sopenharmony_ci#ifndef UV_DARWIN_H
237777dab0Sopenharmony_ci#define UV_DARWIN_H
247777dab0Sopenharmony_ci
257777dab0Sopenharmony_ci#if defined(__APPLE__) && defined(__MACH__)
267777dab0Sopenharmony_ci# include <mach/mach.h>
277777dab0Sopenharmony_ci# include <mach/task.h>
287777dab0Sopenharmony_ci# include <mach/semaphore.h>
297777dab0Sopenharmony_ci# include <TargetConditionals.h>
307777dab0Sopenharmony_ci# define UV_PLATFORM_SEM_T semaphore_t
317777dab0Sopenharmony_ci#endif
327777dab0Sopenharmony_ci
337777dab0Sopenharmony_ci#define UV_IO_PRIVATE_PLATFORM_FIELDS                                         \
347777dab0Sopenharmony_ci  int rcount;                                                                 \
357777dab0Sopenharmony_ci  int wcount;                                                                 \
367777dab0Sopenharmony_ci
377777dab0Sopenharmony_ci#define UV_PLATFORM_LOOP_FIELDS                                               \
387777dab0Sopenharmony_ci  uv_thread_t cf_thread;                                                      \
397777dab0Sopenharmony_ci  void* _cf_reserved;                                                         \
407777dab0Sopenharmony_ci  void* cf_state;                                                             \
417777dab0Sopenharmony_ci  uv_mutex_t cf_mutex;                                                        \
427777dab0Sopenharmony_ci  uv_sem_t cf_sem;                                                            \
437777dab0Sopenharmony_ci  void* cf_signals[2];                                                        \
447777dab0Sopenharmony_ci
457777dab0Sopenharmony_ci#define UV_PLATFORM_FS_EVENT_FIELDS                                           \
467777dab0Sopenharmony_ci  uv__io_t event_watcher;                                                     \
477777dab0Sopenharmony_ci  char* realpath;                                                             \
487777dab0Sopenharmony_ci  int realpath_len;                                                           \
497777dab0Sopenharmony_ci  int cf_flags;                                                               \
507777dab0Sopenharmony_ci  uv_async_t* cf_cb;                                                          \
517777dab0Sopenharmony_ci  void* cf_events[2];                                                         \
527777dab0Sopenharmony_ci  void* cf_member[2];                                                         \
537777dab0Sopenharmony_ci  int cf_error;                                                               \
547777dab0Sopenharmony_ci  uv_mutex_t cf_mutex;                                                        \
557777dab0Sopenharmony_ci
567777dab0Sopenharmony_ci#define UV_STREAM_PRIVATE_PLATFORM_FIELDS                                     \
577777dab0Sopenharmony_ci  void* select;                                                               \
587777dab0Sopenharmony_ci
597777dab0Sopenharmony_ci#define UV_HAVE_KQUEUE 1
607777dab0Sopenharmony_ci
617777dab0Sopenharmony_ci#endif /* UV_DARWIN_H */
62