This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Additions to perldiag for MRO, by Brandon Black.
[perl5.git] / iperlsys.h
index c82ffa7..bc99954 100644 (file)
 #include "perlio.h"
 
 #ifndef Sighandler_t
+#  if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
+typedef Signal_t (*Sighandler_t) (int, ...);
+#  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*);