summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authoririri <iri@konnichiwastevenspielbergde.su>2018-08-18 16:17:42 -0700
committerOri Bernstein <ori@eigenstate.org>2018-08-19 18:07:14 -0700
commit2fca1caa1935baf0473efc367e24dab57c52517d (patch)
tree5cd9aed3925ff4de81884a357b834bb5330a88a3 /support
parent0bb2378d7e2b714998b34394f6977b2ead023d6c (diff)
downloadmc-2fca1caa1935baf0473efc367e24dab57c52517d.tar.gz
Fix futex timeouts and handle futex error codes.
Diffstat (limited to 'support')
-rw-r--r--support/syscall-gen/specials+freebsd-x64.frag1
-rw-r--r--support/syscall-gen/specials+linux-x64.frag4
-rw-r--r--support/syscall-gen/types+freebsd-x64.frag7
-rw-r--r--support/syscall-gen/types+linux-x64.frag2
4 files changed, 12 insertions, 2 deletions
diff --git a/support/syscall-gen/specials+freebsd-x64.frag b/support/syscall-gen/specials+freebsd-x64.frag
index 82b3c31..de5cfa4 100644
--- a/support/syscall-gen/specials+freebsd-x64.frag
+++ b/support/syscall-gen/specials+freebsd-x64.frag
@@ -65,6 +65,7 @@
const mmap : (addr:byte#, len:size, prot:mprot, flags:mopt, fd:fd, off:off -> byte#)
/* time - doublecheck if this is right */
+ const clockid : (clk : clock -> uint64)
const clock_getres : (clk : clock, ts : timespec# -> int32)
const clock_gettime : (clk : clock, ts : timespec# -> int32)
const clock_settime : (clk : clock, ts : timespec# -> int32)
diff --git a/support/syscall-gen/specials+linux-x64.frag b/support/syscall-gen/specials+linux-x64.frag
index de2ce27..6f8b806 100644
--- a/support/syscall-gen/specials+linux-x64.frag
+++ b/support/syscall-gen/specials+linux-x64.frag
@@ -62,7 +62,7 @@ const dup2 : (src : fd, dst : fd -> fd)
/* threading */
const futex : (uaddr : int32#, op : futexop, val : int32, \
- timeout : timespec#, uaddr2 : int32#, val3 : int32 -> int64)
+ timeout : timespec#, uaddr2 : int32#, val3 : int32 -> int)
const semctl : (semid : int, semnum : int, cmd : int, arg : void# -> int)
/* polling */
@@ -205,7 +205,7 @@ const sigprocmask = {sig, act, oact; -> (syscall(Sysrt_sigprocmask, a(sig), a(ac
/* threading */
const futex = {uaddr, op, val, timeout, uaddr2, val3
- -> syscall(Sysfutex, a(uaddr), a(op), a(val), a(timeout), a(uaddr2), a(val3))
+ -> (syscall(Sysfutex, a(uaddr), a(op), a(val), a(timeout), a(uaddr2), a(val3)) : int)
}
const semctl = {semid, semnum, cmd, arg
-> (syscall(Syssemctl, a(semnum), a(cmd), a(arg)) : int)
diff --git a/support/syscall-gen/types+freebsd-x64.frag b/support/syscall-gen/types+freebsd-x64.frag
index 9bae305..f899053 100644
--- a/support/syscall-gen/types+freebsd-x64.frag
+++ b/support/syscall-gen/types+freebsd-x64.frag
@@ -575,6 +575,13 @@ type uuid = struct
node : uint8[_Uuidnodesz];
;;
+const Umtxabstime = 1
+type umtx_time = struct
+ timeout : timespec
+ flags : uint32
+ clockid : uint32
+;;
+
/* open options */
const Ordonly : fdopt = 0x0
const Owronly : fdopt = 0x1
diff --git a/support/syscall-gen/types+linux-x64.frag b/support/syscall-gen/types+linux-x64.frag
index 13d95aa..9e90a5a 100644
--- a/support/syscall-gen/types+linux-x64.frag
+++ b/support/syscall-gen/types+linux-x64.frag
@@ -556,6 +556,8 @@ const Futexcmprequeuepi : futexop = 12
const Futexpriv : futexop = 128
const Futexclockrt : futexop = 256
+const Futexbitsetmatchany : int32 = -1
+
/* poll events : posix */
const Pollin : pollevt = 0x001 /* There is data to read. */
const Pollpri : pollevt = 0x002 /* There is urgent data to read. */