From: Nicholas Nethercote Date: Fri, 22 May 2009 02:00:27 +0000 (+0000) Subject: DARWIN sync: export VG_(socket). X-Git-Tag: svn/VALGRIND_3_5_0~617 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=22dfc72abd0c4b8e24e1854e3960595c804e6420;p=thirdparty%2Fvalgrind.git DARWIN sync: export VG_(socket). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10098 --- diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index 9c7e66497c..50be7c00cb 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -574,9 +574,6 @@ struct vki_sockaddr_in; static Int parse_inet_addr_and_port ( UChar* str, UInt* ip_addr, UShort* port ); -static -Int my_socket ( Int domain, Int type, Int protocol ); - static Int my_connect ( Int sockfd, struct vki_sockaddr_in* serv_addr, Int addrlen ); @@ -655,7 +652,7 @@ Int VG_(connect_via_socket)( UChar* str ) servAddr.sin_port = VG_(htons)(port); /* create socket */ - sd = my_socket(VKI_AF_INET, VKI_SOCK_STREAM, 0 /* IPPROTO_IP ? */); + sd = VG_(socket)(VKI_AF_INET, VKI_SOCK_STREAM, 0 /* IPPROTO_IP ? */); if (sd < 0) { /* this shouldn't happen ... nevertheless */ return -2; @@ -723,8 +720,8 @@ static Int parse_inet_addr_and_port ( UChar* str, UInt* ip_addr, UShort* port ) # undef GET_CH } -static -Int my_socket ( Int domain, Int type, Int protocol ) +// GrP fixme safe_fd? +Int VG_(socket) ( Int domain, Int type, Int protocol ) { # if defined(VGP_x86_linux) || defined(VGP_ppc32_linux) \ || defined(VGP_ppc64_linux) diff --git a/coregrind/pub_core_libcfile.h b/coregrind/pub_core_libcfile.h index 224c4722c4..dbd4ca8695 100644 --- a/coregrind/pub_core_libcfile.h +++ b/coregrind/pub_core_libcfile.h @@ -63,6 +63,8 @@ extern UInt VG_(ntohl) ( UInt x ); extern UShort VG_(htons) ( UShort x ); extern UShort VG_(ntohs) ( UShort x ); +extern Int VG_(socket) ( Int domain, Int type, Int protocol ); + extern Int VG_(write_socket)( Int sd, void *msg, Int count ); extern Int VG_(getsockname) ( Int sd, struct vki_sockaddr *name, Int *namelen ); extern Int VG_(getpeername) ( Int sd, struct vki_sockaddr *name, Int *namelen );