summaryrefslogtreecommitdiff
path: root/libstd
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-07-08 22:56:07 -0700
committerOri Bernstein <ori@eigenstate.org>2015-07-08 22:56:07 -0700
commit6d4651504d015f853c5ce79e77c73b5b8d48793f (patch)
tree026e5c3e96077726f546c3f56816a1567a9f3675 /libstd
parent1f560efbdc3dbcd66c71489dd66182ab90353f5c (diff)
downloadmc-6d4651504d015f853c5ce79e77c73b5b8d48793f.tar.gz
Add futex syscall.
Motion towards libthread.
Diffstat (limited to 'libstd')
-rw-r--r--libstd/sys+linux-x64.myr10
1 files changed, 9 insertions, 1 deletions
diff --git a/libstd/sys+linux-x64.myr b/libstd/sys+linux-x64.myr
index de2d1e8..4860120 100644
--- a/libstd/sys+linux-x64.myr
+++ b/libstd/sys+linux-x64.myr
@@ -623,6 +623,10 @@ pkg sys =
const dup : (fd : fd -> fd)
const dup2 : (src : fd, dst : fd -> fd)
+ /* threading */
+ const futex : (uaddr : int32#, op : int32, val : int32, \
+ ts : timespec#, uaddr2 : int#, val3 : int# -> int64)
+
/* polling */
const epollcreate : (flg : epollflags -> fd) /* actually epoll_create1 */
const epollctl : (epfd : fd, op : int, fd : fd, evt : epollevt# -> int)
@@ -742,7 +746,11 @@ const pipe = {fds; -> syscall(Syspipe, a(fds))}
const dup = {fd; -> syscall(Sysdup, a(fd)) castto(fd)}
const dup2 = {src, dst; -> syscall(Sysdup2, a(src), a(dst)) castto(fd)}
-/* epoll */
+/* threading */
+const futex = {uaddr, op, val, timeout, uaddr2, val3
+ -> syscall(Sysfutex, a(uaddr), a(op), a(val), a(timeout), a(uaddr2), a(val3))}
+
+/* poll */
const poll = {pfd, timeout; -> syscall(Syspoll, pfd castto(pollfd#), a(pfd.len), a(timeout)) castto(int)}
const epollctl = {epfd, op, fd, evt;
-> syscall(Sysepoll_ctl, a(epfd), a(op), a(fd), a(evt)) castto(int)}