summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorTheo Schlossnagle <jesus@omniti.com>2013-06-09 16:07:11 +0000
committerGordon Ross <gwr@nexenta.com>2013-07-03 17:15:18 -0400
commitb49b27dcb66b2c7f4a23f7bc158e2dde5cd79030 (patch)
tree04da740797c7f1336a8435a499a1a827fc5d2ab3 /usr
parent0f94976e74ac54bd0c370887c9aa0838c90b539e (diff)
downloadillumos-joyent-b49b27dcb66b2c7f4a23f7bc158e2dde5cd79030.tar.gz
3809 Recent libc change breaks Solaris 10 Branded Zone Support
Reviewed by: Andrzej Szeszo <aszeszo@gmail.com> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Gordon Ross <gwr@nexenta.com>
Diffstat (limited to 'usr')
-rw-r--r--usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c49
-rw-r--r--usr/src/uts/common/brand/solaris10/s10_brand.c4
-rw-r--r--usr/src/uts/common/brand/solaris10/s10_brand.h4
3 files changed, 54 insertions, 3 deletions
diff --git a/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c b/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c
index f179a3d44f..eb91f5212d 100644
--- a/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c
+++ b/usr/src/lib/brand/solaris10/s10_brand/common/s10_brand.c
@@ -20,6 +20,7 @@
*/
/*
+ * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -59,6 +60,7 @@
#include <sys/lofi.h>
#include <atomic.h>
#include <sys/acl.h>
+#include <sys/socket.h>
#include <s10_brand.h>
#include <brand_misc.h>
@@ -1386,6 +1388,47 @@ s10_issetugid(sysret_t *rval)
0, 0, 0, 0, 0));
}
+/*
+ * S10's socket() syscall does not split type and flags
+ */
+static int
+s10_so_socket(sysret_t *rval, int domain, int type, int protocol,
+ char *devpath, int version)
+{
+ if ((type & ~SOCK_TYPE_MASK) != 0) {
+ errno = EINVAL;
+ return (-1);
+ }
+ return (__systemcall(rval, SYS_so_socket + 1024, domain, type,
+ protocol, devpath, version));
+}
+
+/*
+ * S10's pipe() syscall has a different calling convention
+ */
+static int
+s10_pipe(sysret_t *rval)
+{
+ int fds[2], err;
+ if ((err = __systemcall(rval, SYS_pipe + 1024, fds, 0)) != 0)
+ return (err);
+
+ rval->sys_rval1 = fds[0];
+ rval->sys_rval2 = fds[1];
+ return (0);
+}
+
+/*
+ * S10's accept() syscall takes three arguments
+ */
+static int
+s10_accept(sysret_t *rval, int sock, struct sockaddr *addr, uint_t *addrlen,
+ int version)
+{
+ return (__systemcall(rval, SYS_accept + 1024, sock, addr, addrlen,
+ version, 0));
+}
+
static long
s10_uname(sysret_t *rv, uintptr_t p1)
{
@@ -1900,7 +1943,7 @@ brand_sysent_table_t brand_sysent_table[] = {
NOSYS, /* 39 */
NOSYS, /* 40 */
EMULATE(s10_dup, 1 | RV_DEFAULT), /* 41 */
- NOSYS, /* 42 */
+ EMULATE(s10_pipe, 0 | RV_32RVAL2), /* 42 */
NOSYS, /* 43 */
NOSYS, /* 44 */
NOSYS, /* 45 */
@@ -2115,11 +2158,11 @@ brand_sysent_table_t brand_sysent_table[] = {
EMULATE(s10_zone, 5 | RV_DEFAULT), /* 227 */
NOSYS, /* 228 */
NOSYS, /* 229 */
- NOSYS, /* 230 */
+ EMULATE(s10_so_socket, 5 | RV_DEFAULT), /* 230 */
NOSYS, /* 231 */
NOSYS, /* 232 */
NOSYS, /* 233 */
- NOSYS, /* 234 */
+ EMULATE(s10_accept, 4 | RV_DEFAULT), /* 234 */
NOSYS, /* 235 */
NOSYS, /* 236 */
NOSYS, /* 237 */
diff --git a/usr/src/uts/common/brand/solaris10/s10_brand.c b/usr/src/uts/common/brand/solaris10/s10_brand.c
index 3efc9ef6b3..f24b864eef 100644
--- a/usr/src/uts/common/brand/solaris10/s10_brand.c
+++ b/usr/src/uts/common/brand/solaris10/s10_brand.c
@@ -20,6 +20,7 @@
*/
/*
+ * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -497,6 +498,7 @@ _init(void)
s10_emulation_table[S10_SYS_access] = 1; /* 33 */
s10_emulation_table[SYS_kill] = 1; /* 37 */
s10_emulation_table[S10_SYS_dup] = 1; /* 41 */
+ s10_emulation_table[S10_SYS_pipe] = 1; /* 42 */
s10_emulation_table[SYS_ioctl] = 1; /* 54 */
s10_emulation_table[SYS_execve] = 1; /* 59 */
s10_emulation_table[SYS_acctctl] = 1; /* 71 */
@@ -554,6 +556,8 @@ _init(void)
s10_emulation_table[S10_SYS_creat64] = 1; /* 224 */
s10_emulation_table[S10_SYS_open64] = 1; /* 225 */
s10_emulation_table[SYS_zone] = 1; /* 227 */
+ s10_emulation_table[S10_SYS_so_socket] = 1; /* 230 */
+ s10_emulation_table[S10_SYS_accept] = 1; /* 234 */
s10_emulation_table[SYS_lwp_mutex_trylock] = 1; /* 251 */
err = mod_install(&modlinkage);
diff --git a/usr/src/uts/common/brand/solaris10/s10_brand.h b/usr/src/uts/common/brand/solaris10/s10_brand.h
index 0112a783bb..11f9853f48 100644
--- a/usr/src/uts/common/brand/solaris10/s10_brand.h
+++ b/usr/src/uts/common/brand/solaris10/s10_brand.h
@@ -20,6 +20,7 @@
*/
/*
+ * Copyright (c) 2013, OmniTI Computer Consulting, Inc. All rights reserved.
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
*/
@@ -119,6 +120,7 @@ enum s10_emulated_features {
#define S10_SYS_utime 30
#define S10_SYS_access 33
#define S10_SYS_dup 41
+#define S10_SYS_pipe 42
#define S10_SYS_issetugid 75
#define S10_SYS_fsat 76
#define S10_SYS_rmdir 79
@@ -144,6 +146,8 @@ enum s10_emulated_features {
#define S10_SYS_fstat64 217
#define S10_SYS_creat64 224
#define S10_SYS_open64 225
+#define S10_SYS_so_socket 230
+#define S10_SYS_accept 234
/*
* solaris10-brand-specific attributes