]> git.saurik.com Git - apple/xnu.git/blob - bsd/sys/ev.h
484a3e0b3f670f4700070c43599419a7be207f32
[apple/xnu.git] / bsd / sys / ev.h
1 /*
2 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /* Copyright (c) 1998 Apple Computer, Inc. All rights reserved */
24
25 #ifndef _SYS_EV_H_
26 #define _SYS_EV_H_
27
28 #if !defined(__LP64__)
29
30 #include <sys/appleapiopts.h>
31
32 #include <sys/queue.h>
33 #include <sys/cdefs.h>
34
35 struct eventreq {
36 int er_type;
37 #define EV_FD 1 // file descriptor
38 int er_handle;
39 void *er_data;
40 int er_rcnt;
41 int er_wcnt;
42 int er_ecnt;
43 int er_eventbits;
44 #define EV_RE 1
45 #define EV_WR 2
46 #define EV_EX 4
47 #define EV_RM 8
48 #define EV_MASK 0xf
49 };
50
51 typedef struct eventreq *er_t;
52
53 #define EV_RBYTES 0x100
54 #define EV_WBYTES 0x200
55 #define EV_RWBYTES (EV_RBYTES|EV_WBYTES)
56 #define EV_RCLOSED 0x400
57 #define EV_RCONN 0x800
58 #define EV_WCLOSED 0x1000
59 #define EV_WCONN 0x2000
60 #define EV_OOB 0x4000
61 #define EV_FIN 0x8000
62 #define EV_RESET 0x10000
63 #define EV_TIMEOUT 0x20000
64 #define EV_DMASK 0xffffff00
65
66 #ifdef BSD_KERNEL_PRIVATE
67
68 struct eventqelt {
69 TAILQ_ENTRY(eventqelt) ee_slist;
70 TAILQ_ENTRY(eventqelt) ee_plist;
71 struct eventreq ee_req;
72 struct proc * ee_proc;
73 u_int ee_flags;
74 #define EV_QUEUED 0x01
75 u_int ee_eventmask;
76 };
77
78 int waitevent_close(struct proc *p, struct fileproc *);
79 #endif /* BSD_KERNEL_PRIVATE */
80
81 #endif /* !defined(__LP64__) */
82
83 #endif /* _SYS_EV_H_ */