summaryrefslogtreecommitdiff
path: root/lib/libc/hidden/sys
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-05-07 19:05:25 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-05-07 19:05:25 +0000
commitbe4e94637d7117375492627b79c41629c7da9bc3 (patch)
tree61a9fabcc07d38d2720bbb937e83103928286550 /lib/libc/hidden/sys
parent33d8693716b4a6d503e0ba97f94a783905b87f28 (diff)
Use a Thread Information Block in both single and multi-threaded programs.
This stores errno, the cancelation flags, and related bits for each thread and is allocated by ld.so or libc.a. This is an ABI break from 5.9-stable! Make libpthread dlopen'able by moving the cancelation wrappers into libc and doing locking and fork/errno handling via callbacks that libpthread registers when it first initializes. 'errno' *must* be declared via <errno.h> now! Clean up libpthread's symbol exports like libc. On powerpc, offset the TIB/TCB/TLS data from the register per the ELF spec. Testing by various, particularly sthen@ and patrick@ ok kettenis@
Diffstat (limited to 'lib/libc/hidden/sys')
-rw-r--r--lib/libc/hidden/sys/mman.h4
-rw-r--r--lib/libc/hidden/sys/msg.h28
-rw-r--r--lib/libc/hidden/sys/select.h27
-rw-r--r--lib/libc/hidden/sys/socket.h9
-rw-r--r--lib/libc/hidden/sys/uio.h28
-rw-r--r--lib/libc/hidden/sys/wait.h4
6 files changed, 95 insertions, 5 deletions
diff --git a/lib/libc/hidden/sys/mman.h b/lib/libc/hidden/sys/mman.h
index b01a4a9deff..655bf571ca5 100644
--- a/lib/libc/hidden/sys/mman.h
+++ b/lib/libc/hidden/sys/mman.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mman.h,v 1.2 2015/09/12 15:01:33 guenther Exp $ */
+/* $OpenBSD: mman.h,v 1.3 2016/05/07 19:05:22 guenther Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@@ -28,7 +28,7 @@ PROTO_NORMAL(mlockall);
PROTO_NORMAL(mmap);
PROTO_NORMAL(mprotect);
PROTO_NORMAL(mquery);
-/*PROTO_CANCEL(msync);*/
+PROTO_CANCEL(msync);
PROTO_NORMAL(munlock);
PROTO_NORMAL(munlockall);
PROTO_NORMAL(munmap);
diff --git a/lib/libc/hidden/sys/msg.h b/lib/libc/hidden/sys/msg.h
new file mode 100644
index 00000000000..8208c739f6d
--- /dev/null
+++ b/lib/libc/hidden/sys/msg.h
@@ -0,0 +1,28 @@
+/* $OpenBSD: msg.h,v 1.1 2016/05/07 19:05:22 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBC_SYS_MSG_H_
+#define _LIBC_SYS_MSG_H_
+
+#include_next <sys/msg.h>
+
+PROTO_NORMAL(msgctl);
+PROTO_NORMAL(msgget);
+PROTO_CANCEL(msgrcv);
+PROTO_CANCEL(msgsnd);
+
+#endif /* !_LIBC_SYS_MSG_H_ */
diff --git a/lib/libc/hidden/sys/select.h b/lib/libc/hidden/sys/select.h
new file mode 100644
index 00000000000..f67f3e5ee7e
--- /dev/null
+++ b/lib/libc/hidden/sys/select.h
@@ -0,0 +1,27 @@
+/* $OpenBSD: select.h,v 1.1 2016/05/07 19:05:22 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/* $OpenBSD: select.h,v 1.1 2016/05/07 19:05:22 guenther Exp $ */
+
+#ifndef _LIBC_SYS_SELECT_H_
+#define _LIBC_SYS_SELECT_H_
+
+#include_next <sys/select.h>
+
+PROTO_CANCEL(select);
+PROTO_CANCEL(pselect);
+
+#endif /* !_LIBC_SYS_SELECT_H_ */
diff --git a/lib/libc/hidden/sys/socket.h b/lib/libc/hidden/sys/socket.h
index d262e0f3bac..2d8b3e4f120 100644
--- a/lib/libc/hidden/sys/socket.h
+++ b/lib/libc/hidden/sys/socket.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: socket.h,v 1.3 2015/10/04 07:17:27 guenther Exp $ */
+/* $OpenBSD: socket.h,v 1.4 2016/05/07 19:05:22 guenther Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@@ -20,7 +20,10 @@
#include_next <sys/socket.h>
+PROTO_CANCEL(accept);
+PROTO_CANCEL(accept4);
PROTO_NORMAL(bind);
+PROTO_CANCEL(connect);
PROTO_DEPRECATED(getpeereid);
PROTO_NORMAL(getpeername);
PROTO_NORMAL(getrtable);
@@ -28,7 +31,11 @@ PROTO_NORMAL(getsockname);
PROTO_NORMAL(getsockopt);
PROTO_NORMAL(listen);
PROTO_NORMAL(recv);
+PROTO_CANCEL(recvfrom);
+PROTO_CANCEL(recvmsg);
PROTO_NORMAL(send);
+PROTO_CANCEL(sendmsg);
+PROTO_CANCEL(sendto);
PROTO_NORMAL(setrtable);
PROTO_NORMAL(setsockopt);
PROTO_NORMAL(shutdown);
diff --git a/lib/libc/hidden/sys/uio.h b/lib/libc/hidden/sys/uio.h
new file mode 100644
index 00000000000..8db874ed537
--- /dev/null
+++ b/lib/libc/hidden/sys/uio.h
@@ -0,0 +1,28 @@
+/* $OpenBSD: uio.h,v 1.1 2016/05/07 19:05:22 guenther Exp $ */
+/*
+ * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _LIBC_SYS_UIO_H_
+#define _LIBC_SYS_UIO_H_
+
+#include_next <sys/uio.h>
+
+PROTO_CANCEL(preadv);
+PROTO_CANCEL(pwritev);
+PROTO_CANCEL(readv);
+PROTO_CANCEL(writev);
+
+#endif /* !_LIBC_SYS_UIO_H_ */
diff --git a/lib/libc/hidden/sys/wait.h b/lib/libc/hidden/sys/wait.h
index 4fdf0be1690..b73d383220b 100644
--- a/lib/libc/hidden/sys/wait.h
+++ b/lib/libc/hidden/sys/wait.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wait.h,v 1.1 2015/10/25 19:15:56 guenther Exp $ */
+/* $OpenBSD: wait.h,v 1.2 2016/05/07 19:05:22 guenther Exp $ */
/*
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
*
@@ -23,6 +23,6 @@
PROTO_DEPRECATED(wait);
PROTO_NORMAL(waitpid);
PROTO_DEPRECATED(wait3);
-/*PROTO_CANCEL(wait4);*/
+PROTO_CANCEL(wait4);
#endif /* !_LIBC_SYS_WAIT_H_ */