ref: 6d4651504d015f853c5ce79e77c73b5b8d48793f
parent: 1f560efbdc3dbcd66c71489dd66182ab90353f5c
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Jul 8 18:56:07 EDT 2015
Add futex syscall. Motion towards libthread.
--- a/libstd/sys+linux-x64.myr
+++ b/libstd/sys+linux-x64.myr
@@ -623,6 +623,10 @@
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 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)}