diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-22 11:45:01 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-05-22 11:45:01 +0000 |
commit | 2f6ba5a0e16acb060f500ae67bb5b820955ac688 (patch) | |
tree | 65855d8c399abf21c9804a4bd8f93b53d833a301 /sys/compat | |
parent | 12a1429490c78d9d5257d007ca0392e26abf3293 (diff) |
Fix OGETUDATA for Solaris-2.3 (From Greg Hudson)
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/svr4/svr4_sockmod.h | 3 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stream.c | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/compat/svr4/svr4_sockmod.h b/sys/compat/svr4/svr4_sockmod.h index 89983b4cd63..027da79dffe 100644 --- a/sys/compat/svr4/svr4_sockmod.h +++ b/sys/compat/svr4/svr4_sockmod.h @@ -1,4 +1,4 @@ -/* $NetBSD: svr4_sockmod.h,v 1.3 1995/03/31 03:06:32 christos Exp $ */ +/* $NetBSD: svr4_sockmod.h,v 1.4 1996/05/13 16:57:53 christos Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -62,6 +62,7 @@ struct svr4_si_oudata { int servtype; int so_state; int so_options; + int tsdusize; }; struct svr4_si_udata { diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 2491f1b320a..f7ccee8a9e1 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -1,5 +1,5 @@ -/* $OpenBSD: svr4_stream.c,v 1.4 1996/04/21 22:18:29 deraadt Exp $ */ -/* $NetBSD: svr4_stream.c,v 1.13 1996/04/11 12:49:13 christos Exp $ */ +/* $OpenBSD: svr4_stream.c,v 1.5 1996/05/22 11:45:00 deraadt Exp $ */ +/* $NetBSD: svr4_stream.c,v 1.14 1996/05/13 16:57:50 christos Exp $ */ /* * Copyright (c) 1994, 1996 Christos Zoulas. All rights reserved. * @@ -407,7 +407,7 @@ si_ogetudata(fp, fd, ioc, p) struct svr4_si_sockparms pa; struct socket *so = (struct socket *) fp->f_data; - if (sizeof(ud) != ioc->len) { + if (ioc->len != sizeof(ud) && ioc->len != sizeof(ud) - sizeof(int)) { DPRINTF(("SI_OGETUDATA: Wrong size %d != %d\n", sizeof(ud), ioc->len)); return EINVAL; @@ -436,7 +436,8 @@ si_ogetudata(fp, fd, ioc, p) /* I have no idea what these should be! */ ud.tidusize = 16384; ud.optsize = 128; - + if (ioc->len == sizeof(ud)) + ud.tsdusize = 128; if (pa.type == SVR4_SOCK_STREAM) ud.etsdusize = 1; @@ -448,7 +449,7 @@ si_ogetudata(fp, fd, ioc, p) /* XXX: Fixme */ ud.so_state = 0; ud.so_options = 0; - return copyout(&ud, ioc->buf, sizeof(ud)); + return copyout(&ud, ioc->buf, ioc->len); } |