svn commit: r232805 - in stable/9/sys: kern sys
Konstantin Belousov
kib at FreeBSD.org
Sun Mar 11 00:48:55 UTC 2012
Author: kib
Date: Sun Mar 11 00:48:54 2012
New Revision: 232805
URL: http://svn.freebsd.org/changeset/base/232805
Log:
MFC r232179:
Add SO_PROTOCOL/SO_PROTOTYPE socket SOL_SOCKET-level option to get the
socket protocol number.
PR: kern/162352
Modified:
stable/9/sys/kern/uipc_socket.c
stable/9/sys/sys/socket.h
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/kern/uipc_socket.c
==============================================================================
--- stable/9/sys/kern/uipc_socket.c Sun Mar 11 00:43:01 2012 (r232804)
+++ stable/9/sys/kern/uipc_socket.c Sun Mar 11 00:48:54 2012 (r232805)
@@ -2728,6 +2728,10 @@ integer:
optval = so->so_type;
goto integer;
+ case SO_PROTOCOL:
+ optval = so->so_proto->pr_protocol;
+ goto integer;
+
case SO_ERROR:
SOCK_LOCK(so);
optval = so->so_error;
Modified: stable/9/sys/sys/socket.h
==============================================================================
--- stable/9/sys/sys/socket.h Sun Mar 11 00:43:01 2012 (r232804)
+++ stable/9/sys/sys/socket.h Sun Mar 11 00:48:54 2012 (r232805)
@@ -138,6 +138,8 @@ typedef __uid_t uid_t;
#define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */
#define SO_SETFIB 0x1014 /* use this FIB to route */
#define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */
+#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */
+#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */
#endif
/*
More information about the svn-src-stable-9
mailing list