summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkaiw <kaiw@FreeBSD.org>2014-01-25 14:02:02 +0000
committerkaiw <kaiw@FreeBSD.org>2014-01-25 14:02:02 +0000
commit25e9e966453d1bf544bdb824ac7b55e3fae9578b (patch)
treeac135e54f7b963d5248c59a45ed75559417fecef /lib
parent236d76c86daca690ecd10433cf90925d309f197c (diff)
parentd7761633d8e8047ff45b8eaa5f49657820ff9a56 (diff)
downloadFreeBSD-src-25e9e966453d1bf544bdb824ac7b55e3fae9578b.zip
FreeBSD-src-25e9e966453d1bf544bdb824ac7b55e3fae9578b.tar.gz
MFH@261151.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/Makefile.inc3
-rw-r--r--lib/libc/gen/tls.c24
-rw-r--r--lib/libc/stdlib/jemalloc/Makefile.inc8
-rw-r--r--lib/libc/stdlib/jemalloc/Symbol.map12
-rw-r--r--lib/libc/sys/posix_fallocate.28
5 files changed, 37 insertions, 18 deletions
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 7053d22..1b5222e 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -304,8 +304,9 @@ MLINKS+=devname.3 fdevname.3
MLINKS+=devname.3 fdevname_r.3
MLINKS+=directory.3 closedir.3 \
directory.3 dirfd.3 \
- directory.3 opendir.3 \
+ directory.3 fdclosedir.3 \
directory.3 fdopendir.3 \
+ directory.3 opendir.3 \
directory.3 readdir.3 \
directory.3 readdir_r.3 \
directory.3 rewinddir.3 \
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c
index 466f957..4b083da 100644
--- a/lib/libc/gen/tls.c
+++ b/lib/libc/gen/tls.c
@@ -40,9 +40,9 @@
#include "libc_private.h"
/* Provided by jemalloc to avoid bootstrapping issues. */
-void *__jemalloc_a0malloc(size_t size);
-void *__jemalloc_a0calloc(size_t num, size_t size);
-void __jemalloc_a0free(void *ptr);
+void *__je_a0malloc(size_t size);
+void *__je_a0calloc(size_t num, size_t size);
+void __je_a0free(void *ptr);
__weak_reference(__libc_allocate_tls, _rtld_allocate_tls);
__weak_reference(__libc_free_tls, _rtld_free_tls);
@@ -125,8 +125,8 @@ __libc_free_tls(void *tcb, size_t tcbsize, size_t tcbalign __unused)
tls = (Elf_Addr **)((Elf_Addr)tcb + tcbsize - TLS_TCB_SIZE);
dtv = tls[0];
- __jemalloc_a0free(dtv);
- __jemalloc_a0free(tcb);
+ __je_a0free(dtv);
+ __je_a0free(tcb);
}
/*
@@ -142,18 +142,18 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign __unused)
if (oldtcb != NULL && tcbsize == TLS_TCB_SIZE)
return (oldtcb);
- tcb = __jemalloc_a0calloc(1, tls_static_space + tcbsize - TLS_TCB_SIZE);
+ tcb = __je_a0calloc(1, tls_static_space + tcbsize - TLS_TCB_SIZE);
tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE);
if (oldtcb != NULL) {
memcpy(tls, oldtcb, tls_static_space);
- __jemalloc_a0free(oldtcb);
+ __je_a0free(oldtcb);
/* Adjust the DTV. */
dtv = tls[0];
dtv[2] = (Elf_Addr)tls + TLS_TCB_SIZE;
} else {
- dtv = __jemalloc_a0malloc(3 * sizeof(Elf_Addr));
+ dtv = __je_a0malloc(3 * sizeof(Elf_Addr));
tls[0] = dtv;
dtv[0] = 1;
dtv[1] = 1;
@@ -194,8 +194,8 @@ __libc_free_tls(void *tcb, size_t tcbsize __unused, size_t tcbalign)
dtv = ((Elf_Addr**)tcb)[1];
tlsend = (Elf_Addr) tcb;
tlsstart = tlsend - size;
- __jemalloc_a0free((void*) tlsstart);
- __jemalloc_a0free(dtv);
+ __je_a0free((void*) tlsstart);
+ __je_a0free(dtv);
}
/*
@@ -213,8 +213,8 @@ __libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign)
if (tcbsize < 2 * sizeof(Elf_Addr))
tcbsize = 2 * sizeof(Elf_Addr);
- tls = __jemalloc_a0calloc(1, size + tcbsize);
- dtv = __jemalloc_a0malloc(3 * sizeof(Elf_Addr));
+ tls = __je_a0calloc(1, size + tcbsize);
+ dtv = __je_a0malloc(3 * sizeof(Elf_Addr));
segbase = (Elf_Addr)(tls + size);
((Elf_Addr*)segbase)[0] = segbase;
diff --git a/lib/libc/stdlib/jemalloc/Makefile.inc b/lib/libc/stdlib/jemalloc/Makefile.inc
index 9718676..dbd0fd7 100644
--- a/lib/libc/stdlib/jemalloc/Makefile.inc
+++ b/lib/libc/stdlib/jemalloc/Makefile.inc
@@ -4,7 +4,7 @@
JEMALLOCSRCS:= jemalloc.c arena.c atomic.c base.c bitmap.c chunk.c \
chunk_dss.c chunk_mmap.c ckh.c ctl.c extent.c hash.c huge.c mb.c \
- mutex.c prof.c quarantine.c rtree.c stats.c tcache.c util.c tsd.c
+ mutex.c prof.c quarantine.c rtree.c stats.c tcache.c tsd.c util.c
SYM_MAPS+=${.CURDIR}/stdlib/jemalloc/Symbol.map
@@ -34,6 +34,12 @@ MLINKS+= \
jemalloc.3 mallctl.3 \
jemalloc.3 mallctlnametomib.3 \
jemalloc.3 mallctlbymib.3 \
+ jemalloc.3 mallocx.3 \
+ jemalloc.3 rallocx.3 \
+ jemalloc.3 xallocx.3 \
+ jemalloc.3 sallocx.3 \
+ jemalloc.3 dallocx.3 \
+ jemalloc.3 nallocx.3 \
jemalloc.3 allocm.3 \
jemalloc.3 rallocm.3 \
jemalloc.3 sallocm.3 \
diff --git a/lib/libc/stdlib/jemalloc/Symbol.map b/lib/libc/stdlib/jemalloc/Symbol.map
index 617194f..35a5dad 100644
--- a/lib/libc/stdlib/jemalloc/Symbol.map
+++ b/lib/libc/stdlib/jemalloc/Symbol.map
@@ -21,6 +21,12 @@ FBSD_1.3 {
mallctl;
mallctlnametomib;
mallctlbymib;
+ mallocx;
+ rallocx;
+ xallocx;
+ sallocx;
+ dallocx;
+ nallocx;
allocm;
rallocm;
sallocm;
@@ -32,6 +38,12 @@ FBSD_1.3 {
__free;
__posix_memalign;
__malloc_usable_size;
+ __mallocx;
+ __rallocx;
+ __xallocx;
+ __sallocx;
+ __dallocx;
+ __nallocx;
__allocm;
__rallocm;
__sallocm;
diff --git a/lib/libc/sys/posix_fallocate.2 b/lib/libc/sys/posix_fallocate.2
index 087c68c..1460764 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 February 25, 2012
+.Dd January 23, 2014
.Dt POSIX_FALLOCATE 2
.Os
.Sh NAME
@@ -83,9 +83,9 @@ that reduces the file size to a size smaller than
If successful,
.Fn posix_fallocate
returns zero.
-It returns -1 on failure, and sets
+It returns error number on failure, without setting
.Va errno
-to indicate the error.
+variable.
.Sh ERRORS
Possible failure conditions:
.Bl -tag -width Er
@@ -107,7 +107,7 @@ A signal was caught during execution.
.It Bq Er EINVAL
The
.Fa len
-argument was zero or the
+argument was less than or equal to zero or the
.Fa offset
argument was less than zero.
.It Bq Er EIO
OpenPOWER on IntegriCloud