“96c51ce94e8415d2dfb08358bbd50e1589111f33”上不存在“block/cfq-iosched.c”
提交 6871fd77 编写于 作者: R Rich Felker

make sigaltstack work (missing macros in signal.h, error conditions)

上级 1b538acb
...@@ -131,6 +131,8 @@ struct __siginfo ...@@ -131,6 +131,8 @@ struct __siginfo
#define POLL_HUP 6 #define POLL_HUP 6
#define SS_ONSTACK 1 #define SS_ONSTACK 1
#define SS_DISABLE 2 #define SS_DISABLE 2
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192
#endif #endif
#define SA_NOCLDSTOP 1 #define SA_NOCLDSTOP 1
......
...@@ -137,6 +137,8 @@ struct __siginfo ...@@ -137,6 +137,8 @@ struct __siginfo
#define POLL_HUP 6 #define POLL_HUP 6
#define SS_ONSTACK 1 #define SS_ONSTACK 1
#define SS_DISABLE 2 #define SS_DISABLE 2
#define MINSIGSTKSZ 2048
#define SIGSTKSZ 8192
#endif #endif
#define SA_NOCLDSTOP 1 #define SA_NOCLDSTOP 1
......
#include <signal.h> #include <signal.h>
#include <errno.h>
#include "syscall.h" #include "syscall.h"
int sigaltstack(const stack_t *ss, stack_t *old) int sigaltstack(const stack_t *ss, stack_t *old)
{ {
/* depends on kernel struct matching */ if (ss) {
if (ss->ss_size < MINSIGSTKSZ) {
errno = ENOMEM;
return -1;
}
if (ss->ss_flags & ~SS_DISABLE) {
errno = EINVAL;
return -1;
}
}
return syscall2(__NR_sigaltstack, (long)ss, (long)old); return syscall2(__NR_sigaltstack, (long)ss, (long)old);
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册