This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PL_debug_pad wasn't initialized to zeroes which broke
[perl5.git] / iperlsys.h
1 /*
2  * iperlsys.h - Perl's interface to the system
3  *
4  * This file defines the system level functionality that perl needs.
5  *
6  * When using C, this definition is in the form of a set of macros
7  * that can be #defined to the system-level function (or a wrapper
8  * provided elsewhere).
9  *
10  * GSAR 21-JUN-98
11  */
12
13 #ifndef __Inc__IPerl___
14 #define __Inc__IPerl___
15
16 /*
17  *      PerlXXX_YYY explained - DickH and DougL @ ActiveState.com
18  *
19  * XXX := functional group
20  * YYY := stdlib/OS function name
21  *
22  * Continuing with the theme of PerlIO, all OS functionality was
23  * encapsulated into one of several interfaces.
24  *
25  * PerlIO - stdio
26  * PerlLIO - low level I/O
27  * PerlMem - malloc, realloc, free
28  * PerlDir - directory related
29  * PerlEnv - process environment handling
30  * PerlProc - process control
31  * PerlSock - socket functions
32  *
33  *
34  * The features of this are:
35  * 1. All OS dependant code is in the Perl Host and not the Perl Core.
36  *    (At least this is the holy grail goal of this work)
37  * 2. The Perl Host (see perl.h for description) can provide a new and
38  *    improved interface to OS functionality if required.
39  * 3. Developers can easily hook into the OS calls for instrumentation
40  *    or diagnostic purposes.
41  *
42  * What was changed to do this:
43  * 1. All calls to OS functions were replaced with PerlXXX_YYY
44  *
45  */
46
47 /*
48     Interface for perl stdio functions, or whatever we are Configure-d
49     to use.
50 */
51 #include "perlio.h"
52
53 #ifndef Sighandler_t
54 typedef Signal_t (*Sighandler_t) (int);
55 #endif
56
57 #if defined(PERL_IMPLICIT_SYS)
58
59 /* IPerlStdIO           */
60 struct IPerlStdIO;
61 struct IPerlStdIOInfo;
62 typedef FILE*           (*LPStdin)(struct IPerlStdIO*);
63 typedef FILE*           (*LPStdout)(struct IPerlStdIO*);
64 typedef FILE*           (*LPStderr)(struct IPerlStdIO*);
65 typedef FILE*           (*LPOpen)(struct IPerlStdIO*, const char*,
66                             const char*);
67 typedef int             (*LPClose)(struct IPerlStdIO*, FILE*);
68 typedef int             (*LPEof)(struct IPerlStdIO*, FILE*);
69 typedef int             (*LPError)(struct IPerlStdIO*, FILE*);
70 typedef void            (*LPClearerr)(struct IPerlStdIO*, FILE*);
71 typedef int             (*LPGetc)(struct IPerlStdIO*, FILE*);
72 typedef char*           (*LPGetBase)(struct IPerlStdIO*, FILE*);
73 typedef int             (*LPGetBufsiz)(struct IPerlStdIO*, FILE*);
74 typedef int             (*LPGetCnt)(struct IPerlStdIO*, FILE*);
75 typedef char*           (*LPGetPtr)(struct IPerlStdIO*, FILE*);
76 typedef char*           (*LPGets)(struct IPerlStdIO*, FILE*, char*, int);
77 typedef int             (*LPPutc)(struct IPerlStdIO*, FILE*, int);
78 typedef int             (*LPPuts)(struct IPerlStdIO*, FILE*, const char*);
79 typedef int             (*LPFlush)(struct IPerlStdIO*, FILE*);
80 typedef int             (*LPUngetc)(struct IPerlStdIO*, int,FILE*);
81 typedef int             (*LPFileno)(struct IPerlStdIO*, FILE*);
82 typedef FILE*           (*LPFdopen)(struct IPerlStdIO*, int, const char*);
83 typedef FILE*           (*LPReopen)(struct IPerlStdIO*, const char*,
84                             const char*, FILE*);
85 typedef SSize_t         (*LPRead)(struct IPerlStdIO*, void*, Size_t, Size_t, FILE *);
86 typedef SSize_t         (*LPWrite)(struct IPerlStdIO*, const void*, Size_t, Size_t, FILE *);
87 typedef void            (*LPSetBuf)(struct IPerlStdIO*, FILE*, char*);
88 typedef int             (*LPSetVBuf)(struct IPerlStdIO*, FILE*, char*, int,
89                             Size_t);
90 typedef void            (*LPSetCnt)(struct IPerlStdIO*, FILE*, int);
91 typedef void            (*LPSetPtr)(struct IPerlStdIO*, FILE*, char*);
92 typedef void            (*LPSetlinebuf)(struct IPerlStdIO*, FILE*);
93 typedef int             (*LPPrintf)(struct IPerlStdIO*, FILE*, const char*,
94                             ...);
95 typedef int             (*LPVprintf)(struct IPerlStdIO*, FILE*, const char*,
96                             va_list);
97 typedef long            (*LPTell)(struct IPerlStdIO*, FILE*);
98 typedef int             (*LPSeek)(struct IPerlStdIO*, FILE*, Off_t, int);
99 typedef void            (*LPRewind)(struct IPerlStdIO*, FILE*);
100 typedef FILE*           (*LPTmpfile)(struct IPerlStdIO*);
101 typedef int             (*LPGetpos)(struct IPerlStdIO*, FILE*, Fpos_t*);
102 typedef int             (*LPSetpos)(struct IPerlStdIO*, FILE*,
103                             const Fpos_t*);
104 typedef void            (*LPInit)(struct IPerlStdIO*);
105 typedef void            (*LPInitOSExtras)(struct IPerlStdIO*);
106 typedef FILE*           (*LPFdupopen)(struct IPerlStdIO*, FILE*);
107
108 struct IPerlStdIO
109 {
110     LPStdin             pStdin;
111     LPStdout            pStdout;
112     LPStderr            pStderr;
113     LPOpen              pOpen;
114     LPClose             pClose;
115     LPEof               pEof;
116     LPError             pError;
117     LPClearerr          pClearerr;
118     LPGetc              pGetc;
119     LPGetBase           pGetBase;
120     LPGetBufsiz         pGetBufsiz;
121     LPGetCnt            pGetCnt;
122     LPGetPtr            pGetPtr;
123     LPGets              pGets;
124     LPPutc              pPutc;
125     LPPuts              pPuts;
126     LPFlush             pFlush;
127     LPUngetc            pUngetc;
128     LPFileno            pFileno;
129     LPFdopen            pFdopen;
130     LPReopen            pReopen;
131     LPRead              pRead;
132     LPWrite             pWrite;
133     LPSetBuf            pSetBuf;
134     LPSetVBuf           pSetVBuf;
135     LPSetCnt            pSetCnt;
136     LPSetPtr            pSetPtr;
137     LPSetlinebuf        pSetlinebuf;
138     LPPrintf            pPrintf;
139     LPVprintf           pVprintf;
140     LPTell              pTell;
141     LPSeek              pSeek;
142     LPRewind            pRewind;
143     LPTmpfile           pTmpfile;
144     LPGetpos            pGetpos;
145     LPSetpos            pSetpos;
146     LPInit              pInit;
147     LPInitOSExtras      pInitOSExtras;
148     LPFdupopen          pFdupopen;
149 };
150
151 struct IPerlStdIOInfo
152 {
153     unsigned long       nCount;     /* number of entries expected */
154     struct IPerlStdIO   perlStdIOList;
155 };
156
157 /* These do not belong here ... NI-S, 14 Nov 2000 */
158
159 #ifdef USE_STDIO_PTR
160 #  define PerlSIO_has_cntptr(f)         1
161 #  ifdef STDIO_PTR_LVALUE
162 #    ifdef  STDIO_CNT_LVALUE
163 #      define PerlSIO_canset_cnt(f)     1
164 #      ifdef STDIO_PTR_LVAL_NOCHANGE_CNT
165 #        define PerlSIO_fast_gets(f)    1
166 #      endif
167 #    else /* STDIO_CNT_LVALUE */
168 #      define PerlSIO_canset_cnt(f)     0
169 #    endif
170 #  else /* STDIO_PTR_LVALUE */
171 #    ifdef STDIO_PTR_LVAL_SETS_CNT
172 #      define PerlSIO_fast_gets(f)      1
173 #    endif
174 #  endif
175 #else  /* USE_STDIO_PTR */
176 #  define PerlSIO_has_cntptr(f)         0
177 #  define PerlSIO_canset_cnt(f)         0
178 #endif /* USE_STDIO_PTR */
179
180 #ifndef PerlSIO_fast_gets
181 #define PerlSIO_fast_gets(f)            0
182 #endif
183
184 #ifdef FILE_base
185 #define PerlSIO_has_base(f)             1
186 #else
187 #define PerlSIO_has_base(f)             0
188 #endif
189
190 /* Now take FILE * via function table */
191
192 #define PerlSIO_stdin                                                   \
193         (*PL_StdIO->pStdin)(PL_StdIO)
194 #define PerlSIO_stdout                                                  \
195         (*PL_StdIO->pStdout)(PL_StdIO)
196 #define PerlSIO_stderr                                                  \
197         (*PL_StdIO->pStderr)(PL_StdIO)
198 #define PerlSIO_fopen(x,y)                                              \
199         (*PL_StdIO->pOpen)(PL_StdIO, (x),(y))
200 #define PerlSIO_fclose(f)                                               \
201         (*PL_StdIO->pClose)(PL_StdIO, (f))
202 #define PerlSIO_feof(f)                                                 \
203         (*PL_StdIO->pEof)(PL_StdIO, (f))
204 #define PerlSIO_ferror(f)                                               \
205         (*PL_StdIO->pError)(PL_StdIO, (f))
206 #define PerlSIO_clearerr(f)                                             \
207         (*PL_StdIO->pClearerr)(PL_StdIO, (f))
208 #define PerlSIO_fgetc(f)                                                \
209         (*PL_StdIO->pGetc)(PL_StdIO, (f))
210 #define PerlSIO_get_base(f)                                             \
211         (*PL_StdIO->pGetBase)(PL_StdIO, (f))
212 #define PerlSIO_get_bufsiz(f)                                           \
213         (*PL_StdIO->pGetBufsiz)(PL_StdIO, (f))
214 #define PerlSIO_get_cnt(f)                                              \
215         (*PL_StdIO->pGetCnt)(PL_StdIO, (f))
216 #define PerlSIO_get_ptr(f)                                              \
217         (*PL_StdIO->pGetPtr)(PL_StdIO, (f))
218 #define PerlSIO_fputc(f,c)                                              \
219         (*PL_StdIO->pPutc)(PL_StdIO, (f),(c))
220 #define PerlSIO_fputs(f,s)                                              \
221         (*PL_StdIO->pPuts)(PL_StdIO, (f),(s))
222 #define PerlSIO_fflush(f)                                               \
223         (*PL_StdIO->pFlush)(PL_StdIO, (f))
224 #define PerlSIO_fgets(s, n, fp)                                         \
225         (*PL_StdIO->pGets)(PL_StdIO, (fp), s, n)
226 #define PerlSIO_ungetc(c,f)                                             \
227         (*PL_StdIO->pUngetc)(PL_StdIO, (c),(f))
228 #define PerlSIO_fileno(f)                                               \
229         (*PL_StdIO->pFileno)(PL_StdIO, (f))
230 #define PerlSIO_fdopen(f, s)                                            \
231         (*PL_StdIO->pFdopen)(PL_StdIO, (f),(s))
232 #define PerlSIO_freopen(p, m, f)                                        \
233         (*PL_StdIO->pReopen)(PL_StdIO, (p), (m), (f))
234 #define PerlSIO_fread(buf,sz,count,f)                                   \
235         (*PL_StdIO->pRead)(PL_StdIO, (buf), (sz), (count), (f))
236 #define PerlSIO_fwrite(buf,sz,count,f)                                  \
237         (*PL_StdIO->pWrite)(PL_StdIO, (buf), (sz), (count), (f))
238 #define PerlSIO_setbuf(f,b)                                             \
239         (*PL_StdIO->pSetBuf)(PL_StdIO, (f), (b))
240 #define PerlSIO_setvbuf(f,b,t,s)                                        \
241         (*PL_StdIO->pSetVBuf)(PL_StdIO, (f),(b),(t),(s))
242 #define PerlSIO_set_cnt(f,c)                                            \
243         (*PL_StdIO->pSetCnt)(PL_StdIO, (f), (c))
244 #define PerlSIO_set_ptr(f,p)                                            \
245         (*PL_StdIO->pSetPtr)(PL_StdIO, (f), (p))
246 #define PerlSIO_setlinebuf(f)                                           \
247         (*PL_StdIO->pSetlinebuf)(PL_StdIO, (f))
248 #define PerlSIO_printf          Perl_fprintf_nocontext
249 #define PerlSIO_stdoutf         Perl_printf_nocontext
250 #define PerlSIO_vprintf(f,fmt,a)                                                \
251         (*PL_StdIO->pVprintf)(PL_StdIO, (f),(fmt),a)
252 #define PerlSIO_ftell(f)                                                        \
253         (*PL_StdIO->pTell)(PL_StdIO, (f))
254 #define PerlSIO_fseek(f,o,w)                                            \
255         (*PL_StdIO->pSeek)(PL_StdIO, (f),(o),(w))
256 #define PerlSIO_fgetpos(f,p)                                            \
257         (*PL_StdIO->pGetpos)(PL_StdIO, (f),(p))
258 #define PerlSIO_fsetpos(f,p)                                            \
259         (*PL_StdIO->pSetpos)(PL_StdIO, (f),(p))
260 #define PerlSIO_rewind(f)                                               \
261         (*PL_StdIO->pRewind)(PL_StdIO, (f))
262 #define PerlSIO_tmpfile()                                               \
263         (*PL_StdIO->pTmpfile)(PL_StdIO)
264 #define PerlSIO_init()                                                  \
265         (*PL_StdIO->pInit)(PL_StdIO)
266 #undef  init_os_extras
267 #define init_os_extras()                                                \
268         (*PL_StdIO->pInitOSExtras)(PL_StdIO)
269 #define PerlSIO_fdupopen(f)                                             \
270         (*PL_StdIO->pFdupopen)(PL_StdIO, (f))
271
272 #else   /* PERL_IMPLICIT_SYS */
273
274 #define PerlSIO_stdin                   stdin
275 #define PerlSIO_stdout                  stdout
276 #define PerlSIO_stderr                  stderr
277 #define PerlSIO_fopen(x,y)              fopen(x,y)
278 #define PerlSIO_fclose(f)               fclose(f)
279 #define PerlSIO_feof(f)                 feof(f)
280 #define PerlSIO_ferror(f)               ferror(f)
281 #define PerlSIO_clearerr(f)             clearerr(f)
282 #define PerlSIO_fgetc(f)                        fgetc(f)
283 #ifdef FILE_base
284 #define PerlSIO_get_base(f)             FILE_base(f)
285 #define PerlSIO_get_bufsiz(f)           FILE_bufsiz(f)
286 #else
287 #define PerlSIO_get_base(f)             NULL
288 #define PerlSIO_get_bufsiz(f)           0
289 #endif
290 #ifdef USE_STDIO_PTR
291 #define PerlSIO_get_cnt(f)              FILE_cnt(f)
292 #define PerlSIO_get_ptr(f)              FILE_ptr(f)
293 #else
294 #define PerlSIO_get_cnt(f)              0
295 #define PerlSIO_get_ptr(f)              NULL
296 #endif
297 #define PerlSIO_fputc(f,c)              fputc(c,f)
298 #define PerlSIO_fputs(f,s)              fputs(s,f)
299 #define PerlSIO_fflush(f)               Fflush(f)
300 #define PerlSIO_fgets(s, n, fp)         fgets(s,n,fp)
301 #if defined(VMS) && defined(__DECC)
302      /* Unusual definition of ungetc() here to accomodate fast_sv_gets()'
303       * belief that it can mix getc/ungetc with reads from stdio buffer */
304      int decc$ungetc(int __c, FILE *__stream);
305 #    define PerlSIO_ungetc(c,f) ((c) == EOF ? EOF : \
306             ((*(f) && !((*(f))->_flag & _IONBF) && \
307             ((*(f))->_ptr > (*(f))->_base)) ? \
308             ((*(f))->_cnt++, *(--(*(f))->_ptr) = (c)) : decc$ungetc(c,f)))
309 #else
310 #  define PerlSIO_ungetc(c,f)          ungetc(c,f)
311 #endif
312 #define PerlSIO_fileno(f)               fileno(f)
313 #define PerlSIO_fdopen(f, s)            fdopen(f,s)
314 #define PerlSIO_freopen(p, m, f)        freopen(p,m,f)
315 #define PerlSIO_fread(buf,sz,count,f)   fread(buf,sz,count,f)
316 #define PerlSIO_fwrite(buf,sz,count,f)  fwrite(buf,sz,count,f)
317 #define PerlSIO_setbuf(f,b)             setbuf(f,b)
318 #define PerlSIO_setvbuf(f,b,t,s)        setvbuf(f,b,t,s)
319 #if defined(USE_STDIO_PTR) && defined(STDIO_CNT_LVALUE)
320 #define PerlSIO_set_cnt(f,c)            FILE_cnt(f) = (c)
321 #else
322 #define PerlSIO_set_cnt(f,c)            PerlIOProc_abort()
323 #endif
324 #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE)
325 #define PerlSIO_set_ptr(f,p)            FILE_ptr(f) = (p)
326 #else
327 #define PerlSIO_set_ptr(f,p)            PerlIOProc_abort()
328 #endif
329 #define PerlSIO_setlinebuf(f)           setlinebuf(f)
330 #define PerlSIO_printf                  Perl_fprintf_nocontext
331 #define PerlSIO_stdoutf                 *PL_StdIO->pPrintf
332 #define PerlSIO_vprintf(f,fmt,a)        
333 #define PerlSIO_ftell(f)                ftell(f)
334 #define PerlSIO_fseek(f,o,w)            fseek(f,o,w)
335 #define PerlSIO_fgetpos(f,p)            fgetpos(f,p)
336 #define PerlSIO_fsetpos(f,p)            fsetpos(f,p)
337 #define PerlSIO_rewind(f)               rewind(f)
338 #define PerlSIO_tmpfile()               tmpfile()
339 #define PerlSIO_fdupopen(f)             (f)
340
341 #endif  /* PERL_IMPLICIT_SYS */
342
343 /*
344  *   Interface for directory functions
345  */
346
347 #if defined(PERL_IMPLICIT_SYS)
348
349 /* IPerlDir             */
350 struct IPerlDir;
351 struct IPerlDirInfo;
352 typedef int             (*LPMakedir)(struct IPerlDir*, const char*, int);
353 typedef int             (*LPChdir)(struct IPerlDir*, const char*);
354 typedef int             (*LPRmdir)(struct IPerlDir*, const char*);
355 typedef int             (*LPDirClose)(struct IPerlDir*, DIR*);
356 typedef DIR*            (*LPDirOpen)(struct IPerlDir*, char*);
357 typedef struct direct*  (*LPDirRead)(struct IPerlDir*, DIR*);
358 typedef void            (*LPDirRewind)(struct IPerlDir*, DIR*);
359 typedef void            (*LPDirSeek)(struct IPerlDir*, DIR*, long);
360 typedef long            (*LPDirTell)(struct IPerlDir*, DIR*);
361 #ifdef WIN32
362 typedef char*           (*LPDirMapPathA)(struct IPerlDir*, const char*);
363 typedef WCHAR*          (*LPDirMapPathW)(struct IPerlDir*, const WCHAR*);
364 #endif
365
366 struct IPerlDir
367 {
368     LPMakedir           pMakedir;
369     LPChdir             pChdir;
370     LPRmdir             pRmdir;
371     LPDirClose          pClose;
372     LPDirOpen           pOpen;
373     LPDirRead           pRead;
374     LPDirRewind         pRewind;
375     LPDirSeek           pSeek;
376     LPDirTell           pTell;
377 #ifdef WIN32
378     LPDirMapPathA       pMapPathA;
379     LPDirMapPathW       pMapPathW;
380 #endif
381 };
382
383 struct IPerlDirInfo
384 {
385     unsigned long       nCount;     /* number of entries expected */
386     struct IPerlDir     perlDirList;
387 };
388
389 #define PerlDir_mkdir(name, mode)                               \
390         (*PL_Dir->pMakedir)(PL_Dir, (name), (mode))
391 #define PerlDir_chdir(name)                                     \
392         (*PL_Dir->pChdir)(PL_Dir, (name))
393 #define PerlDir_rmdir(name)                                     \
394         (*PL_Dir->pRmdir)(PL_Dir, (name))
395 #define PerlDir_close(dir)                                      \
396         (*PL_Dir->pClose)(PL_Dir, (dir))
397 #define PerlDir_open(name)                                      \
398         (*PL_Dir->pOpen)(PL_Dir, (name))
399 #define PerlDir_read(dir)                                       \
400         (*PL_Dir->pRead)(PL_Dir, (dir))
401 #define PerlDir_rewind(dir)                                     \
402         (*PL_Dir->pRewind)(PL_Dir, (dir))
403 #define PerlDir_seek(dir, loc)                                  \
404         (*PL_Dir->pSeek)(PL_Dir, (dir), (loc))
405 #define PerlDir_tell(dir)                                       \
406         (*PL_Dir->pTell)(PL_Dir, (dir))
407 #ifdef WIN32
408 #define PerlDir_mapA(dir)                                       \
409         (*PL_Dir->pMapPathA)(PL_Dir, (dir))
410 #define PerlDir_mapW(dir)                                       \
411         (*PL_Dir->pMapPathW)(PL_Dir, (dir))
412 #endif
413
414 #else   /* PERL_IMPLICIT_SYS */
415
416 #define PerlDir_mkdir(name, mode)       Mkdir((name), (mode))
417 #ifdef VMS
418 #  define PerlDir_chdir(n)              Chdir((n))
419 #else
420 #  define PerlDir_chdir(name)           chdir((name))
421 #endif
422 #define PerlDir_rmdir(name)             rmdir((name))
423 #define PerlDir_close(dir)              closedir((dir))
424 #define PerlDir_open(name)              opendir((name))
425 #define PerlDir_read(dir)               readdir((dir))
426 #define PerlDir_rewind(dir)             rewinddir((dir))
427 #define PerlDir_seek(dir, loc)          seekdir((dir), (loc))
428 #define PerlDir_tell(dir)               telldir((dir))
429 #ifdef WIN32
430 #define PerlDir_mapA(dir)               dir
431 #define PerlDir_mapW(dir)               dir
432 #endif
433
434 #endif  /* PERL_IMPLICIT_SYS */
435
436 /*
437     Interface for perl environment functions
438 */
439
440 #if defined(PERL_IMPLICIT_SYS)
441
442 /* IPerlEnv             */
443 struct IPerlEnv;
444 struct IPerlEnvInfo;
445 typedef char*           (*LPEnvGetenv)(struct IPerlEnv*, const char*);
446 typedef int             (*LPEnvPutenv)(struct IPerlEnv*, const char*);
447 typedef char*           (*LPEnvGetenv_len)(struct IPerlEnv*,
448                                     const char *varname, unsigned long *len);
449 typedef int             (*LPEnvUname)(struct IPerlEnv*, struct utsname *name);
450 typedef void            (*LPEnvClearenv)(struct IPerlEnv*);
451 typedef void*           (*LPEnvGetChildenv)(struct IPerlEnv*);
452 typedef void            (*LPEnvFreeChildenv)(struct IPerlEnv*, void* env);
453 typedef char*           (*LPEnvGetChilddir)(struct IPerlEnv*);
454 typedef void            (*LPEnvFreeChilddir)(struct IPerlEnv*, char* dir);
455 #ifdef HAS_ENVGETENV
456 typedef char*           (*LPENVGetenv)(struct IPerlEnv*, const char *varname);
457 typedef char*           (*LPENVGetenv_len)(struct IPerlEnv*,
458                                     const char *varname, unsigned long *len);
459 #endif
460 #ifdef WIN32
461 typedef unsigned long   (*LPEnvOsID)(struct IPerlEnv*);
462 typedef char*           (*LPEnvLibPath)(struct IPerlEnv*, const char*);
463 typedef char*           (*LPEnvSiteLibPath)(struct IPerlEnv*, const char*);
464 typedef char*           (*LPEnvVendorLibPath)(struct IPerlEnv*, const char*);
465 typedef void            (*LPEnvGetChildIO)(struct IPerlEnv*, child_IO_table*);
466 #endif
467
468 struct IPerlEnv
469 {
470     LPEnvGetenv         pGetenv;
471     LPEnvPutenv         pPutenv;
472     LPEnvGetenv_len     pGetenv_len;
473     LPEnvUname          pEnvUname;
474     LPEnvClearenv       pClearenv;
475     LPEnvGetChildenv    pGetChildenv;
476     LPEnvFreeChildenv   pFreeChildenv;
477     LPEnvGetChilddir    pGetChilddir;
478     LPEnvFreeChilddir   pFreeChilddir;
479 #ifdef HAS_ENVGETENV
480     LPENVGetenv         pENVGetenv;
481     LPENVGetenv_len     pENVGetenv_len;
482 #endif
483 #ifdef WIN32
484     LPEnvOsID           pEnvOsID;
485     LPEnvLibPath        pLibPath;
486     LPEnvSiteLibPath    pSiteLibPath;
487     LPEnvVendorLibPath  pVendorLibPath;
488     LPEnvGetChildIO     pGetChildIO;
489 #endif
490 };
491
492 struct IPerlEnvInfo
493 {
494     unsigned long       nCount;     /* number of entries expected */
495     struct IPerlEnv     perlEnvList;
496 };
497
498 #define PerlEnv_putenv(str)                                     \
499         (*PL_Env->pPutenv)(PL_Env,(str))
500 #define PerlEnv_getenv(str)                                     \
501         (*PL_Env->pGetenv)(PL_Env,(str))
502 #define PerlEnv_getenv_len(str,l)                               \
503         (*PL_Env->pGetenv_len)(PL_Env,(str), (l))
504 #define PerlEnv_clearenv()                                      \
505         (*PL_Env->pClearenv)(PL_Env)
506 #define PerlEnv_get_childenv()                                  \
507         (*PL_Env->pGetChildenv)(PL_Env)
508 #define PerlEnv_free_childenv(e)                                \
509         (*PL_Env->pFreeChildenv)(PL_Env, (e))
510 #define PerlEnv_get_childdir()                                  \
511         (*PL_Env->pGetChilddir)(PL_Env)
512 #define PerlEnv_free_childdir(d)                                \
513         (*PL_Env->pFreeChilddir)(PL_Env, (d))
514 #ifdef HAS_ENVGETENV
515 #  define PerlEnv_ENVgetenv(str)                                \
516         (*PL_Env->pENVGetenv)(PL_Env,(str))
517 #  define PerlEnv_ENVgetenv_len(str,l)                          \
518         (*PL_Env->pENVGetenv_len)(PL_Env,(str), (l))
519 #else
520 #  define PerlEnv_ENVgetenv(str)                                \
521         PerlEnv_getenv((str))
522 #  define PerlEnv_ENVgetenv_len(str,l)                          \
523         PerlEnv_getenv_len((str),(l))
524 #endif
525 #define PerlEnv_uname(name)                                     \
526         (*PL_Env->pEnvUname)(PL_Env,(name))
527 #ifdef WIN32
528 #define PerlEnv_os_id()                                         \
529         (*PL_Env->pEnvOsID)(PL_Env)
530 #define PerlEnv_lib_path(str)                                   \
531         (*PL_Env->pLibPath)(PL_Env,(str))
532 #define PerlEnv_sitelib_path(str)                               \
533         (*PL_Env->pSiteLibPath)(PL_Env,(str))
534 #define PerlEnv_vendorlib_path(str)                             \
535         (*PL_Env->pVendorLibPath)(PL_Env,(str))
536 #define PerlEnv_get_child_IO(ptr)                               \
537         (*PL_Env->pGetChildIO)(PL_Env, ptr)
538 #endif
539
540 #else   /* PERL_IMPLICIT_SYS */
541
542 #define PerlEnv_putenv(str)             putenv((str))
543 #define PerlEnv_getenv(str)             getenv((str))
544 #define PerlEnv_getenv_len(str,l)       getenv_len((str), (l))
545 #ifdef HAS_ENVGETENV
546 #  define PerlEnv_ENVgetenv(str)        ENVgetenv((str))
547 #  define PerlEnv_ENVgetenv_len(str,l)  ENVgetenv_len((str), (l))
548 #else
549 #  define PerlEnv_ENVgetenv(str)        PerlEnv_getenv((str))
550 #  define PerlEnv_ENVgetenv_len(str,l)  PerlEnv_getenv_len((str), (l))
551 #endif
552 #define PerlEnv_uname(name)             uname((name))
553
554 #ifdef WIN32
555 #define PerlEnv_os_id()                 win32_os_id()
556 #define PerlEnv_lib_path(str)           win32_get_privlib(str)
557 #define PerlEnv_sitelib_path(str)       win32_get_sitelib(str)
558 #define PerlEnv_vendorlib_path(str)     win32_get_vendorlib(str)
559 #define PerlEnv_get_child_IO(ptr)       win32_get_child_IO(ptr)
560 #define PerlEnv_clearenv()              win32_clearenv()
561 #define PerlEnv_get_childenv()          win32_get_childenv()
562 #define PerlEnv_free_childenv(e)        win32_free_childenv((e))
563 #define PerlEnv_get_childdir()          win32_get_childdir()
564 #define PerlEnv_free_childdir(d)        win32_free_childdir((d))
565 #else
566 #define PerlEnv_clearenv()              clearenv()
567 #define PerlEnv_get_childenv()          get_childenv()
568 #define PerlEnv_free_childenv(e)        free_childenv((e))
569 #define PerlEnv_get_childdir()          get_childdir()
570 #define PerlEnv_free_childdir(d)        free_childdir((d))
571 #endif
572
573 #endif  /* PERL_IMPLICIT_SYS */
574
575 /*
576     Interface for perl low-level IO functions
577 */
578
579 #if defined(PERL_IMPLICIT_SYS)
580
581 /* IPerlLIO             */
582 struct IPerlLIO;
583 struct IPerlLIOInfo;
584 typedef int             (*LPLIOAccess)(struct IPerlLIO*, const char*, int);
585 typedef int             (*LPLIOChmod)(struct IPerlLIO*, const char*, int);
586 typedef int             (*LPLIOChown)(struct IPerlLIO*, const char*, uid_t,
587                             gid_t);
588 typedef int             (*LPLIOChsize)(struct IPerlLIO*, int, long);
589 typedef int             (*LPLIOClose)(struct IPerlLIO*, int);
590 typedef int             (*LPLIODup)(struct IPerlLIO*, int);
591 typedef int             (*LPLIODup2)(struct IPerlLIO*, int, int);
592 typedef int             (*LPLIOFlock)(struct IPerlLIO*, int, int);
593 typedef int             (*LPLIOFileStat)(struct IPerlLIO*, int, struct stat*);
594 typedef int             (*LPLIOIOCtl)(struct IPerlLIO*, int, unsigned int,
595                             char*);
596 typedef int             (*LPLIOIsatty)(struct IPerlLIO*, int);
597 typedef int             (*LPLIOLink)(struct IPerlLIO*, const char*,
598                                      const char *);
599 typedef long            (*LPLIOLseek)(struct IPerlLIO*, int, long, int);
600 typedef int             (*LPLIOLstat)(struct IPerlLIO*, const char*,
601                             struct stat*);
602 typedef char*           (*LPLIOMktemp)(struct IPerlLIO*, char*);
603 typedef int             (*LPLIOOpen)(struct IPerlLIO*, const char*, int);       
604 typedef int             (*LPLIOOpen3)(struct IPerlLIO*, const char*, int, int); 
605 typedef int             (*LPLIORead)(struct IPerlLIO*, int, void*, unsigned int);
606 typedef int             (*LPLIORename)(struct IPerlLIO*, const char*,
607                             const char*);
608 #ifdef NETWARE
609 typedef int             (*LPLIOSetmode)(struct IPerlLIO*, FILE*, int);
610 #else
611 typedef int             (*LPLIOSetmode)(struct IPerlLIO*, int, int);
612 #endif  /* NETWARE */
613 typedef int             (*LPLIONameStat)(struct IPerlLIO*, const char*,
614                             struct stat*);
615 typedef char*           (*LPLIOTmpnam)(struct IPerlLIO*, char*);
616 typedef int             (*LPLIOUmask)(struct IPerlLIO*, int);
617 typedef int             (*LPLIOUnlink)(struct IPerlLIO*, const char*);
618 typedef int             (*LPLIOUtime)(struct IPerlLIO*, char*, struct utimbuf*);
619 typedef int             (*LPLIOWrite)(struct IPerlLIO*, int, const void*,
620                             unsigned int);
621
622 struct IPerlLIO
623 {
624     LPLIOAccess         pAccess;
625     LPLIOChmod          pChmod;
626     LPLIOChown          pChown;
627     LPLIOChsize         pChsize;
628     LPLIOClose          pClose;
629     LPLIODup            pDup;
630     LPLIODup2           pDup2;
631     LPLIOFlock          pFlock;
632     LPLIOFileStat       pFileStat;
633     LPLIOIOCtl          pIOCtl;
634     LPLIOIsatty         pIsatty;
635     LPLIOLink           pLink;
636     LPLIOLseek          pLseek;
637     LPLIOLstat          pLstat;
638     LPLIOMktemp         pMktemp;
639     LPLIOOpen           pOpen;
640     LPLIOOpen3          pOpen3;
641     LPLIORead           pRead;
642     LPLIORename         pRename;
643     LPLIOSetmode        pSetmode;
644     LPLIONameStat       pNameStat;
645     LPLIOTmpnam         pTmpnam;
646     LPLIOUmask          pUmask;
647     LPLIOUnlink         pUnlink;
648     LPLIOUtime          pUtime;
649     LPLIOWrite          pWrite;
650 };
651
652 struct IPerlLIOInfo
653 {
654     unsigned long       nCount;     /* number of entries expected */
655     struct IPerlLIO     perlLIOList;
656 };
657
658 #define PerlLIO_access(file, mode)                                      \
659         (*PL_LIO->pAccess)(PL_LIO, (file), (mode))
660 #define PerlLIO_chmod(file, mode)                                       \
661         (*PL_LIO->pChmod)(PL_LIO, (file), (mode))
662 #define PerlLIO_chown(file, owner, group)                               \
663         (*PL_LIO->pChown)(PL_LIO, (file), (owner), (group))
664 #define PerlLIO_chsize(fd, size)                                        \
665         (*PL_LIO->pChsize)(PL_LIO, (fd), (size))
666 #define PerlLIO_close(fd)                                               \
667         (*PL_LIO->pClose)(PL_LIO, (fd))
668 #define PerlLIO_dup(fd)                                                 \
669         (*PL_LIO->pDup)(PL_LIO, (fd))
670 #define PerlLIO_dup2(fd1, fd2)                                          \
671         (*PL_LIO->pDup2)(PL_LIO, (fd1), (fd2))
672 #define PerlLIO_flock(fd, op)                                           \
673         (*PL_LIO->pFlock)(PL_LIO, (fd), (op))
674 #define PerlLIO_fstat(fd, buf)                                          \
675         (*PL_LIO->pFileStat)(PL_LIO, (fd), (buf))
676 #define PerlLIO_ioctl(fd, u, buf)                                       \
677         (*PL_LIO->pIOCtl)(PL_LIO, (fd), (u), (buf))
678 #define PerlLIO_isatty(fd)                                              \
679         (*PL_LIO->pIsatty)(PL_LIO, (fd))
680 #define PerlLIO_link(oldname, newname)                                  \
681         (*PL_LIO->pLink)(PL_LIO, (oldname), (newname))
682 #define PerlLIO_lseek(fd, offset, mode)                                 \
683         (*PL_LIO->pLseek)(PL_LIO, (fd), (offset), (mode))
684 #define PerlLIO_lstat(name, buf)                                        \
685         (*PL_LIO->pLstat)(PL_LIO, (name), (buf))
686 #define PerlLIO_mktemp(file)                                            \
687         (*PL_LIO->pMktemp)(PL_LIO, (file))
688 #define PerlLIO_open(file, flag)                                        \
689         (*PL_LIO->pOpen)(PL_LIO, (file), (flag))
690 #define PerlLIO_open3(file, flag, perm)                                 \
691         (*PL_LIO->pOpen3)(PL_LIO, (file), (flag), (perm))
692 #define PerlLIO_read(fd, buf, count)                                    \
693         (*PL_LIO->pRead)(PL_LIO, (fd), (buf), (count))
694 #define PerlLIO_rename(oname, newname)                                  \
695         (*PL_LIO->pRename)(PL_LIO, (oname), (newname))
696 #define PerlLIO_setmode(fd, mode)                                       \
697         (*PL_LIO->pSetmode)(PL_LIO, (fd), (mode))
698 #define PerlLIO_stat(name, buf)                                         \
699         (*PL_LIO->pNameStat)(PL_LIO, (name), (buf))
700 #define PerlLIO_tmpnam(str)                                             \
701         (*PL_LIO->pTmpnam)(PL_LIO, (str))
702 #define PerlLIO_umask(mode)                                             \
703         (*PL_LIO->pUmask)(PL_LIO, (mode))
704 #define PerlLIO_unlink(file)                                            \
705         (*PL_LIO->pUnlink)(PL_LIO, (file))
706 #define PerlLIO_utime(file, time)                                       \
707         (*PL_LIO->pUtime)(PL_LIO, (file), (time))
708 #define PerlLIO_write(fd, buf, count)                                   \
709         (*PL_LIO->pWrite)(PL_LIO, (fd), (buf), (count))
710
711 #else   /* PERL_IMPLICIT_SYS */
712
713 #define PerlLIO_access(file, mode)      access((file), (mode))
714 #define PerlLIO_chmod(file, mode)       chmod((file), (mode))
715 #define PerlLIO_chown(file, owner, grp) chown((file), (owner), (grp))
716 #define PerlLIO_chsize(fd, size)        chsize((fd), (size))
717 #define PerlLIO_close(fd)               close((fd))
718 #define PerlLIO_dup(fd)                 dup((fd))
719 #define PerlLIO_dup2(fd1, fd2)          dup2((fd1), (fd2))
720 #define PerlLIO_flock(fd, op)           FLOCK((fd), (op))
721 #define PerlLIO_fstat(fd, buf)          Fstat((fd), (buf))
722 #define PerlLIO_ioctl(fd, u, buf)       ioctl((fd), (u), (buf))
723 #define PerlLIO_isatty(fd)              isatty((fd))
724 #define PerlLIO_link(oldname, newname)  link((oldname), (newname))
725 #define PerlLIO_lseek(fd, offset, mode) lseek((fd), (offset), (mode))
726 #define PerlLIO_stat(name, buf)         Stat((name), (buf))
727 #ifdef HAS_LSTAT
728 #  define PerlLIO_lstat(name, buf)      lstat((name), (buf))
729 #else
730 #  define PerlLIO_lstat(name, buf)      PerlLIO_stat((name), (buf))
731 #endif
732 #define PerlLIO_mktemp(file)            mktemp((file))
733 #define PerlLIO_mkstemp(file)           mkstemp((file))
734 #define PerlLIO_open(file, flag)        open((file), (flag))
735 #define PerlLIO_open3(file, flag, perm) open((file), (flag), (perm))
736 #define PerlLIO_read(fd, buf, count)    read((fd), (buf), (count))
737 #define PerlLIO_rename(old, new)        rename((old), (new))
738 #define PerlLIO_setmode(fd, mode)       setmode((fd), (mode))
739 #define PerlLIO_tmpnam(str)             tmpnam((str))
740 #define PerlLIO_umask(mode)             umask((mode))
741 #define PerlLIO_unlink(file)            unlink((file))
742 #define PerlLIO_utime(file, time)       utime((file), (time))
743 #define PerlLIO_write(fd, buf, count)   write((fd), (buf), (count))
744
745 #endif  /* PERL_IMPLICIT_SYS */
746
747 /*
748     Interface for perl memory allocation
749 */
750
751 #if defined(PERL_IMPLICIT_SYS)
752
753 /* IPerlMem             */
754 struct IPerlMem;
755 struct IPerlMemInfo;
756 typedef void*           (*LPMemMalloc)(struct IPerlMem*, size_t);
757 typedef void*           (*LPMemRealloc)(struct IPerlMem*, void*, size_t);
758 typedef void            (*LPMemFree)(struct IPerlMem*, void*);
759 typedef void*           (*LPMemCalloc)(struct IPerlMem*, size_t, size_t);
760 typedef void            (*LPMemGetLock)(struct IPerlMem*);
761 typedef void            (*LPMemFreeLock)(struct IPerlMem*);
762 typedef int             (*LPMemIsLocked)(struct IPerlMem*);
763
764 struct IPerlMem
765 {
766     LPMemMalloc         pMalloc;
767     LPMemRealloc        pRealloc;
768     LPMemFree           pFree;
769     LPMemCalloc         pCalloc;
770     LPMemGetLock        pGetLock;
771     LPMemFreeLock       pFreeLock;
772     LPMemIsLocked       pIsLocked;
773 };
774
775 struct IPerlMemInfo
776 {
777     unsigned long       nCount;     /* number of entries expected */
778     struct IPerlMem     perlMemList;
779 };
780
781 /* Interpreter specific memory macros */
782 #define PerlMem_malloc(size)                                \
783         (*PL_Mem->pMalloc)(PL_Mem, (size))
784 #define PerlMem_realloc(buf, size)                          \
785         (*PL_Mem->pRealloc)(PL_Mem, (buf), (size))
786 #define PerlMem_free(buf)                                   \
787         (*PL_Mem->pFree)(PL_Mem, (buf))
788 #define PerlMem_calloc(num, size)                           \
789         (*PL_Mem->pCalloc)(PL_Mem, (num), (size))
790 #define PerlMem_get_lock()                                  \
791         (*PL_Mem->pGetLock)(PL_Mem)
792 #define PerlMem_free_lock()                                 \
793         (*PL_Mem->pFreeLock)(PL_Mem)
794 #define PerlMem_is_locked()                                 \
795         (*PL_Mem->pIsLocked)(PL_Mem)
796
797 /* Shared memory macros */
798 #define PerlMemShared_malloc(size)                          \
799         (*PL_MemShared->pMalloc)(PL_MemShared, (size))
800 #define PerlMemShared_realloc(buf, size)                    \
801         (*PL_MemShared->pRealloc)(PL_MemShared, (buf), (size))
802 #define PerlMemShared_free(buf)                             \
803         (*PL_MemShared->pFree)(PL_MemShared, (buf))
804 #define PerlMemShared_calloc(num, size)                     \
805         (*PL_MemShared->pCalloc)(PL_MemShared, (num), (size))
806 #define PerlMemShared_get_lock()                            \
807         (*PL_MemShared->pGetLock)(PL_MemShared)
808 #define PerlMemShared_free_lock()                           \
809         (*PL_MemShared->pFreeLock)(PL_MemShared)
810 #define PerlMemShared_is_locked()                           \
811         (*PL_MemShared->pIsLocked)(PL_MemShared)
812
813
814 /* Parse tree memory macros */
815 #define PerlMemParse_malloc(size)                           \
816         (*PL_MemParse->pMalloc)(PL_MemParse, (size))
817 #define PerlMemParse_realloc(buf, size)                     \
818         (*PL_MemParse->pRealloc)(PL_MemParse, (buf), (size))
819 #define PerlMemParse_free(buf)                              \
820         (*PL_MemParse->pFree)(PL_MemParse, (buf))
821 #define PerlMemParse_calloc(num, size)                      \
822         (*PL_MemParse->pCalloc)(PL_MemParse, (num), (size))
823 #define PerlMemParse_get_lock()                             \
824         (*PL_MemParse->pGetLock)(PL_MemParse)
825 #define PerlMemParse_free_lock()                            \
826         (*PL_MemParse->pFreeLock)(PL_MemParse)
827 #define PerlMemParse_is_locked()                            \
828         (*PL_MemParse->pIsLocked)(PL_MemParse)
829
830
831 #else   /* PERL_IMPLICIT_SYS */
832
833 /* Interpreter specific memory macros */
834 #define PerlMem_malloc(size)            malloc((size))
835 #define PerlMem_realloc(buf, size)      realloc((buf), (size))
836 #define PerlMem_free(buf)               free((buf))
837 #define PerlMem_calloc(num, size)       calloc((num), (size))
838 #define PerlMem_get_lock()              
839 #define PerlMem_free_lock()
840 #define PerlMem_is_locked()             0
841
842 /* Shared memory macros */
843 #define PerlMemShared_malloc(size)              malloc((size))
844 #define PerlMemShared_realloc(buf, size)        realloc((buf), (size))
845 #define PerlMemShared_free(buf)                 free((buf))
846 #define PerlMemShared_calloc(num, size)         calloc((num), (size))
847 #define PerlMemShared_get_lock()                
848 #define PerlMemShared_free_lock()
849 #define PerlMemShared_is_locked()               0
850
851 /* Parse tree memory macros */
852 #define PerlMemParse_malloc(size)       malloc((size))
853 #define PerlMemParse_realloc(buf, size) realloc((buf), (size))
854 #define PerlMemParse_free(buf)          free((buf))
855 #define PerlMemParse_calloc(num, size)  calloc((num), (size))
856 #define PerlMemParse_get_lock()         
857 #define PerlMemParse_free_lock()
858 #define PerlMemParse_is_locked()        0
859
860 #endif  /* PERL_IMPLICIT_SYS */
861
862 /*
863     Interface for perl process functions
864 */
865
866
867 #if defined(PERL_IMPLICIT_SYS)
868
869 #ifndef jmp_buf
870 #include <setjmp.h>
871 #endif
872
873 /* IPerlProc            */
874 struct IPerlProc;
875 struct IPerlProcInfo;
876 typedef void            (*LPProcAbort)(struct IPerlProc*);
877 typedef char*           (*LPProcCrypt)(struct IPerlProc*, const char*,
878                             const char*);
879 typedef void            (*LPProcExit)(struct IPerlProc*, int);
880 typedef void            (*LPProc_Exit)(struct IPerlProc*, int);
881 typedef int             (*LPProcExecl)(struct IPerlProc*, const char*,
882                             const char*, const char*, const char*,
883                             const char*);
884 typedef int             (*LPProcExecv)(struct IPerlProc*, const char*,
885                             const char*const*);
886 typedef int             (*LPProcExecvp)(struct IPerlProc*, const char*,
887                             const char*const*);
888 typedef uid_t           (*LPProcGetuid)(struct IPerlProc*);
889 typedef uid_t           (*LPProcGeteuid)(struct IPerlProc*);
890 typedef gid_t           (*LPProcGetgid)(struct IPerlProc*);
891 typedef gid_t           (*LPProcGetegid)(struct IPerlProc*);
892 typedef char*           (*LPProcGetlogin)(struct IPerlProc*);
893 typedef int             (*LPProcKill)(struct IPerlProc*, int, int);
894 typedef int             (*LPProcKillpg)(struct IPerlProc*, int, int);
895 typedef int             (*LPProcPauseProc)(struct IPerlProc*);
896 typedef PerlIO*         (*LPProcPopen)(struct IPerlProc*, const char*,
897                             const char*);
898 typedef PerlIO*         (*LPProcPopenList)(struct IPerlProc*, const char*,
899                             IV narg, SV **args);
900 typedef int             (*LPProcPclose)(struct IPerlProc*, PerlIO*);
901 typedef int             (*LPProcPipe)(struct IPerlProc*, int*);
902 typedef int             (*LPProcSetuid)(struct IPerlProc*, uid_t);
903 typedef int             (*LPProcSetgid)(struct IPerlProc*, gid_t);
904 typedef int             (*LPProcSleep)(struct IPerlProc*, unsigned int);
905 typedef int             (*LPProcTimes)(struct IPerlProc*, struct tms*);
906 typedef int             (*LPProcWait)(struct IPerlProc*, int*);
907 typedef int             (*LPProcWaitpid)(struct IPerlProc*, int, int*, int);
908 typedef Sighandler_t    (*LPProcSignal)(struct IPerlProc*, int, Sighandler_t);
909 typedef int             (*LPProcFork)(struct IPerlProc*);
910 typedef int             (*LPProcGetpid)(struct IPerlProc*);
911 #ifdef WIN32
912 typedef void*           (*LPProcDynaLoader)(struct IPerlProc*, const char*);
913 typedef void            (*LPProcGetOSError)(struct IPerlProc*,
914                             SV* sv, DWORD dwErr);
915 typedef void            (*LPProcFreeBuf)(struct IPerlProc*, char*);
916 typedef BOOL            (*LPProcDoCmd)(struct IPerlProc*, char*);
917 typedef int             (*LPProcSpawn)(struct IPerlProc*, char*);
918 typedef int             (*LPProcSpawnvp)(struct IPerlProc*, int, const char*,
919                             const char*const*);
920 typedef int             (*LPProcASpawn)(struct IPerlProc*, void*, void**, void**);
921 #endif
922 typedef int             (*LPProcLastHost)(struct IPerlProc*);
923
924 struct IPerlProc
925 {
926     LPProcAbort         pAbort;
927     LPProcCrypt         pCrypt;
928     LPProcExit          pExit;
929     LPProc_Exit         p_Exit;
930     LPProcExecl         pExecl;
931     LPProcExecv         pExecv;
932     LPProcExecvp        pExecvp;
933     LPProcGetuid        pGetuid;
934     LPProcGeteuid       pGeteuid;
935     LPProcGetgid        pGetgid;
936     LPProcGetegid       pGetegid;
937     LPProcGetlogin      pGetlogin;
938     LPProcKill          pKill;
939     LPProcKillpg        pKillpg;
940     LPProcPauseProc     pPauseProc;
941     LPProcPopen         pPopen;
942     LPProcPclose        pPclose;
943     LPProcPipe          pPipe;
944     LPProcSetuid        pSetuid;
945     LPProcSetgid        pSetgid;
946     LPProcSleep         pSleep;
947     LPProcTimes         pTimes;
948     LPProcWait          pWait;
949     LPProcWaitpid       pWaitpid;
950     LPProcSignal        pSignal;
951     LPProcFork          pFork;
952     LPProcGetpid        pGetpid;
953 #ifdef WIN32
954     LPProcDynaLoader    pDynaLoader;
955     LPProcGetOSError    pGetOSError;
956     LPProcDoCmd         pDoCmd;
957     LPProcSpawn         pSpawn;
958     LPProcSpawnvp       pSpawnvp;
959     LPProcASpawn        pASpawn;
960 #endif
961     LPProcLastHost      pLastHost;
962     LPProcPopenList     pPopenList;
963 };
964
965 struct IPerlProcInfo
966 {
967     unsigned long       nCount;     /* number of entries expected */
968     struct IPerlProc    perlProcList;
969 };
970
971 #define PerlProc_abort()                                                \
972         (*PL_Proc->pAbort)(PL_Proc)
973 #define PerlProc_crypt(c,s)                                             \
974         (*PL_Proc->pCrypt)(PL_Proc, (c), (s))
975 #define PerlProc_exit(s)                                                \
976         (*PL_Proc->pExit)(PL_Proc, (s))
977 #define PerlProc__exit(s)                                               \
978         (*PL_Proc->p_Exit)(PL_Proc, (s))
979 #define PerlProc_execl(c, w, x, y, z)                                   \
980         (*PL_Proc->pExecl)(PL_Proc, (c), (w), (x), (y), (z))
981 #define PerlProc_execv(c, a)                                            \
982         (*PL_Proc->pExecv)(PL_Proc, (c), (a))
983 #define PerlProc_execvp(c, a)                                           \
984         (*PL_Proc->pExecvp)(PL_Proc, (c), (a))
985 #define PerlProc_getuid()                                               \
986         (*PL_Proc->pGetuid)(PL_Proc)
987 #define PerlProc_geteuid()                                              \
988         (*PL_Proc->pGeteuid)(PL_Proc)
989 #define PerlProc_getgid()                                               \
990         (*PL_Proc->pGetgid)(PL_Proc)
991 #define PerlProc_getegid()                                              \
992         (*PL_Proc->pGetegid)(PL_Proc)
993 #define PerlProc_getlogin()                                             \
994         (*PL_Proc->pGetlogin)(PL_Proc)
995 #define PerlProc_kill(i, a)                                             \
996         (*PL_Proc->pKill)(PL_Proc, (i), (a))
997 #define PerlProc_killpg(i, a)                                           \
998         (*PL_Proc->pKillpg)(PL_Proc, (i), (a))
999 #define PerlProc_pause()                                                \
1000         (*PL_Proc->pPauseProc)(PL_Proc)
1001 #define PerlProc_popen(c, m)                                            \
1002         (*PL_Proc->pPopen)(PL_Proc, (c), (m))
1003 #define PerlProc_popen_list(m, n, a)                                    \
1004         (*PL_Proc->pPopenList)(PL_Proc, (m), (n), (a))
1005 #define PerlProc_pclose(f)                                              \
1006         (*PL_Proc->pPclose)(PL_Proc, (f))
1007 #define PerlProc_pipe(fd)                                               \
1008         (*PL_Proc->pPipe)(PL_Proc, (fd))
1009 #define PerlProc_setuid(u)                                              \
1010         (*PL_Proc->pSetuid)(PL_Proc, (u))
1011 #define PerlProc_setgid(g)                                              \
1012         (*PL_Proc->pSetgid)(PL_Proc, (g))
1013 #define PerlProc_sleep(t)                                               \
1014         (*PL_Proc->pSleep)(PL_Proc, (t))
1015 #define PerlProc_times(t)                                               \
1016         (*PL_Proc->pTimes)(PL_Proc, (t))
1017 #define PerlProc_wait(t)                                                \
1018         (*PL_Proc->pWait)(PL_Proc, (t))
1019 #define PerlProc_waitpid(p,s,f)                                         \
1020         (*PL_Proc->pWaitpid)(PL_Proc, (p), (s), (f))
1021 #define PerlProc_signal(n, h)                                           \
1022         (*PL_Proc->pSignal)(PL_Proc, (n), (h))
1023 #define PerlProc_fork()                                                 \
1024         (*PL_Proc->pFork)(PL_Proc)
1025 #define PerlProc_getpid()                                               \
1026         (*PL_Proc->pGetpid)(PL_Proc)
1027 #define PerlProc_setjmp(b, n) Sigsetjmp((b), (n))
1028 #define PerlProc_longjmp(b, n) Siglongjmp((b), (n))
1029
1030 #ifdef WIN32
1031 #define PerlProc_DynaLoad(f)                                            \
1032         (*PL_Proc->pDynaLoader)(PL_Proc, (f))
1033 #define PerlProc_GetOSError(s,e)                                        \
1034         (*PL_Proc->pGetOSError)(PL_Proc, (s), (e))
1035 #define PerlProc_Cmd(s)                                                 \
1036         (*PL_Proc->pDoCmd)(PL_Proc, (s))
1037 #define do_spawn(s)                                                     \
1038         (*PL_Proc->pSpawn)(PL_Proc, (s))
1039 #define do_spawnvp(m, c, a)                                             \
1040         (*PL_Proc->pSpawnvp)(PL_Proc, (m), (c), (a))
1041 #define PerlProc_aspawn(m,c,a)                                          \
1042         (*PL_Proc->pASpawn)(PL_Proc, (m), (c), (a))
1043 #endif
1044 #define PerlProc_lasthost()                                             \
1045         (*PL_Proc->pLastHost)(PL_Proc)
1046
1047 #else   /* PERL_IMPLICIT_SYS */
1048
1049 #define PerlProc_abort()        abort()
1050 #define PerlProc_crypt(c,s)     crypt((c), (s))
1051 #define PerlProc_exit(s)        exit((s))
1052 #define PerlProc__exit(s)       _exit((s))
1053 #define PerlProc_execl(c,w,x,y,z)                                       \
1054         execl((c), (w), (x), (y), (z))
1055 #define PerlProc_execv(c, a)    execv((c), (a))
1056 #define PerlProc_execvp(c, a)   execvp((c), (a))
1057 #define PerlProc_getuid()       getuid()
1058 #define PerlProc_geteuid()      geteuid()
1059 #define PerlProc_getgid()       getgid()
1060 #define PerlProc_getegid()      getegid()
1061 #define PerlProc_getlogin()     getlogin()
1062 #define PerlProc_kill(i, a)     kill((i), (a))
1063 #define PerlProc_killpg(i, a)   killpg((i), (a))
1064 #define PerlProc_pause()        Pause()
1065 #define PerlProc_popen(c, m)    my_popen((c), (m))
1066 #define PerlProc_popen_list(m,n,a)      my_popen_list((m),(n),(a))
1067 #define PerlProc_pclose(f)      my_pclose((f))
1068 #define PerlProc_pipe(fd)       pipe((fd))
1069 #define PerlProc_setuid(u)      setuid((u))
1070 #define PerlProc_setgid(g)      setgid((g))
1071 #define PerlProc_sleep(t)       sleep((t))
1072 #define PerlProc_times(t)       times((t))
1073 #define PerlProc_wait(t)        wait((t))
1074 #define PerlProc_waitpid(p,s,f) waitpid((p), (s), (f))
1075 #define PerlProc_setjmp(b, n)   Sigsetjmp((b), (n))
1076 #define PerlProc_longjmp(b, n)  Siglongjmp((b), (n))
1077 #define PerlProc_signal(n, h)   signal((n), (h))
1078 #define PerlProc_fork()         my_fork()
1079 #define PerlProc_getpid()       getpid()
1080
1081 #ifdef WIN32
1082 #define PerlProc_DynaLoad(f)                                            \
1083         win32_dynaload((f))
1084 #define PerlProc_GetOSError(s,e)                                        \
1085         win32_str_os_error((s), (e))
1086 #endif
1087 #endif  /* PERL_IMPLICIT_SYS */
1088
1089 /*
1090     Interface for perl socket functions
1091 */
1092
1093 #if defined(PERL_IMPLICIT_SYS)
1094
1095 /* PerlSock             */
1096 struct IPerlSock;
1097 struct IPerlSockInfo;
1098 typedef u_long          (*LPHtonl)(struct IPerlSock*, u_long);
1099 typedef u_short         (*LPHtons)(struct IPerlSock*, u_short);
1100 typedef u_long          (*LPNtohl)(struct IPerlSock*, u_long);
1101 typedef u_short         (*LPNtohs)(struct IPerlSock*, u_short);
1102 typedef SOCKET          (*LPAccept)(struct IPerlSock*, SOCKET,
1103                             struct sockaddr*, int*);
1104 typedef int             (*LPBind)(struct IPerlSock*, SOCKET,
1105                             const struct sockaddr*, int);
1106 typedef int             (*LPConnect)(struct IPerlSock*, SOCKET,
1107                             const struct sockaddr*, int);
1108 typedef void            (*LPEndhostent)(struct IPerlSock*);
1109 typedef void            (*LPEndnetent)(struct IPerlSock*);
1110 typedef void            (*LPEndprotoent)(struct IPerlSock*);
1111 typedef void            (*LPEndservent)(struct IPerlSock*);
1112 typedef int             (*LPGethostname)(struct IPerlSock*, char*, int);
1113 typedef int             (*LPGetpeername)(struct IPerlSock*, SOCKET,
1114                             struct sockaddr*, int*);
1115 typedef struct hostent* (*LPGethostbyaddr)(struct IPerlSock*, const char*,
1116                             int, int);
1117 typedef struct hostent* (*LPGethostbyname)(struct IPerlSock*, const char*);
1118 typedef struct hostent* (*LPGethostent)(struct IPerlSock*);
1119 typedef struct netent*  (*LPGetnetbyaddr)(struct IPerlSock*, long, int);
1120 typedef struct netent*  (*LPGetnetbyname)(struct IPerlSock*, const char*);
1121 typedef struct netent*  (*LPGetnetent)(struct IPerlSock*);
1122 typedef struct protoent*(*LPGetprotobyname)(struct IPerlSock*, const char*);
1123 typedef struct protoent*(*LPGetprotobynumber)(struct IPerlSock*, int);
1124 typedef struct protoent*(*LPGetprotoent)(struct IPerlSock*);
1125 typedef struct servent* (*LPGetservbyname)(struct IPerlSock*, const char*,
1126                             const char*);
1127 typedef struct servent* (*LPGetservbyport)(struct IPerlSock*, int,
1128                             const char*);
1129 typedef struct servent* (*LPGetservent)(struct IPerlSock*);
1130 typedef int             (*LPGetsockname)(struct IPerlSock*, SOCKET,
1131                             struct sockaddr*, int*);
1132 typedef int             (*LPGetsockopt)(struct IPerlSock*, SOCKET, int, int,
1133                             char*, int*);
1134 typedef unsigned long   (*LPInetAddr)(struct IPerlSock*, const char*);
1135 typedef char*           (*LPInetNtoa)(struct IPerlSock*, struct in_addr);
1136 typedef int             (*LPListen)(struct IPerlSock*, SOCKET, int);
1137 typedef int             (*LPRecv)(struct IPerlSock*, SOCKET, char*, int, int);
1138 typedef int             (*LPRecvfrom)(struct IPerlSock*, SOCKET, char*, int,
1139                             int, struct sockaddr*, int*);
1140 typedef int             (*LPSelect)(struct IPerlSock*, int, char*, char*,
1141                             char*, const struct timeval*);
1142 typedef int             (*LPSend)(struct IPerlSock*, SOCKET, const char*, int,
1143                             int);
1144 typedef int             (*LPSendto)(struct IPerlSock*, SOCKET, const char*,
1145                             int, int, const struct sockaddr*, int);
1146 typedef void            (*LPSethostent)(struct IPerlSock*, int);
1147 typedef void            (*LPSetnetent)(struct IPerlSock*, int);
1148 typedef void            (*LPSetprotoent)(struct IPerlSock*, int);
1149 typedef void            (*LPSetservent)(struct IPerlSock*, int);
1150 typedef int             (*LPSetsockopt)(struct IPerlSock*, SOCKET, int, int,
1151                             const char*, int);
1152 typedef int             (*LPShutdown)(struct IPerlSock*, SOCKET, int);
1153 typedef SOCKET          (*LPSocket)(struct IPerlSock*, int, int, int);
1154 typedef int             (*LPSocketpair)(struct IPerlSock*, int, int, int,
1155                             int*);
1156 #ifdef WIN32
1157 typedef int             (*LPClosesocket)(struct IPerlSock*, SOCKET s);
1158 #endif
1159
1160 struct IPerlSock
1161 {
1162     LPHtonl             pHtonl;
1163     LPHtons             pHtons;
1164     LPNtohl             pNtohl;
1165     LPNtohs             pNtohs;
1166     LPAccept            pAccept;
1167     LPBind              pBind;
1168     LPConnect           pConnect;
1169     LPEndhostent        pEndhostent;
1170     LPEndnetent         pEndnetent;
1171     LPEndprotoent       pEndprotoent;
1172     LPEndservent        pEndservent;
1173     LPGethostname       pGethostname;
1174     LPGetpeername       pGetpeername;
1175     LPGethostbyaddr     pGethostbyaddr;
1176     LPGethostbyname     pGethostbyname;
1177     LPGethostent        pGethostent;
1178     LPGetnetbyaddr      pGetnetbyaddr;
1179     LPGetnetbyname      pGetnetbyname;
1180     LPGetnetent         pGetnetent;
1181     LPGetprotobyname    pGetprotobyname;
1182     LPGetprotobynumber  pGetprotobynumber;
1183     LPGetprotoent       pGetprotoent;
1184     LPGetservbyname     pGetservbyname;
1185     LPGetservbyport     pGetservbyport;
1186     LPGetservent        pGetservent;
1187     LPGetsockname       pGetsockname;
1188     LPGetsockopt        pGetsockopt;
1189     LPInetAddr          pInetAddr;
1190     LPInetNtoa          pInetNtoa;
1191     LPListen            pListen;
1192     LPRecv              pRecv;
1193     LPRecvfrom          pRecvfrom;
1194     LPSelect            pSelect;
1195     LPSend              pSend;
1196     LPSendto            pSendto;
1197     LPSethostent        pSethostent;
1198     LPSetnetent         pSetnetent;
1199     LPSetprotoent       pSetprotoent;
1200     LPSetservent        pSetservent;
1201     LPSetsockopt        pSetsockopt;
1202     LPShutdown          pShutdown;
1203     LPSocket            pSocket;
1204     LPSocketpair        pSocketpair;
1205 #ifdef WIN32
1206     LPClosesocket       pClosesocket;
1207 #endif
1208 };
1209
1210 struct IPerlSockInfo
1211 {
1212     unsigned long       nCount;     /* number of entries expected */
1213     struct IPerlSock    perlSockList;
1214 };
1215
1216 #define PerlSock_htonl(x)                                               \
1217         (*PL_Sock->pHtonl)(PL_Sock, x)
1218 #define PerlSock_htons(x)                                               \
1219         (*PL_Sock->pHtons)(PL_Sock, x)
1220 #define PerlSock_ntohl(x)                                               \
1221         (*PL_Sock->pNtohl)(PL_Sock, x)
1222 #define PerlSock_ntohs(x)                                               \
1223         (*PL_Sock->pNtohs)(PL_Sock, x)
1224 #define PerlSock_accept(s, a, l)                                        \
1225         (*PL_Sock->pAccept)(PL_Sock, s, a, l)
1226 #define PerlSock_bind(s, n, l)                                          \
1227         (*PL_Sock->pBind)(PL_Sock, s, n, l)
1228 #define PerlSock_connect(s, n, l)                                       \
1229         (*PL_Sock->pConnect)(PL_Sock, s, n, l)
1230 #define PerlSock_endhostent()                                           \
1231         (*PL_Sock->pEndhostent)(PL_Sock)
1232 #define PerlSock_endnetent()                                            \
1233         (*PL_Sock->pEndnetent)(PL_Sock)
1234 #define PerlSock_endprotoent()                                          \
1235         (*PL_Sock->pEndprotoent)(PL_Sock)
1236 #define PerlSock_endservent()                                           \
1237         (*PL_Sock->pEndservent)(PL_Sock)
1238 #define PerlSock_gethostbyaddr(a, l, t)                                 \
1239         (*PL_Sock->pGethostbyaddr)(PL_Sock, a, l, t)
1240 #define PerlSock_gethostbyname(n)                                       \
1241         (*PL_Sock->pGethostbyname)(PL_Sock, n)
1242 #define PerlSock_gethostent()                                           \
1243         (*PL_Sock->pGethostent)(PL_Sock)
1244 #define PerlSock_gethostname(n, l)                                      \
1245         (*PL_Sock->pGethostname)(PL_Sock, n, l)
1246 #define PerlSock_getnetbyaddr(n, t)                                     \
1247         (*PL_Sock->pGetnetbyaddr)(PL_Sock, n, t)
1248 #define PerlSock_getnetbyname(c)                                        \
1249         (*PL_Sock->pGetnetbyname)(PL_Sock, c)
1250 #define PerlSock_getnetent()                                            \
1251         (*PL_Sock->pGetnetent)(PL_Sock)
1252 #define PerlSock_getpeername(s, n, l)                                   \
1253         (*PL_Sock->pGetpeername)(PL_Sock, s, n, l)
1254 #define PerlSock_getprotobyname(n)                                      \
1255         (*PL_Sock->pGetprotobyname)(PL_Sock, n)
1256 #define PerlSock_getprotobynumber(n)                                    \
1257         (*PL_Sock->pGetprotobynumber)(PL_Sock, n)
1258 #define PerlSock_getprotoent()                                          \
1259         (*PL_Sock->pGetprotoent)(PL_Sock)
1260 #define PerlSock_getservbyname(n, p)                                    \
1261         (*PL_Sock->pGetservbyname)(PL_Sock, n, p)
1262 #define PerlSock_getservbyport(port, p)                                 \
1263         (*PL_Sock->pGetservbyport)(PL_Sock, port, p)
1264 #define PerlSock_getservent()                                           \
1265         (*PL_Sock->pGetservent)(PL_Sock)
1266 #define PerlSock_getsockname(s, n, l)                                   \
1267         (*PL_Sock->pGetsockname)(PL_Sock, s, n, l)
1268 #define PerlSock_getsockopt(s,l,n,v,i)                                  \
1269         (*PL_Sock->pGetsockopt)(PL_Sock, s, l, n, v, i)
1270 #define PerlSock_inet_addr(c)                                           \
1271         (*PL_Sock->pInetAddr)(PL_Sock, c)
1272 #define PerlSock_inet_ntoa(i)                                           \
1273         (*PL_Sock->pInetNtoa)(PL_Sock, i)
1274 #define PerlSock_listen(s, b)                                           \
1275         (*PL_Sock->pListen)(PL_Sock, s, b)
1276 #define PerlSock_recv(s, b, l, f)                                       \
1277         (*PL_Sock->pRecv)(PL_Sock, s, b, l, f)
1278 #define PerlSock_recvfrom(s,b,l,f,from,fromlen)                         \
1279         (*PL_Sock->pRecvfrom)(PL_Sock, s, b, l, f, from, fromlen)
1280 #define PerlSock_select(n, r, w, e, t)                                  \
1281         (*PL_Sock->pSelect)(PL_Sock, n, (char*)r, (char*)w, (char*)e, t)
1282 #define PerlSock_send(s, b, l, f)                                       \
1283         (*PL_Sock->pSend)(PL_Sock, s, b, l, f)
1284 #define PerlSock_sendto(s, b, l, f, t, tlen)                            \
1285         (*PL_Sock->pSendto)(PL_Sock, s, b, l, f, t, tlen)
1286 #define PerlSock_sethostent(f)                                          \
1287         (*PL_Sock->pSethostent)(PL_Sock, f)
1288 #define PerlSock_setnetent(f)                                           \
1289         (*PL_Sock->pSetnetent)(PL_Sock, f)
1290 #define PerlSock_setprotoent(f)                                         \
1291         (*PL_Sock->pSetprotoent)(PL_Sock, f)
1292 #define PerlSock_setservent(f)                                          \
1293         (*PL_Sock->pSetservent)(PL_Sock, f)
1294 #define PerlSock_setsockopt(s, l, n, v, len)                            \
1295         (*PL_Sock->pSetsockopt)(PL_Sock, s, l, n, v, len)
1296 #define PerlSock_shutdown(s, h)                                         \
1297         (*PL_Sock->pShutdown)(PL_Sock, s, h)
1298 #define PerlSock_socket(a, t, p)                                        \
1299         (*PL_Sock->pSocket)(PL_Sock, a, t, p)
1300 #define PerlSock_socketpair(a, t, p, f)                                 \
1301         (*PL_Sock->pSocketpair)(PL_Sock, a, t, p, f)
1302
1303 #ifdef WIN32
1304 #define PerlSock_closesocket(s)                                         \
1305         (*PL_Sock->pClosesocket)(PL_Sock, s)
1306 #endif
1307
1308 #else   /* PERL_IMPLICIT_SYS */
1309
1310 #define PerlSock_htonl(x)               htonl(x)
1311 #define PerlSock_htons(x)               htons(x)
1312 #define PerlSock_ntohl(x)               ntohl(x)
1313 #define PerlSock_ntohs(x)               ntohs(x)
1314 #define PerlSock_accept(s, a, l)        accept(s, a, l)
1315 #define PerlSock_bind(s, n, l)          bind(s, n, l)
1316 #define PerlSock_connect(s, n, l)       connect(s, n, l)
1317
1318 #define PerlSock_gethostbyaddr(a, l, t) gethostbyaddr(a, l, t)
1319 #define PerlSock_gethostbyname(n)       gethostbyname(n)
1320 #define PerlSock_gethostent             gethostent
1321 #define PerlSock_endhostent             endhostent
1322 #define PerlSock_gethostname(n, l)      gethostname(n, l)
1323
1324 #define PerlSock_getnetbyaddr(n, t)     getnetbyaddr(n, t)
1325 #define PerlSock_getnetbyname(n)        getnetbyname(n)
1326 #define PerlSock_getnetent              getnetent
1327 #define PerlSock_endnetent              endnetent
1328 #define PerlSock_getpeername(s, n, l)   getpeername(s, n, l)
1329
1330 #define PerlSock_getprotobyname(n)      getprotobyname(n)
1331 #define PerlSock_getprotobynumber(n)    getprotobynumber(n)
1332 #define PerlSock_getprotoent            getprotoent
1333 #define PerlSock_endprotoent            endprotoent
1334
1335 #define PerlSock_getservbyname(n, p)    getservbyname(n, p)
1336 #define PerlSock_getservbyport(port, p) getservbyport(port, p)
1337 #define PerlSock_getservent             getservent
1338 #define PerlSock_endservent             endservent
1339
1340 #define PerlSock_getsockname(s, n, l)   getsockname(s, n, l)
1341 #define PerlSock_getsockopt(s,l,n,v,i)  getsockopt(s, l, n, v, i)
1342 #define PerlSock_inet_addr(c)           inet_addr(c)
1343 #define PerlSock_inet_ntoa(i)           inet_ntoa(i)
1344 #define PerlSock_listen(s, b)           listen(s, b)
1345 #define PerlSock_recv(s, b, l, f)       recv(s, b, l, f)
1346 #define PerlSock_recvfrom(s, b, l, f, from, fromlen)                    \
1347         recvfrom(s, b, l, f, from, fromlen)
1348 #define PerlSock_select(n, r, w, e, t)  select(n, r, w, e, t)
1349 #define PerlSock_send(s, b, l, f)       send(s, b, l, f)
1350 #define PerlSock_sendto(s, b, l, f, t, tlen)                            \
1351         sendto(s, b, l, f, t, tlen)
1352 #define PerlSock_sethostent(f)          sethostent(f)
1353 #define PerlSock_setnetent(f)           setnetent(f)
1354 #define PerlSock_setprotoent(f)         setprotoent(f)
1355 #define PerlSock_setservent(f)          setservent(f)
1356 #define PerlSock_setsockopt(s, l, n, v, len)                            \
1357         setsockopt(s, l, n, v, len)
1358 #define PerlSock_shutdown(s, h)         shutdown(s, h)
1359 #define PerlSock_socket(a, t, p)        socket(a, t, p)
1360 #define PerlSock_socketpair(a, t, p, f) socketpair(a, t, p, f)
1361
1362 #ifdef WIN32
1363 #define PerlSock_closesocket(s)         closesocket(s)
1364 #endif
1365
1366 #endif  /* PERL_IMPLICIT_SYS */
1367
1368 #endif  /* __Inc__IPerl___ */
1369