]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add method for isc_socket_getfd
authorMark Andrews <marka@isc.org>
Wed, 24 Aug 2011 23:17:52 +0000 (23:17 +0000)
committerMark Andrews <marka@isc.org>
Wed, 24 Aug 2011 23:17:52 +0000 (23:17 +0000)
lib/isc/include/isc/socket.h
lib/isc/socket_api.c
lib/isc/unix/socket.c

index 036025c0eee110600e530c5195d3c8bd07585b3b..5749f8272f6d986263e094b2fc7327c3928b8057 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.h,v 1.97 2011/07/28 23:47:59 tbox Exp $ */
+/* $Id: socket.h,v 1.98 2011/08/24 23:17:52 marka Exp $ */
 
 #ifndef ISC_SOCKET_H
 #define ISC_SOCKET_H 1
@@ -298,6 +298,7 @@ typedef struct isc_socketmethods {
        isc_result_t    (*fdwatchpoke)(isc_socket_t *sock, int flags);
        isc_result_t            (*dup)(isc_socket_t *socket,
                                  isc_socket_t **socketp);
+       int             (*getfd)(isc_socket_t *socket);
 } isc_socketmethods_t;
 
 /*%
index bbf371b1df74719993fedad717822499bb3e561c..e2afe05f0487e4f69129ec1e3af265eddb27f76c 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket_api.c,v 1.7 2011/07/28 23:47:59 tbox Exp $ */
+/* $Id: socket_api.c,v 1.8 2011/08/24 23:17:52 marka Exp $ */
 
 #include <config.h>
 
@@ -222,3 +222,10 @@ isc_socket_dup(isc_socket_t *sock, isc_socket_t **socketp) {
 
        return(sock->methods->dup(sock, socketp));
 }
+
+int
+isc_socket_getfd(isc_socket_t *sock) {
+       REQUIRE(ISCAPI_SOCKET_VALID(sock));
+
+       return(sock->methods->getfd(sock));
+}
index 2ae0bce77b30094f6fda9a666015c6ca1b3c176d..aa0227c87a26ddbba112ccf4a16e0a512701812c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: socket.c,v 1.345 2011/08/23 17:02:53 each Exp $ */
+/* $Id: socket.c,v 1.346 2011/08/24 23:17:52 marka Exp $ */
 
 /*! \file */
 
@@ -553,6 +553,8 @@ ISC_SOCKETFUNC_SCOPE isc_result_t
 isc__socket_fdwatchpoke(isc_socket_t *sock, int flags);
 ISC_SOCKETFUNC_SCOPE isc_result_t
 isc__socket_dup(isc_socket_t *sock, isc_socket_t **socketp);
+ISC_SOCKETFUNC_SCOPE int
+isc__socket_getfd(isc_socket_t *sock);
 
 static struct {
        isc_socketmethods_t methods;
@@ -577,7 +579,8 @@ static struct {
                isc__socket_gettype,
                isc__socket_ipv6only,
                isc__socket_fdwatchpoke,
-               isc__socket_dup
+               isc__socket_dup,
+               isc__socket_getfd
        }
 #ifndef BIND9
        ,