int *buffer; /* the buffer */
} S64_IOB;
-static S64_IOB *_s64_get_buffer( PerlIO *f);
-static S64_IOB *_s64_create_buffer( PerlIO *f);
-static int _s64_malloc( S64_IOB *ptr);
#endif
bool
static S64_IOB *s64_buffer = (S64_IOB *) NULL;
+/* initialize the buffer area */
+/* required after a fork(2) call in order to remove side effects */
+void Perl_do_s64_init_buffer() {
+ s64_buffer = (S64_IOB *) NULL;
+}
+
/* get a buffered stream pointer */
static S64_IOB *S_s64_get_buffer( PerlIO *fp) {
S64_IOB *ptr = s64_buffer;
}
/* create a buffered stream pointer */
-static S64_IOB *_s64_create_buffer( PerlIO *f) {
+static S64_IOB *S_s64_create_buffer( PerlIO *f) {
S64_IOB *ptr = malloc( sizeof( S64_IOB));
if( ptr) {
ptr->fp = f;
/* internal buffer management */
#define _S64_BUFFER_SIZE 32
-static int _s64_malloc( S64_IOB *ptr) {
+static int S_s64_malloc( S64_IOB *ptr) {
if( ptr) {
if( !ptr->buffer) {
ptr->buffer = (int *) calloc( _S64_BUFFER_SIZE, sizeof( int));
#define do_vop Perl_do_vop
#if defined(SOCKS_64BIT_BUG)
#define s64_get_buffer S_s64_get_buffer
+#define s64_create_buffer S_s64_create_buffer
+#define s64_malloc S_s64_malloc
#endif
#define dofile Perl_dofile
#define dowantarray Perl_dowantarray
#define do_vop(a,b,c,d) Perl_do_vop(aTHX_ a,b,c,d)
#if defined(SOCKS_64BIT_BUG)
#define s64_get_buffer(a) S_s64_get_buffer(aTHX_ a)
+#define s64_create_buffer(a) S_s64_create_buffer(aTHX_ a)
+#define s64_malloc(a) S_s64_malloc(aTHX_ a)
#endif
#define dofile(a) Perl_dofile(aTHX_ a)
#define dowantarray() Perl_dowantarray(aTHX)
#define Perl_do_vop CPerlObj::Perl_do_vop
#define do_vop Perl_do_vop
#if defined(SOCKS_64BIT_BUG)
-#define S_s64_get_buffer CPerlObj::S_s64_get_buffer
-#define s64_get_buffer S_s64_get_buffer
#define do_s64_tell Perl_do_s64_tell
#define do_s64_fread Perl_do_s64_fread
#define do_s64_getc Perl_do_s64_getc
#define do_s64_seek Perl_do_s64_seek
#define do_s64_ungetc Perl_do_s64_ungetc
#define do_s64_delete_buffer Perl_do_s64_delete_buffer
+#define do_s64_init_buffer Perl_do_s64_init_buffer
+#define S_s64_get_buffer CPerlObj::S_s64_get_buffer
+#define s64_get_buffer S_s64_get_buffer
+#define S_s64_create_buffer CPerlObj::S_s64_create_buffer
+#define s64_create_buffer S_s64_create_buffer
+#define S_s64_malloc CPerlObj::S_s64_malloc
+#define s64_malloc S_s64_malloc
#endif
#define Perl_dofile CPerlObj::Perl_dofile
#define dofile Perl_dofile
p |void |do_vecset |SV* sv
p |void |do_vop |I32 optype|SV* sv|SV* left|SV* right
#if defined(SOCKS_64BIT_BUG)
-s |S64_IOB*|s64_get_buffer|PerlIO* fp
Ajnop |Off_t |do_s64_tell |PerlIO* fp
Ajnop |SSize_t|do_s64_fread |void *buf|SSize_t count|PerlIO* fp
Ajnop |int |do_s64_getc |PerlIO* fp
Ajnop |int |do_s64_seek |PerlIO* fp|Off_t pos|int whence
Ajnop |int |do_s64_ungetc |int ch|PerlIO* fp
Ajnop |void |do_s64_delete_buffer|PerlIO* fp
+Ajnop |void |do_s64_init_buffer
+s |S64_IOB * |s64_get_buffer |PerlIO *f
+s |S64_IOB * |s64_create_buffer |PerlIO *f
+s |int |s64_malloc |S64_IOB *ptr
#endif
p |OP* |dofile |OP* term
Ap |I32 |dowantarray
# All quad int platforms are assumed to have broken SOCKS
unless ($define{USE_SOCKS} && $define{USE_64_BIT_ALL}) {
skip_symbols [qw(
+ Perl_do_s64_delete_buffer
Perl_do_s64_fread
Perl_do_s64_getc
- Perl_do_s64_delete_buffer
+ Perl_do_s64_init_buffer
Perl_do_s64_seek
Perl_do_s64_tell
- Perl_do_s64_tell
+ Perl_do_s64_ungetc
)];
}
# include <libutil.h> /* setproctitle() in some FreeBSDs */
#endif
+#ifdef SOCKS_64BIT_BUG
+typedef struct __s64_iobuffer {
+ struct __s64_iobuffer *next, *last; /* Queue pointer */
+ PerlIO *fp; /* Assigned file pointer */
+ int cnt; /* Buffer counter */
+ int size; /* Buffer size */
+ int *buffer; /* The buffer */
+} S64_IOB;
+#endif
+
/* and finally... */
#define PERL_PATCHLEVEL_H_IMPLICIT
#include "patchlevel.h"
if (childpid < 0)
RETSETUNDEF;
if (!childpid) {
+#ifdef SOCKS_64BIT_BUG
+ Perl_do_s64_init_buffer();
+#endif
/*SUPPRESS 560*/
if ((tmpgv = gv_fetchpv("$", TRUE, SVt_PV)))
sv_setiv(GvSV(tmpgv), (IV)PerlProc_getpid());
PERL_CALLCONV void Perl_do_vecset(pTHX_ SV* sv);
PERL_CALLCONV void Perl_do_vop(pTHX_ I32 optype, SV* sv, SV* left, SV* right);
#if defined(SOCKS_64BIT_BUG)
-STATIC S64_IOB* S_s64_get_buffer(pTHX_ PerlIO* fp);
PERL_CALLCONV Off_t Perl_do_s64_tell(PerlIO* fp);
PERL_CALLCONV SSize_t Perl_do_s64_fread(void *buf, SSize_t count, PerlIO* fp);
PERL_CALLCONV int Perl_do_s64_getc(PerlIO* fp);
PERL_CALLCONV int Perl_do_s64_seek(PerlIO* fp, Off_t pos, int whence);
PERL_CALLCONV int Perl_do_s64_ungetc(int ch, PerlIO* fp);
PERL_CALLCONV void Perl_do_s64_delete_buffer(PerlIO* fp);
+PERL_CALLCONV void Perl_do_s64_init_buffer(void);
+STATIC S64_IOB * S_s64_get_buffer(pTHX_ PerlIO *f);
+STATIC S64_IOB * S_s64_create_buffer(pTHX_ PerlIO *f);
+STATIC int S_s64_malloc(pTHX_ S64_IOB *ptr);
#endif
PERL_CALLCONV OP* Perl_dofile(pTHX_ OP* term);
PERL_CALLCONV I32 Perl_dowantarray(pTHX);
if ($sock) {
$sock->print("ok 11\n");
$sock->print("quit\n");
+ } else {
+ print "not ok 11\n";
}
$sock = undef;
sleep(1);