2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

add method for isc_socket_getfd

This commit is contained in:
Mark Andrews 2011-08-24 23:17:52 +00:00
parent 8a7bf4a907
commit b62c2acf81
3 changed files with 15 additions and 4 deletions

View 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;
/*%

View 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));
}

View 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
,