aboutsummaryrefslogtreecommitdiff
path: root/lib/libsys/wait.c
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2024-01-16 22:25:07 +0000
committerBrooks Davis <brooks@FreeBSD.org>2024-02-05 20:34:55 +0000
commit29d079c9649174a36a87a26d1f99e3c0b3e78e0c (patch)
treee9e5d54662cc8d1fcf4778d94b78eaea3f0fef3b /lib/libsys/wait.c
parent8f529310bd09c064d5d69740f03c6fe6f12650a3 (diff)
libsys: move __libsys_interposer consumers
These system call wrappers call interposed system calls in fairly trivial ways. Move them over to libsys so all __libsys_interposer consumers end up in libsys. Also move recvmmsg and sendmmsg as they are documented with recv and send. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
Diffstat (limited to 'lib/libsys/wait.c')
-rw-r--r--lib/libsys/wait.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/libsys/wait.c b/lib/libsys/wait.c
new file mode 100644
index 000000000000..c400d07f9dd5
--- /dev/null
+++ b/lib/libsys/wait.c
@@ -0,0 +1,51 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 1988, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "namespace.h"
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/resource.h>
+#include "un-namespace.h"
+
+#include "libc_private.h"
+
+pid_t __wait(int *);
+
+pid_t
+__wait(int *istat)
+{
+ return (((pid_t (*)(pid_t, int *, int, struct rusage *))
+ __libsys_interposing[INTERPOS_wait4])(WAIT_ANY, istat, 0, NULL));
+}
+
+__weak_reference(__wait, wait);
+__weak_reference(__wait, _wait);