X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/079b94bc698b0934beaf07d168872e7ff53ba831..3ae1b22641a16d4d08aba688616c0f7cefb7d1f5:/iperlsys.h diff --git a/iperlsys.h b/iperlsys.h index 76a49cd..f1f5c46 100644 --- a/iperlsys.h +++ b/iperlsys.h @@ -51,7 +51,11 @@ #include "perlio.h" #ifndef Sighandler_t +# if defined(HAS_SIGACTION) && defined(SA_SIGINFO) +typedef Signal_t (*Sighandler_t) (int, siginfo_t*, void*); +# else typedef Signal_t (*Sighandler_t) (int); +# endif #endif #if defined(PERL_IMPLICIT_SYS) @@ -335,7 +339,7 @@ struct IPerlStdIOInfo #define PerlSIO_set_cnt(f,c) PerlIOProc_abort() #endif #if defined(USE_STDIO_PTR) && defined(STDIO_PTR_LVALUE) -#define PerlSIO_set_ptr(f,p) FILE_ptr(f) = (p) +#define PerlSIO_set_ptr(f,p) (FILE_ptr(f) = (p)) #else #define PerlSIO_set_ptr(f,p) PerlIOProc_abort() #endif @@ -366,7 +370,7 @@ typedef int (*LPMakedir)(struct IPerlDir*, const char*, int); typedef int (*LPChdir)(struct IPerlDir*, const char*); typedef int (*LPRmdir)(struct IPerlDir*, const char*); typedef int (*LPDirClose)(struct IPerlDir*, DIR*); -typedef DIR* (*LPDirOpen)(struct IPerlDir*, char*); +typedef DIR* (*LPDirOpen)(struct IPerlDir*, const char*); typedef struct direct* (*LPDirRead)(struct IPerlDir*, DIR*); typedef void (*LPDirRewind)(struct IPerlDir*, DIR*); typedef void (*LPDirSeek)(struct IPerlDir*, DIR*, long); @@ -598,7 +602,7 @@ typedef int (*LPLIOAccess)(struct IPerlLIO*, const char*, int); typedef int (*LPLIOChmod)(struct IPerlLIO*, const char*, int); typedef int (*LPLIOChown)(struct IPerlLIO*, const char*, uid_t, gid_t); -typedef int (*LPLIOChsize)(struct IPerlLIO*, int, long); +typedef int (*LPLIOChsize)(struct IPerlLIO*, int, Off_t); typedef int (*LPLIOClose)(struct IPerlLIO*, int); typedef int (*LPLIODup)(struct IPerlLIO*, int); typedef int (*LPLIODup2)(struct IPerlLIO*, int, int); @@ -628,7 +632,7 @@ typedef int (*LPLIONameStat)(struct IPerlLIO*, const char*, typedef char* (*LPLIOTmpnam)(struct IPerlLIO*, char*); typedef int (*LPLIOUmask)(struct IPerlLIO*, int); typedef int (*LPLIOUnlink)(struct IPerlLIO*, const char*); -typedef int (*LPLIOUtime)(struct IPerlLIO*, char*, struct utimbuf*); +typedef int (*LPLIOUtime)(struct IPerlLIO*, const char*, struct utimbuf*); typedef int (*LPLIOWrite)(struct IPerlLIO*, int, const void*, unsigned int); @@ -726,7 +730,13 @@ struct IPerlLIOInfo #define PerlLIO_access(file, mode) access((file), (mode)) #define PerlLIO_chmod(file, mode) chmod((file), (mode)) #define PerlLIO_chown(file, owner, grp) chown((file), (owner), (grp)) -#define PerlLIO_chsize(fd, size) chsize((fd), (size)) +#if defined(HAS_TRUNCATE) +# define PerlLIO_chsize(fd, size) ftruncate((fd), (size)) +#elif defined(HAS_CHSIZE) +# define PerlLIO_chsize(fd, size) chsize((fd), (size)) +#else +# define PerlLIO_chsize(fd, size) my_chsize((fd), (size)) +#endif #define PerlLIO_close(fd) close((fd)) #define PerlLIO_dup(fd) dup((fd)) #define PerlLIO_dup2(fd1, fd2) dup2((fd1), (fd2)) @@ -810,7 +820,7 @@ struct IPerlMemInfo /* Shared memory macros */ #ifdef NETWARE - #define PerlMemShared_malloc(size) \ +#define PerlMemShared_malloc(size) \ (*PL_Mem->pMalloc)(PL_Mem, (size)) #define PerlMemShared_realloc(buf, size) \ (*PL_Mem->pRealloc)(PL_Mem, (buf), (size)) @@ -909,8 +919,10 @@ struct IPerlProcInfo; typedef void (*LPProcAbort)(struct IPerlProc*); typedef char* (*LPProcCrypt)(struct IPerlProc*, const char*, const char*); -typedef void (*LPProcExit)(struct IPerlProc*, int); -typedef void (*LPProc_Exit)(struct IPerlProc*, int); +typedef void (*LPProcExit)(struct IPerlProc*, int) + __attribute__noreturn__; +typedef void (*LPProc_Exit)(struct IPerlProc*, int) + __attribute__noreturn__; typedef int (*LPProcExecl)(struct IPerlProc*, const char*, const char*, const char*, const char*, const char*); @@ -945,14 +957,12 @@ typedef int (*LPProcGetpid)(struct IPerlProc*); typedef void* (*LPProcDynaLoader)(struct IPerlProc*, const char*); typedef void (*LPProcGetOSError)(struct IPerlProc*, SV* sv, DWORD dwErr); -typedef void (*LPProcFreeBuf)(struct IPerlProc*, char*); -typedef BOOL (*LPProcDoCmd)(struct IPerlProc*, char*); -typedef int (*LPProcSpawn)(struct IPerlProc*, char*); typedef int (*LPProcSpawnvp)(struct IPerlProc*, int, const char*, const char*const*); -typedef int (*LPProcASpawn)(struct IPerlProc*, void*, void**, void**); #endif typedef int (*LPProcLastHost)(struct IPerlProc*); +typedef int (*LPProcGetTimeOfDay)(struct IPerlProc*, + struct timeval*, void*); struct IPerlProc { @@ -986,13 +996,11 @@ struct IPerlProc #ifdef WIN32 LPProcDynaLoader pDynaLoader; LPProcGetOSError pGetOSError; - LPProcDoCmd pDoCmd; - LPProcSpawn pSpawn; LPProcSpawnvp pSpawnvp; - LPProcASpawn pASpawn; #endif LPProcLastHost pLastHost; LPProcPopenList pPopenList; + LPProcGetTimeOfDay pGetTimeOfDay; }; struct IPerlProcInfo @@ -1065,17 +1073,13 @@ struct IPerlProcInfo (*PL_Proc->pDynaLoader)(PL_Proc, (f)) #define PerlProc_GetOSError(s,e) \ (*PL_Proc->pGetOSError)(PL_Proc, (s), (e)) -#define PerlProc_Cmd(s) \ - (*PL_Proc->pDoCmd)(PL_Proc, (s)) -#define do_spawn(s) \ - (*PL_Proc->pSpawn)(PL_Proc, (s)) -#define do_spawnvp(m, c, a) \ +#define PerlProc_spawnvp(m, c, a) \ (*PL_Proc->pSpawnvp)(PL_Proc, (m), (c), (a)) -#define PerlProc_aspawn(m,c,a) \ - (*PL_Proc->pASpawn)(PL_Proc, (m), (c), (a)) #endif #define PerlProc_lasthost() \ (*PL_Proc->pLastHost)(PL_Proc) +#define PerlProc_gettimeofday(t,z) \ + (*PL_Proc->pGetTimeOfDay)(PL_Proc,(t),(z)) #else /* PERL_IMPLICIT_SYS */ @@ -1110,12 +1114,15 @@ struct IPerlProcInfo #define PerlProc_signal(n, h) signal((n), (h)) #define PerlProc_fork() my_fork() #define PerlProc_getpid() getpid() +#define PerlProc_gettimeofday(t,z) gettimeofday((t),(z)) #ifdef WIN32 #define PerlProc_DynaLoad(f) \ win32_dynaload((f)) #define PerlProc_GetOSError(s,e) \ win32_str_os_error((s), (e)) +#define PerlProc_spawnvp(m, c, a) \ + win32_spawnvp((m), (c), (a)) #undef PerlProc_signal #define PerlProc_signal(n, h) win32_signal((n), (h)) #endif @@ -1402,3 +1409,12 @@ struct IPerlSockInfo #endif /* __Inc__IPerl___ */ +/* + * Local variables: + * c-indentation-style: bsd + * c-basic-offset: 4 + * indent-tabs-mode: t + * End: + * + * ex: set ts=8 sts=4 sw=4 noet: + */