summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-11-22 21:56:02 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-22 21:56:02 +0000
commit9d44748a0f52a5e96caf806267c5b6169b61e461 (patch)
tree9186821a63c56709b66539f5c2ec31606eddada8 /doio.c
parent76c6a4686250b587eb3b7bb07fd68983ded85533 (diff)
downloadperl-9d44748a0f52a5e96caf806267c5b6169b61e461.tar.gz
More SOCKS versus 64-bit patches from Jens Hamisch.
p4raw-id: //depot/perl@7818
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/doio.c b/doio.c
index bd4d353f00..3c0bcf1119 100644
--- a/doio.c
+++ b/doio.c
@@ -60,9 +60,6 @@ typedef struct __s64_iobuffer {
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
@@ -2094,6 +2091,12 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
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;
@@ -2103,7 +2106,7 @@ static S64_IOB *S_s64_get_buffer( PerlIO *fp) {
}
/* 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;
@@ -2135,7 +2138,7 @@ void Perl_do_s64_delete_buffer( PerlIO *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));