diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2015-01-15 12:53:45 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2015-01-15 12:53:45 +0000 |
commit | 28d7ea5f86886a8ea9a5244c6981c2417b9d5384 (patch) | |
tree | a74b250309e31796d127bb421648ba1de829608b /usr/src/lib/libc | |
parent | 4d9fc8b0b38cb69d7f951722ae8723137f994686 (diff) | |
parent | fca543ca45b12c44a243625bce68b645ba8ed791 (diff) | |
download | illumos-joyent-28d7ea5f86886a8ea9a5244c6981c2417b9d5384.tar.gz |
[illumos-gate merge]
commit fca543ca45b12c44a243625bce68b645ba8ed791
4923 want preadv and pwritev
commit 078266a5aafa880521ea55488ef3d676f35e908e
5518 Memory leaks in libzfs import implementation
commit 69a6f7175eaa5e5a2a38a92e6e522062e898f570
5519 zfs-diagnosis: Memory leak in zpool_find_load_time()
Diffstat (limited to 'usr/src/lib/libc')
-rw-r--r-- | usr/src/lib/libc/amd64/Makefile | 4 | ||||
-rw-r--r-- | usr/src/lib/libc/common/sys/preadv.s | 38 | ||||
-rw-r--r-- | usr/src/lib/libc/common/sys/pwritev.s | 38 | ||||
-rw-r--r-- | usr/src/lib/libc/i386/Makefile.com | 6 | ||||
-rw-r--r-- | usr/src/lib/libc/port/mapfile-vers | 13 | ||||
-rw-r--r-- | usr/src/lib/libc/port/threads/scalls.c | 43 | ||||
-rw-r--r-- | usr/src/lib/libc/sparc/Makefile.com | 6 | ||||
-rw-r--r-- | usr/src/lib/libc/sparcv9/Makefile.com | 4 |
8 files changed, 147 insertions, 5 deletions
diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index 12fe1429fb..d9f4e5ddc2 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -20,7 +20,7 @@ # # # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2014, Joyent, Inc. All rights reserved. +# Copyright (c) 2015, Joyent, Inc. All rights reserved. # # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> @@ -229,6 +229,7 @@ COMSYSOBJS= \ pipe2.o \ pollsys.o \ pread.o \ + preadv.o \ priocntlset.o \ processor_bind.o \ processor_info.o \ @@ -236,6 +237,7 @@ COMSYSOBJS= \ putmsg.o \ putpmsg.o \ pwrite.o \ + pwritev.o \ read.o \ readv.o \ resolvepath.o \ diff --git a/usr/src/lib/libc/common/sys/preadv.s b/usr/src/lib/libc/common/sys/preadv.s new file mode 100644 index 0000000000..da4514e91a --- /dev/null +++ b/usr/src/lib/libc/common/sys/preadv.s @@ -0,0 +1,38 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2015, Joyent, Inc. All rights reserved. + */ + + .file "preadv.s" + +/* C library -- preadv */ +/* ssize_t __preadv(int, const struct iovec *, int, off_t, off_t); */ + +#include "SYS.h" + +#if !defined(_LARGEFILE_SOURCE) + + SYSCALL2_RESTART_RVAL1(__preadv,preadv) + RET + SET_SIZE(__preadv) + +#else + +/* C library -- preadv64 transitional large file API */ +/* ssize_t __preadv64(int, void *, size_t, off_t, off_t); */ + + SYSCALL2_RESTART_RVAL1(__preadv64,preadv) + RET + SET_SIZE(__preadv64) + +#endif diff --git a/usr/src/lib/libc/common/sys/pwritev.s b/usr/src/lib/libc/common/sys/pwritev.s new file mode 100644 index 0000000000..05bd90912a --- /dev/null +++ b/usr/src/lib/libc/common/sys/pwritev.s @@ -0,0 +1,38 @@ +/* + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + */ + +/* + * Copyright (c) 2015, Joyent, Inc. All rights reserved. + */ + + .file "pwritev.s" + +/* C library -- pwritev */ +/* ssize_t __pwritev(int, const struct iovec *, int, off_t, off_t); */ + +#include "SYS.h" + +#if !defined(_LARGEFILE_SOURCE) + + SYSCALL2_RESTART_RVAL1(__pwritev,pwritev) + RET + SET_SIZE(__pwritev) + +#else + +/* C library -- pwrite64 transitional large file API, */ +/* ssize_t __pwritev64(int, const struct iovec *, int, off_t, off_t); */ + + SYSCALL2_RESTART_RVAL1(__pwritev64,pwritev) + RET + SET_SIZE(__pwritev64) + +#endif diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index b6a9c822c6..0c7b9b2c1b 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -20,7 +20,7 @@ # # # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2014, Joyent, Inc. All rights reserved. +# Copyright (c) 2015, Joyent, Inc. All rights reserved. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> # @@ -156,7 +156,9 @@ COMSYSOBJS64= \ lseek64.o \ mmap64.o \ pread64.o \ + preadv64.o \ pwrite64.o \ + pwritev64.o \ setrlimit64.o \ statvfs64.o @@ -251,6 +253,7 @@ COMSYSOBJS= \ pipe2.o \ pollsys.o \ pread.o \ + preadv.o \ priocntlset.o \ processor_bind.o \ processor_info.o \ @@ -258,6 +261,7 @@ COMSYSOBJS= \ putmsg.o \ putpmsg.o \ pwrite.o \ + pwritev.o \ read.o \ readv.o \ resolvepath.o \ diff --git a/usr/src/lib/libc/port/mapfile-vers b/usr/src/lib/libc/port/mapfile-vers index 09db2c67e4..68eedf25b0 100644 --- a/usr/src/lib/libc/port/mapfile-vers +++ b/usr/src/lib/libc/port/mapfile-vers @@ -24,8 +24,8 @@ # Copyright 2010 Nexenta Systems, Inc. All rights reserved. # Use is subject to license terms. # -# Copyright (c) 2014, Joyent, Inc. All rights reserved. # Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2015, Joyent, Inc. All rights reserved. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright (c) 2013 Gary Mills # Copyright 2014 Garrett D'Amore <garrett@damore.org> @@ -93,6 +93,17 @@ $if _x86 && _ELF64 $add amd64 $endif +SYMBOL_VERSION ILLUMOS_0.10 { # Illumos additions + protected: + preadv; + pwritev; + +$if lf64 + preadv64; + pwritev64; +$endif +} ILLUMOS_0.9; + SYMBOL_VERSION ILLUMOS_0.9 { protected: wcsnrtombs; diff --git a/usr/src/lib/libc/port/threads/scalls.c b/usr/src/lib/libc/port/threads/scalls.c index 18b6b1c05f..4a62ea76b9 100644 --- a/usr/src/lib/libc/port/threads/scalls.c +++ b/usr/src/lib/libc/port/threads/scalls.c @@ -22,6 +22,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2015, Joyent, Inc. All rights reserved. */ /* Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. */ @@ -910,9 +911,29 @@ pread64(int fildes, void *buf, size_t nbyte, off64_t offset) PERFORM(__pread64(fildes, buf, nbyte, offset)) } + +ssize_t +preadv64(int fildes, const struct iovec *iov, int iovcnt, off64_t offset) +{ + + extern ssize_t __preadv64(int, const struct iovec *, int, off_t, off_t); + ssize_t rv; + + PERFORM(__preadv64(fildes, iov, iovcnt, offset & 0xffffffffULL, + offset>>32)) +} #endif /* !_LP64 */ ssize_t +preadv(int fildes, const struct iovec *iov, int iovcnt, off_t offset) +{ + + extern ssize_t __preadv(int, const struct iovec *, int, off_t, off_t); + ssize_t rv; + + PERFORM(__preadv(fildes, iov, iovcnt, offset, 0)) +} +ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset) { extern ssize_t __pwrite(int, const void *, size_t, off_t); @@ -930,9 +951,31 @@ pwrite64(int fildes, const void *buf, size_t nbyte, off64_t offset) PERFORM(__pwrite64(fildes, buf, nbyte, offset)) } + +ssize_t +pwritev64(int fildes, const struct iovec *iov, int iovcnt, off64_t offset) +{ + + extern ssize_t __pwritev64(int, + const struct iovec *, int, off_t, off_t); + ssize_t rv; + + PERFORM(__pwritev64(fildes, iov, iovcnt, offset & + 0xffffffffULL, offset>>32)) +} + #endif /* !_LP64 */ ssize_t +pwritev(int fildes, const struct iovec *iov, int iovcnt, off_t offset) +{ + extern ssize_t __pwritev(int, const struct iovec *, int, off_t, off_t); + ssize_t rv; + + PERFORM(__pwritev(fildes, iov, iovcnt, offset, 0)) +} + +ssize_t readv(int fildes, const struct iovec *iov, int iovcnt) { extern ssize_t __readv(int, const struct iovec *, int); diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index 11ad0b3996..71867bf07d 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -20,9 +20,9 @@ # # # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, Joyent, Inc. All rights reserved. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> -# Copyright (c) 2014, Joyent, Inc. All rights reserved. # # Copyright 2011 Nexenta Systems, Inc. All rights reserved. # Use is subject to license terms. @@ -176,7 +176,9 @@ COMSYSOBJS64= \ lseek64.o \ mmap64.o \ pread64.o \ + preadv64.o \ pwrite64.o \ + pwritev64.o \ setrlimit64.o \ statvfs64.o @@ -271,6 +273,7 @@ COMSYSOBJS= \ pipe2.o \ pollsys.o \ pread.o \ + preadv.o \ priocntlset.o \ processor_bind.o \ processor_info.o \ @@ -278,6 +281,7 @@ COMSYSOBJS= \ putmsg.o \ putpmsg.o \ pwrite.o \ + pwritev.o \ read.o \ readv.o \ resolvepath.o \ diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index c67d0734d1..f6628f8899 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -20,9 +20,9 @@ # # # Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, Joyent, Inc. All rights reserved. # Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2013 Garrett D'Amore <garrett@damore.org> -# Copyright (c) 2014, Joyent, Inc. All rights reserved. # # Copyright 2011 Nexenta Systems, Inc. All rights reserved. # Use is subject to license terms. @@ -256,6 +256,7 @@ COMSYSOBJS= \ pipe2.o \ pollsys.o \ pread.o \ + preadv.o \ priocntlset.o \ processor_bind.o \ processor_info.o \ @@ -263,6 +264,7 @@ COMSYSOBJS= \ putmsg.o \ putpmsg.o \ pwrite.o \ + pwritev.o \ read.o \ readv.o \ resolvepath.o \ |