summaryrefslogtreecommitdiff
path: root/devel/pth/patches/patch-ad
blob: bdc0dd35bee4d437fd68eaebf087d45443b429c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
$NetBSD: patch-ad,v 1.3 2003/02/04 17:31:17 drochner Exp $

--- pth_syscall.c.orig	Sun Jan 27 12:03:41 2002
+++ pth_syscall.c	Thu Sep 12 09:28:44 2002
@@ -50,7 +50,7 @@
 /* Pth hard wrapper for syscall fork(2) */
 #if cpp
 #if defined(SYS_fork)
-#define PTH_SC_fork() ((pid_t)syscall(SYS_fork))
+#define PTH_SC_fork() ((pid_t)_fork())
 #else
 #define PTH_SC_fork fork
 #endif
@@ -63,6 +63,24 @@
 }
 #endif
 
+/* Pth hard wrapper for nanosleep(2) [internally fully emulated] */
+#if PTH_SYSCALL_HARD
+int nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
+{
+    pth_implicit_init();
+    return pth_nanosleep(rqtp, rmtp);
+}
+#endif
+
+/* Pth hard wrapper for usleep(3) [internally fully emulated] */
+#if PTH_SYSCALL_HARD
+int usleep(useconds_t usec)
+{
+    pth_implicit_init();
+    return pth_usleep(usec);
+}
+#endif
+
 /* Pth hard wrapper for sleep(3) [internally fully emulated] */
 #if PTH_SYSCALL_HARD
 unsigned int sleep(unsigned int sec)
@@ -85,11 +103,13 @@
 #if cpp
 #if defined(SYS_sigprocmask)
 #define PTH_SC_sigprocmask(a1,a2,a3) ((int)syscall(SYS_sigprocmask,(a1),(a2),(a3)))
+#elif defined(SYS___sigprocmask14)
+#define PTH_SC_sigprocmask(a1,a2,a3) ((int)syscall(SYS___sigprocmask14,(a1),(a2),(a3)))
 #else
 #define PTH_SC_sigprocmask sigprocmask
 #endif
 #endif /* cpp */
-#if PTH_SYSCALL_HARD && defined(SYS_sigprocmask)
+#if PTH_SYSCALL_HARD && (defined(SYS_sigprocmask) || defined(SYS___sigprocmask14))
 int sigprocmask(int how, const sigset_t *set, sigset_t *oset)
 {
     pth_implicit_init();
@@ -119,6 +139,22 @@
 {
     pth_implicit_init();
     return pth_waitpid(wpid, status, options);
+}
+#endif
+
+/* Pth hard wrapper for syscall wait4(2) */
+#if cpp
+#if defined(SYS_wait4)
+#define PTH_SC_wait4(a1,a2,a3,a4) ((int)syscall(SYS_wait4,(a1),(a2),(a3),(a4)))
+#else
+#define PTH_SC_wait4 wait4
+#endif
+#endif /* cpp */
+#if PTH_SYSCALL_HARD && defined(SYS_wait4)
+pid_t wait4(pid_t wpid, int *status, int options, struct rusage *rusage)
+{
+    pth_implicit_init();
+    return pth_wait4(wpid, status, options, rusage);
 }
 #endif