From: Jarkko Hietaniemi Date: Fri, 4 Jan 2002 20:24:59 +0000 (+0000) Subject: If we do have socketpair(), make my_socketpair() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=48ea76d1a0d7a73dd36de7c610ebe86ecefa20f7;p=p5sagit%2Fp5-mst-13.2.git If we do have socketpair(), make my_socketpair() just call the real socketpair(). This way we always have real code behind my_socketpair() and a symbol corresponding to the my_socketpair in global.sym. p4raw-id: //depot/perl@14068 --- diff --git a/embed.fnc b/embed.fnc index 9c89232..da7e2ce 100644 --- a/embed.fnc +++ b/embed.fnc @@ -1304,10 +1304,7 @@ Apd |STRLEN |sv_utf8_upgrade_flags|SV *sv|I32 flags Apd |char* |sv_pvn_force_flags|SV* sv|STRLEN* lp|I32 flags Apd |char* |sv_2pv_flags |SV* sv|STRLEN* lp|I32 flags Ap |char* |my_atof2 |const char *s|NV* value -#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) Apn |int |my_socketpair |int family|int type|int protocol|int fd[2] -#endif - #if defined(USE_PERLIO) && !defined(USE_SFIO) Ap |int |PerlIO_close |PerlIO * diff --git a/embed.h b/embed.h index 7a8e421..8a5cc4e 100644 --- a/embed.h +++ b/embed.h @@ -1203,9 +1203,7 @@ #define sv_pvn_force_flags Perl_sv_pvn_force_flags #define sv_2pv_flags Perl_sv_2pv_flags #define my_atof2 Perl_my_atof2 -#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) #define my_socketpair Perl_my_socketpair -#endif #if defined(USE_PERLIO) && !defined(USE_SFIO) #define PerlIO_close Perl_PerlIO_close #define PerlIO_fill Perl_PerlIO_fill @@ -2744,9 +2742,7 @@ #define sv_pvn_force_flags(a,b,c) Perl_sv_pvn_force_flags(aTHX_ a,b,c) #define sv_2pv_flags(a,b,c) Perl_sv_2pv_flags(aTHX_ a,b,c) #define my_atof2(a,b) Perl_my_atof2(aTHX_ a,b) -#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) #define my_socketpair Perl_my_socketpair -#endif #if defined(USE_PERLIO) && !defined(USE_SFIO) #define PerlIO_close(a) Perl_PerlIO_close(aTHX_ a) #define PerlIO_fill(a) Perl_PerlIO_fill(aTHX_ a) diff --git a/proto.h b/proto.h index 9196ddd..52d634e 100644 --- a/proto.h +++ b/proto.h @@ -5,7 +5,6 @@ */ - START_EXTERN_C #if defined(PERL_IMPLICIT_SYS) @@ -1331,10 +1330,7 @@ PERL_CALLCONV STRLEN Perl_sv_utf8_upgrade_flags(pTHX_ SV *sv, I32 flags); PERL_CALLCONV char* Perl_sv_pvn_force_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags); PERL_CALLCONV char* Perl_sv_2pv_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags); PERL_CALLCONV char* Perl_my_atof2(pTHX_ const char *s, NV* value); -#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) PERL_CALLCONV int Perl_my_socketpair(int family, int type, int protocol, int fd[2]); -#endif - #if defined(USE_PERLIO) && !defined(USE_SFIO) PERL_CALLCONV int Perl_PerlIO_close(pTHX_ PerlIO *); diff --git a/util.c b/util.c index a8e7553..6a0ff44 100644 --- a/util.c +++ b/util.c @@ -4235,3 +4235,12 @@ Perl_my_socketpair (int family, int type, int protocol, int fd[2]) { } } #endif /* !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) */ +#ifdef HAS_SOCKETPAIR +/* In any case have a stub so that there's code corresponding + * to the my_socketpair in global.sym. */ +int +Perl_my_socketpair (int family, int type, int protocol, int fd[2]) { + return socketpair(family, type, protocol, fd); +} +#endif +