Hi,
SSIA. I've tested it with SOCK_STREAM, SOCK_DGRAM and SOCK_SEQPACKET and it
works fine.
Cheers,
Emilio
---
pflocal/socket.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/pflocal/socket.c b/pflocal/socket.c
index 06777ca..464bbc1 100644
--- a/pflocal/socket.c
+++ b/pflocal/socket.c
@@ -1,6 +1,6 @@
/* Socket-specific operations
- Copyright (C) 1995, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1995, 2008, 2010 Free Software Foundation, Inc.
Written by Miles Bader <[email protected]>
@@ -410,14 +410,24 @@ S_socket_recv (struct sock_user *user,
return err;
}
-
-/* Stubs for currently unsupported rpcs. */
error_t
S_socket_getopt (struct sock_user *user,
int level, int opt,
char **value, size_t *value_len)
{
+ if (level == SOL_SOCKET)
+ {
+ if (opt == SO_TYPE)
+ {
+ if (value_len == NULL || value == NULL || *value == NULL)
+ return EINVAL;
+ *(int*)*value = user->sock->pipe_class->sock_type;
+ *value_len = sizeof (user->sock->pipe_class->sock_type);
+ return 0;
+ }
+ }
+
return EOPNOTSUPP;
}
--
1.7.1