@@ -22,13 +22,12 @@ pub struct KEvent {
22
22
target_os = "dragonfly" , target_os = "macos" ,
23
23
target_os = "ios" ) ) ]
24
24
type type_of_udata = * mut :: c_void ;
25
- #[ cfg( any( target_os = "openbsd" , target_os = "freebsd" ,
26
- target_os = "dragonfly" , target_os = "macos" ,
27
- target_os = "ios" ) ) ]
25
+ #[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ,
26
+ target_os = "macos" , target_os = "ios" ) ) ]
28
27
type type_of_data = libc:: intptr_t ;
29
28
#[ cfg( any( target_os = "netbsd" ) ) ]
30
29
type type_of_udata = intptr_t ;
31
- #[ cfg( any( target_os = "netbsd" ) ) ]
30
+ #[ cfg( any( target_os = "netbsd" , target_os = "openbsd" ) ) ]
32
31
type type_of_data = libc:: int64_t ;
33
32
34
33
#[ cfg( not( target_os = "netbsd" ) ) ]
@@ -79,16 +78,18 @@ pub enum EventFilter {
79
78
}
80
79
81
80
#[ cfg( any( target_os = "macos" , target_os = "ios" ,
82
- target_os = "freebsd" , target_os = "dragonfly" ) ) ]
81
+ target_os = "freebsd" , target_os = "dragonfly" ,
82
+ target_os = "openbsd" ) ) ]
83
83
pub type type_of_event_flag = u16 ;
84
- #[ cfg( any( target_os = "netbsd" , target_os = "openbsd" ) ) ]
84
+ #[ cfg( any( target_os = "netbsd" ) ) ]
85
85
pub type type_of_event_flag = u32 ;
86
86
libc_bitflags ! {
87
87
pub flags EventFlag : type_of_event_flag {
88
88
EV_ADD ,
89
89
EV_CLEAR ,
90
90
EV_DELETE ,
91
91
EV_DISABLE ,
92
+ #[ cfg( not( target_os = "openbsd" ) ) ]
92
93
EV_DISPATCH ,
93
94
#[ cfg( target_os = "freebsd" ) ]
94
95
EV_DROP ,
@@ -315,13 +316,13 @@ fn test_struct_kevent() {
315
316
316
317
let expected = libc:: kevent { ident : 0xdeadbeef ,
317
318
filter : libc:: EVFILT_READ ,
318
- flags : libc:: EV_DISPATCH | libc:: EV_ADD ,
319
+ flags : libc:: EV_ONESHOT | libc:: EV_ADD ,
319
320
fflags : libc:: NOTE_CHILD | libc:: NOTE_EXIT ,
320
321
data : 0x1337 ,
321
322
udata : udata as type_of_udata } ;
322
323
let actual = KEvent :: new ( 0xdeadbeef ,
323
324
EventFilter :: EVFILT_READ ,
324
- EV_DISPATCH | EV_ADD ,
325
+ EV_ONESHOT | EV_ADD ,
325
326
NOTE_CHILD | NOTE_EXIT ,
326
327
0x1337 ,
327
328
udata) ;
0 commit comments