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 );
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;
# 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)
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 );