Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump add rumpuser_net_setsockopt()



details:   https://anonhg.NetBSD.org/src/rev/2c789ea7e5d8
branches:  trunk
changeset: 747111:2c789ea7e5d8
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Sep 02 19:02:51 2009 +0000

description:
add rumpuser_net_setsockopt()

diffstat:

 sys/rump/include/rump/rumpuser.h         |   3 ++-
 sys/rump/librump/rumpuser/rumpuser_net.c |  19 +++++++++++++++++--
 2 files changed, 19 insertions(+), 3 deletions(-)

diffs (53 lines):

diff -r 4fee5dcc523f -r 2c789ea7e5d8 sys/rump/include/rump/rumpuser.h
--- a/sys/rump/include/rump/rumpuser.h  Wed Sep 02 17:22:53 2009 +0000
+++ b/sys/rump/include/rump/rumpuser.h  Wed Sep 02 19:02:51 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.h,v 1.24 2009/06/10 18:34:49 pooka Exp $      */
+/*     $NetBSD: rumpuser.h,v 1.25 2009/09/02 19:02:51 pooka Exp $      */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -179,5 +179,6 @@
 enum rumpuser_getnametype { RUMPUSER_SOCKNAME, RUMPUSER_PEERNAME };
 int  rumpuser_net_getname(int, struct sockaddr *, int *,
                              enum rumpuser_getnametype, int *);
+int  rumpuser_net_setsockopt(int, int, int, const void *, int, int *);
 
 #endif /* _RUMP_RUMPUSER_H_ */
diff -r 4fee5dcc523f -r 2c789ea7e5d8 sys/rump/librump/rumpuser/rumpuser_net.c
--- a/sys/rump/librump/rumpuser/rumpuser_net.c  Wed Sep 02 17:22:53 2009 +0000
+++ b/sys/rump/librump/rumpuser/rumpuser_net.c  Wed Sep 02 19:02:51 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser_net.c,v 1.6 2009/01/26 12:08:39 pooka Exp $   */
+/*     $NetBSD: rumpuser_net.c,v 1.7 2009/09/02 19:02:51 pooka Exp $   */
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: rumpuser_net.c,v 1.6 2009/01/26 12:08:39 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_net.c,v 1.7 2009/09/02 19:02:51 pooka Exp $");
 #endif /* !lint */
 
 #include <sys/types.h>
@@ -108,3 +108,18 @@
 
        return rv;
 }
+
+int
+rumpuser_net_setsockopt(int s, int level, int name,
+       const void *data, int dlen, int *error)
+{
+       socklen_t slen = dlen;
+       int rv;
+
+       rv = setsockopt(s, level, name, data, slen);
+       if (rv == -1)
+               *error = errno;
+       else
+               *error = 0;
+       return rv;
+}



Home | Main Index | Thread Index | Old Index