aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2017-11-05 04:08:00 +0000
committerEnji Cooper <ngie@FreeBSD.org>2017-11-05 04:08:00 +0000
commit254d2760ceafead91d53aec2a833a016dc6113ae (patch)
treeb07ae096f96a8799f2c7603bccf6d587c5e0d682 /lib
parentf6e116eea97e79450fb8dcf81193f35dfc30fae1 (diff)
parent8ca8d252bb385afa0d43fe933dd1eecc4dbbbc5c (diff)
downloadsrc-254d2760ceafead91d53aec2a833a016dc6113ae.tar.gz
src-254d2760ceafead91d53aec2a833a016dc6113ae.zip
MFhead@r325422
Notes
Notes: svn path=/projects/runtime-coverage/; revision=325423
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/quick_exit.313
-rw-r--r--lib/libc/stdlib/quick_exit.c7
-rw-r--r--lib/libc/sys/posix_fallocate.27
-rw-r--r--lib/libcasper/libcasper/Makefile8
-rw-r--r--lib/libcasper/services/cap_dns/Makefile2
-rw-r--r--lib/libcasper/services/cap_grp/Makefile2
-rw-r--r--lib/libcasper/services/cap_pwd/Makefile2
-rw-r--r--lib/libcasper/services/cap_random/Makefile5
-rw-r--r--lib/libcasper/services/cap_sysctl/Makefile2
9 files changed, 33 insertions, 15 deletions
diff --git a/lib/libc/stdlib/quick_exit.3 b/lib/libc/stdlib/quick_exit.3
index fb1e346bb106..9d316c7e46ea 100644
--- a/lib/libc/stdlib/quick_exit.3
+++ b/lib/libc/stdlib/quick_exit.3
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd December 13, 2014
+.Dd November 4, 2017
.Dt QUICK_EXIT 3
.Os
.Sh NAME
@@ -44,6 +44,17 @@ with
.Xr at_quick_exit 3
but not any C++ destructors or cleanup code registered with
.Xr atexit 3 .
+The
+.Xr stdio 3
+file buffers are not flushed.
+.Pp
+The function
+.Fn quick_exit
+is
+.Em async-signal safe
+when the functions registered with
+.Xr at_quick_exit 3
+are.
.Sh RETURN VALUES
The
.Fn quick_exit
diff --git a/lib/libc/stdlib/quick_exit.c b/lib/libc/stdlib/quick_exit.c
index ef8cdb1b401a..4d81a35f5375 100644
--- a/lib/libc/stdlib/quick_exit.c
+++ b/lib/libc/stdlib/quick_exit.c
@@ -26,6 +26,8 @@
* $FreeBSD$
*/
+#include <sys/types.h>
+#include <machine/atomic.h>
#include <stdlib.h>
#include <pthread.h>
@@ -60,6 +62,7 @@ at_quick_exit(void (*func)(void))
h->cleanup = func;
pthread_mutex_lock(&atexit_mutex);
h->next = handlers;
+ __compiler_membar();
handlers = h;
pthread_mutex_unlock(&atexit_mutex);
return (0);
@@ -74,7 +77,9 @@ quick_exit(int status)
* XXX: The C++ spec requires us to call std::terminate if there is an
* exception here.
*/
- for (h = handlers; NULL != h; h = h->next)
+ for (h = handlers; NULL != h; h = h->next) {
+ __compiler_membar();
h->cleanup();
+ }
_Exit(status);
}
diff --git a/lib/libc/sys/posix_fallocate.2 b/lib/libc/sys/posix_fallocate.2
index 1bc59caf7239..4fba3dd87611 100644
--- a/lib/libc/sys/posix_fallocate.2
+++ b/lib/libc/sys/posix_fallocate.2
@@ -28,7 +28,7 @@
.\" @(#)open.2 8.2 (Berkeley) 11/16/93
.\" $FreeBSD$
.\"
-.Dd October 12, 2017
+.Dd November 4, 2017
.Dt POSIX_FALLOCATE 2
.Os
.Sh NAME
@@ -106,9 +106,10 @@ A signal was caught during execution.
.It Bq Er EINVAL
The
.Fa len
-argument was less than or equal to zero or the
+argument was less than or equal to zero, the
.Fa offset
-argument was less than zero.
+argument was less than zero,
+or the operation is not supported by the file system.
.It Bq Er EIO
An I/O error occurred while reading from or writing to a file system.
.It Bq Er ENODEV
diff --git a/lib/libcasper/libcasper/Makefile b/lib/libcasper/libcasper/Makefile
index 75ac69bf55e8..729bf071846a 100644
--- a/lib/libcasper/libcasper/Makefile
+++ b/lib/libcasper/libcasper/Makefile
@@ -1,14 +1,14 @@
# $FreeBSD$
+SHLIBDIR?= /lib
+
.include <src.opts.mk>
PACKAGE=${LIB}
-SHLIB_MAJOR= 0
-SHLIBDIR?= /lib
-
.if ${MK_CASPER} != "no"
-LIB= casper
+SHLIB= casper
+SHLIB_MAJOR= 0
SRCS= libcasper.c
SRCS+= libcasper_impl.c
diff --git a/lib/libcasper/services/cap_dns/Makefile b/lib/libcasper/services/cap_dns/Makefile
index 3e2daa2cfaaa..e89be7f5396d 100644
--- a/lib/libcasper/services/cap_dns/Makefile
+++ b/lib/libcasper/services/cap_dns/Makefile
@@ -10,7 +10,7 @@ SHLIB_MAJOR= 0
INCSDIR?= ${INCLUDEDIR}/casper
.if ${MK_CASPER} != "no"
-LIB= cap_dns
+SHLIB= cap_dns
SRCS= cap_dns.c
.endif
diff --git a/lib/libcasper/services/cap_grp/Makefile b/lib/libcasper/services/cap_grp/Makefile
index d15cd72c20ce..5b464774f9f5 100644
--- a/lib/libcasper/services/cap_grp/Makefile
+++ b/lib/libcasper/services/cap_grp/Makefile
@@ -10,7 +10,7 @@ SHLIB_MAJOR= 0
INCSDIR?= ${INCLUDEDIR}/casper
.if ${MK_CASPER} != "no"
-LIB= cap_grp
+SHLIB= cap_grp
SRCS= cap_grp.c
.endif
diff --git a/lib/libcasper/services/cap_pwd/Makefile b/lib/libcasper/services/cap_pwd/Makefile
index fc2a32850f79..be4ae89181c7 100644
--- a/lib/libcasper/services/cap_pwd/Makefile
+++ b/lib/libcasper/services/cap_pwd/Makefile
@@ -10,7 +10,7 @@ SHLIB_MAJOR= 0
INCSDIR?= ${INCLUDEDIR}/casper
.if ${MK_CASPER} != "no"
-LIB= cap_pwd
+SHLIB= cap_pwd
SRCS= cap_pwd.c
.endif
diff --git a/lib/libcasper/services/cap_random/Makefile b/lib/libcasper/services/cap_random/Makefile
index d29cd147aeb0..fad8e3f9cdb7 100644
--- a/lib/libcasper/services/cap_random/Makefile
+++ b/lib/libcasper/services/cap_random/Makefile
@@ -1,15 +1,16 @@
# $FreeBSD$
+SHLIBDIR?= /lib/casper
+
.include <src.opts.mk>
PACKAGE=libcasper
SHLIB_MAJOR= 0
-SHLIBDIR?= /lib/casper
INCSDIR?= ${INCLUDEDIR}/casper
.if ${MK_CASPER} != "no"
-LIB= cap_random
+SHLIB= cap_random
SRCS= cap_random.c
.endif
diff --git a/lib/libcasper/services/cap_sysctl/Makefile b/lib/libcasper/services/cap_sysctl/Makefile
index cd5c4b238724..14f2bd60cf97 100644
--- a/lib/libcasper/services/cap_sysctl/Makefile
+++ b/lib/libcasper/services/cap_sysctl/Makefile
@@ -10,7 +10,7 @@ SHLIB_MAJOR= 0
INCSDIR?= ${INCLUDEDIR}/casper
.if ${MK_CASPER} != "no"
-LIB= cap_sysctl
+SHLIB= cap_sysctl
SRCS= cap_sysctl.c
.endif