aboutsummaryrefslogtreecommitdiffstats
path: root/main/musl/0018-fix-clock_nanosleep-error-case.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-11-01 10:29:29 +0200
committerTimo Teräs <timo.teras@iki.fi>2016-11-01 13:31:02 +0200
commit746dedd0692115e85edce087178d57893632fd16 (patch)
tree7fc50cca5e20fbfcacf2f60354146cfe921ca794 /main/musl/0018-fix-clock_nanosleep-error-case.patch
parent7171b9d299ed161ae8d0065ac7adc4cc8dadfd39 (diff)
downloadaports-746dedd0692115e85edce087178d57893632fd16.tar.bz2
aports-746dedd0692115e85edce087178d57893632fd16.tar.xz
main/musl: cherry-pick various upstream fixes, add pthread_set_attr_default_np
Diffstat (limited to 'main/musl/0018-fix-clock_nanosleep-error-case.patch')
-rw-r--r--main/musl/0018-fix-clock_nanosleep-error-case.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/main/musl/0018-fix-clock_nanosleep-error-case.patch b/main/musl/0018-fix-clock_nanosleep-error-case.patch
new file mode 100644
index 0000000000..eaa61c9f8d
--- /dev/null
+++ b/main/musl/0018-fix-clock_nanosleep-error-case.patch
@@ -0,0 +1,31 @@
+From 3ca2d2d4aef910663785fe232d7d2127a22d8a84 Mon Sep 17 00:00:00 2001
+From: Daniel Sabogal <dsabogalcc@gmail.com>
+Date: Sat, 17 Sep 2016 12:05:45 -0400
+Subject: [PATCH 18/25] fix clock_nanosleep error case
+
+posix requires that EINVAL be returned if the first parameter specifies
+the cpu-time clock of the calling thread (CLOCK_THREAD_CPUTIME_ID).
+linux returns ENOTSUP instead so we handle this.
+---
+ src/time/clock_nanosleep.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/src/time/clock_nanosleep.c b/src/time/clock_nanosleep.c
+index ec87b9e..9e4d9f1 100644
+--- a/src/time/clock_nanosleep.c
++++ b/src/time/clock_nanosleep.c
+@@ -1,8 +1,10 @@
+ #include <time.h>
++#include <errno.h>
+ #include "syscall.h"
+ #include "libc.h"
+
+ int clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem)
+ {
+- return -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem);
++ int r = -__syscall_cp(SYS_clock_nanosleep, clk, flags, req, rem);
++ return clk == CLOCK_THREAD_CPUTIME_ID ? EINVAL : r;
+ }
+--
+2.10.1
+