Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixmoebius
libc
Commits
c5712f06
Commit
c5712f06
authored
4 years ago
by
felixmoebius
Browse files
Options
Downloads
Patches
Plain Diff
Add kqueue bindings
parent
33ee444f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/unix/unikraft/mod.rs
+51
-0
51 additions, 0 deletions
src/unix/unikraft/mod.rs
with
51 additions
and
0 deletions
src/unix/unikraft/mod.rs
+
51
−
0
View file @
c5712f06
...
...
@@ -489,8 +489,48 @@ s! {
pub
struct
termios
{}
pub
struct
utsname
{}
// kqueue
pub
struct
kevent
{
pub
ident
:
::
uintptr_t
,
pub
filter
:
::
c_short
,
pub
flags
:
::
c_ushort
,
pub
fflags
:
::
c_uint
,
pub
data
:
::
intptr_t
,
pub
udata
:
*
mut
::
c_void
,
pub
ext
:
[
u64
;
4
],
}
}
// kqueue
pub
const
EV_ADD
:
u16
=
0x1
;
pub
const
EV_DELETE
:
u16
=
0x2
;
pub
const
EV_ENABLE
:
u16
=
0x4
;
pub
const
EV_DISABLE
:
u16
=
0x8
;
pub
const
EV_ONESHOT
:
u16
=
0x10
;
pub
const
EV_CLEAR
:
u16
=
0x20
;
pub
const
EV_RECEIPT
:
u16
=
0x40
;
pub
const
EV_DISPATCH
:
u16
=
0x80
;
pub
const
EV_DROP
:
u16
=
0x1000
;
pub
const
EV_FLAG1
:
u16
=
0x2000
;
pub
const
EV_ERROR
:
u16
=
0x4000
;
pub
const
EV_EOF
:
u16
=
0x8000
;
pub
const
EV_SYSFLAGS
:
u16
=
0xf000
;
pub
const
EVFILT_READ
:
i16
=
-
1
;
pub
const
EVFILT_WRITE
:
i16
=
-
2
;
pub
const
EVFILT_AIO
:
i16
=
-
3
;
pub
const
EVFILT_VNODE
:
i16
=
-
4
;
pub
const
EVFILT_PROC
:
i16
=
-
5
;
pub
const
EVFILT_SIGNAL
:
i16
=
-
6
;
pub
const
EVFILT_TIMER
:
i16
=
-
7
;
pub
const
EVFILT_PROCDESC
:
i16
=
-
8
;
pub
const
EVFILT_FS
:
i16
=
-
9
;
pub
const
EVFILT_LIO
:
i16
=
-
10
;
pub
const
EVFILT_USER
:
i16
=
-
11
;
pub
const
EVFILT_SENDFILE
:
i16
=
-
12
;
pub
const
EVFILT_EMPTY
:
i16
=
-
13
;
// Unchecked
pub
const
GRND_NONBLOCK
:
::
c_uint
=
0x0001
;
pub
const
SYS_getrandom
:
::
c_long
=
318
;
...
...
@@ -1098,4 +1138,15 @@ extern "C" {
attr
:
*
mut
pthread_condattr_t
,
clock_id
:
::
clockid_t
,
)
->
::
c_int
;
// kqueue
pub
fn
kqueue
()
->
::
c_int
;
pub
fn
kevent
(
kq
:
::
c_int
,
changelist
:
*
const
::
kevent
,
nchanges
:
::
c_int
,
eventlist
:
*
mut
::
kevent
,
nevents
:
::
c_int
,
timeout
:
*
const
::
timespec
,
)
->
::
c_int
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment