Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
shrapnel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
shrapnel
Commits
ca985e96
Commit
ca985e96
authored
Jan 31, 2013
by
Sam Rushing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transition away from ironport's libc.pxd to the ones distributed with Cython
parent
3f60ee5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
coro/linux_poller.pyx
coro/linux_poller.pyx
+8
-6
No files found.
coro/linux_poller.pyx
View file @
ca985e96
...
...
@@ -28,8 +28,10 @@ __poller_version__ = "$Id"
# epoll
# ================================================================================
from
libc
cimport
uint64_t
,
uint32_t
from
libc
cimport
uint64_t
from
libc.stdint
cimport
uint64_t
,
uint32_t
from
libc
cimport
unistd
from
libc
cimport
errno
from
xlibc.stdlib
cimport
alloca
cdef
extern
from
"sys/time.h"
:
cdef
struct
timespec
:
...
...
@@ -186,7 +188,7 @@ cdef public class queue_poller [ object queue_poller_object, type queue_poller_t
cdef
tear_down
(
self
):
if
self
.
ep_fd
!=
-
1
:
libc
.
close
(
self
.
ep_fd
)
unistd
.
close
(
self
.
ep_fd
)
self
.
ep_fd
=
-
1
cdef
object
set_wait_for
(
self
,
event_key
ek
):
...
...
@@ -255,7 +257,7 @@ cdef public class queue_poller [ object queue_poller_object, type queue_poller_t
)
# if fd doesn't exist in epoll, add it
if
r
==
-
1
and
(
libc
.
errno
==
libc
.
ENOENT
):
if
r
==
-
1
and
(
errno
.
errno
==
errno
.
ENOENT
):
r
=
epoll_ctl
(
self
.
ep_fd
,
EPOLL_CTL_ADD
,
...
...
@@ -263,7 +265,7 @@ cdef public class queue_poller [ object queue_poller_object, type queue_poller_t
&
org_e
)
if
r
==
-
1
and
(
libc
.
errno
!=
libc
.
EEXIST
):
if
r
==
-
1
and
(
errno
.
errno
!=
errno
.
EEXIST
):
raise_oserror
()
cdef
_wait_for_with_eof
(
self
,
int
fd
,
int
events
):
...
...
@@ -320,7 +322,7 @@ cdef public class queue_poller [ object queue_poller_object, type queue_poller_t
cdef
event_key
ek
cdef
py_event
_py_event
ts
.
tv_sec
,
ts
.
tv_nsec
=
timeout
events
=
<
epoll_event
*>
libc
.
alloca
(
sizeof
(
epoll_event
)
*
nevents
)
events
=
<
epoll_event
*>
alloca
(
sizeof
(
epoll_event
)
*
nevents
)
r
=
epoll_wait
(
self
.
ep_fd
,
events
,
nevents
,
timeout
[
0
]
*
SECS_TO_MILLISECS
+
(
timeout
[
1
]
/
NSECS_TO_MILLISECS
))
#W ('{%d}' % (r,))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment