patches/uClibc/0.9.29/110-conditional-sched_affinity.patch
author Johannes Stezenbach <js@sig21.net>
Tue Oct 30 00:22:25 2012 +0000 (2012-10-30)
changeset 3097 5c67476c7342
parent 108 69407950a2a2
permissions -rw-r--r--
scripts/functions: fix endless loop in debug-shell with IO redirection

CT_DEBUG_INTERACTIVE is disabled when stdin, stdout or
stderr are redirected, but the check is only done at
the start of the build and doesn't catch when individual
build commands use redirection. When stdin is redirected
it will cause the debug shell to exit immediately, causing
and endless loop. Thus, save the stdin/our/err file handles
and restore them before invoking the debug shell.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Message-Id: <20121030102225.GA8303@sig21.net>
Patchwork-Id: 195409
yann@108
     1
diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c
yann@108
     2
--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_getaffinity.c	2007-02-12 16:52:32.000000000 -0600
yann@108
     3
+++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_getaffinity.c	2007-05-09 18:05:09.397411811 -0500
yann@108
     4
@@ -29,6 +29,7 @@
yann@108
     5
 #include <sys/param.h>
yann@108
     6
 #include <sys/types.h>
yann@108
     7
 
yann@108
     8
+#ifdef __NR_sched_getaffinity
yann@108
     9
 libc_hidden_proto(memset)
yann@108
    10
 
yann@108
    11
 #define __NR___syscall_sched_getaffinity __NR_sched_getaffinity
yann@108
    12
@@ -48,5 +49,15 @@
yann@108
    13
 	}
yann@108
    14
 	return res;
yann@108
    15
 }
yann@108
    16
+#else
yann@108
    17
+/*
yann@108
    18
+int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *cpuset)
yann@108
    19
+{
yann@108
    20
+	__set_errno(ENOSYS);
yann@108
    21
+	return -1;
yann@108
    22
+}
yann@108
    23
+*/
yann@108
    24
 #endif
yann@108
    25
 #endif
yann@108
    26
+
yann@108
    27
+#endif
yann@108
    28
diff -ur uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c
yann@108
    29
--- uClibc-0.9.29/libc/sysdeps/linux/common/sched_setaffinity.c	2007-02-12 16:52:32.000000000 -0600
yann@108
    30
+++ uClibc-0.9.29-patched/libc/sysdeps/linux/common/sched_setaffinity.c	2007-05-09 18:05:09.397411811 -0500
yann@108
    31
@@ -31,6 +31,7 @@
yann@108
    32
 #include <sys/types.h>
yann@108
    33
 #include <alloca.h>
yann@108
    34
 
yann@108
    35
+#ifdef __NR_sched_setaffinity
yann@108
    36
 libc_hidden_proto(getpid)
yann@108
    37
 
yann@108
    38
 #define __NR___syscall_sched_setaffinity __NR_sched_setaffinity
yann@108
    39
@@ -74,5 +75,14 @@
yann@108
    40
 
yann@108
    41
 	return INLINE_SYSCALL (sched_setaffinity, 3, pid, cpusetsize, cpuset);
yann@108
    42
 }
yann@108
    43
+#else
yann@108
    44
+/*
yann@108
    45
+int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *cpuset)
yann@108
    46
+{
yann@108
    47
+	__set_errno(ENOSYS);
yann@108
    48
+	return -1;
yann@108
    49
+}
yann@108
    50
+*/
yann@108
    51
+#endif
yann@108
    52
 #endif
yann@108
    53
 #endif