diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/brand/lx/lx_brand/common/iovec.c | 28 | ||||
-rw-r--r-- | usr/src/lib/brand/lx/lx_brand/common/lx_brand.c | 10 | ||||
-rw-r--r-- | usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h | 2 |
3 files changed, 34 insertions, 6 deletions
diff --git a/usr/src/lib/brand/lx/lx_brand/common/iovec.c b/usr/src/lib/brand/lx/lx_brand/common/iovec.c index d4b74e8daf..b6d0f79c75 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/iovec.c +++ b/usr/src/lib/brand/lx/lx_brand/common/iovec.c @@ -22,7 +22,7 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. - * Copyright 2014 Joyent, Inc. All rights reserved. + * Copyright 2015 Joyent, Inc. All rights reserved. */ #include <errno.h> @@ -281,3 +281,29 @@ lx_writev(uintptr_t p1, uintptr_t p2, uintptr_t p3) return (total); } + +long +lx_preadv(uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4) +{ + int fd = (int)p1; + const struct iovec *iovp = (const struct iovec *)p2; + int cnt = (int)p3; + off_t off = (off_t)p4; + ssize_t ret; + + ret = preadv(fd, iovp, cnt, off); + return (ret < 0 ? -errno : ret); +} + +long +lx_pwritev(uintptr_t p1, uintptr_t p2, uintptr_t p3, uintptr_t p4) +{ + int fd = (int)p1; + const struct iovec *iovp = (const struct iovec *)p2; + int cnt = (int)p3; + off_t off = (off_t)p4; + ssize_t ret; + + ret = pwritev(fd, iovp, cnt, off); + return (ret < 0 ? -errno : ret); +} diff --git a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c index 7700509687..e8fab9abe3 100644 --- a/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c +++ b/usr/src/lib/brand/lx/lx_brand/common/lx_brand.c @@ -25,7 +25,7 @@ */ /* - * Copyright 2014 Joyent, Inc. All rights reserved. + * Copyright 2015 Joyent, Inc. All rights reserved. */ #include <sys/types.h> @@ -1388,8 +1388,8 @@ static struct lx_sysent sysents[] = { {"dup3", lx_dup3, 0, 3}, /* 292 */ {"pipe2", lx_pipe2, 0, 2}, /* 293 */ {"inotify_init1", lx_inotify_init1, 0, 1}, /* 294 */ - {"preadv", NULL, NOSYS_NULL, 0}, /* 295 */ - {"pwritev", NULL, NOSYS_NULL, 0}, /* 296 */ + {"preadv", lx_preadv, 0, 4}, /* 295 */ + {"pwritev", lx_pwritev, 0, 4}, /* 296 */ {"rt_tgsigqueueinfo", lx_rt_tgsigqueueinfo, 0, 4}, /* 297 */ {"perf_event_open", NULL, NOSYS_NULL, 0}, /* 298 */ {"recvmmsg", NULL, NOSYS_NULL, 0}, /* 299 */ @@ -1753,8 +1753,8 @@ static struct lx_sysent sysents[] = { {"dup3", lx_dup3, 0, 3}, /* 330 */ {"pipe2", lx_pipe2, 0, 2}, /* 331 */ {"inotify_init1", lx_inotify_init1, 0, 1}, /* 332 */ - {"preadv", NULL, NOSYS_NULL, 0}, /* 333 */ - {"pwritev", NULL, NOSYS_NULL, 0}, /* 334 */ + {"preadv", lx_preadv, 0, 4}, /* 333 */ + {"pwritev", lx_pwritev, 0, 4}, /* 334 */ {"rt_tgsigqueueinfo", lx_rt_tgsigqueueinfo, 0, 4}, /* 335 */ {"perf_event_open", NULL, NOSYS_NULL, 0}, /* 336 */ {"recvmmsg", NULL, NOSYS_NULL, 0}, /* 337 */ diff --git a/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h b/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h index 6ca759cf12..92bcfcb4b0 100644 --- a/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h +++ b/usr/src/lib/brand/lx/lx_brand/sys/lx_syscall.h @@ -87,6 +87,8 @@ extern long lx_readv(uintptr_t, uintptr_t, uintptr_t); extern long lx_writev(uintptr_t, uintptr_t, uintptr_t); extern long lx_pread(uintptr_t, uintptr_t, uintptr_t, uintptr_t); extern long lx_pwrite(uintptr_t, uintptr_t, uintptr_t, uintptr_t); +extern long lx_preadv(uintptr_t, uintptr_t, uintptr_t, uintptr_t); +extern long lx_pwritev(uintptr_t, uintptr_t, uintptr_t, uintptr_t); extern long lx_pread64(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); extern long lx_pwrite64(uintptr_t, uintptr_t, uintptr_t, uintptr_t, |