DECL_TEMPLATE(darwin, issetugid); // 327
DECL_TEMPLATE(darwin, __pthread_kill); // 328
DECL_TEMPLATE(darwin, __pthread_sigmask); // 329
-// NYI __sigwait 330
+DECL_TEMPLATE(darwin, __sigwait); // 330
DECL_TEMPLATE(darwin, __disable_threadsignal); // 331
DECL_TEMPLATE(darwin, __pthread_markcancel); // 332
DECL_TEMPLATE(darwin, __pthread_canceled); // 333
}
+// SYS___sigwait 330
+// int sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait);
+PRE(__sigwait)
+{
+ *flags |= SfMayBlock;
+ PRINT("sys_sigwait ( %#" FMT_REGWORD "x, %#" FMT_REGWORD "x )",
+ ARG1,ARG2);
+ PRE_REG_READ2(int, "sigwait",
+ const vki_sigset_t *, set, int *, sig);
+ if (ARG1 != 0) {
+ PRE_MEM_READ( "sigwait(set)", ARG1, sizeof(vki_sigset_t));
+ }
+ if (ARG2 != 0) {
+ PRE_MEM_WRITE( "sigwait(sig)", ARG2, sizeof(int));
+ }
+}
+
+POST(__sigwait)
+{
+ if (ARG2 != 0) {
+ POST_MEM_WRITE( ARG2, sizeof(int));
+ }
+}
+
PRE(__pthread_canceled)
{
*flags |= SfMayBlock; /* might kill this thread??? */
MACX_(__NR_issetugid, issetugid),
MACX_(__NR___pthread_kill, __pthread_kill),
MACX_(__NR___pthread_sigmask, __pthread_sigmask),
-// _____(__NR___sigwait),
+ MACXY(__NR___sigwait, __sigwait), // 330
MACX_(__NR___disable_threadsignal, __disable_threadsignal),
MACX_(__NR___pthread_markcancel, __pthread_markcancel),
MACX_(__NR___pthread_canceled, __pthread_canceled),
#define __NR_issetugid VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(327)
#define __NR___pthread_kill VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(328)
#define __NR___pthread_sigmask VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(329)
-#define __NR___sigwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(330)
+#define __NR___sigwait VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(330)
#define __NR___disable_threadsignal VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(331)
#define __NR___pthread_markcancel VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(332)
#define __NR___pthread_canceled VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(333)