perl 5.003_05: hints/solaris_2.sh
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index d733c34..9d962d0 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
 #include "EXTERN.h"
 #include "perl.h"
 
-/* XXX Omit this -- it causes too much grief on mixed systems.
-   Next time, I should force broken systems to unset i_unistd in
-   hint files.
-*/
-#if 0
-# ifdef I_UNISTD
-#  include <unistd.h>
-# endif
+/* XXX If this causes problems, set i_unistd=undef in the hint file.  */
+#ifdef I_UNISTD
+# include <unistd.h>
+#endif
+
+#ifdef I_SYS_WAIT
+# include <sys/wait.h>
+#endif
+
+#ifdef I_SYS_RESOURCE
+# include <sys/resource.h>
 #endif
 
 /* Put this after #includes because fork and vfork prototypes may
 
 #ifdef HAS_SELECT
 #ifdef I_SYS_SELECT
-#ifndef I_SYS_TIME
 #include <sys/select.h>
 #endif
 #endif
-#endif
 
 #ifdef HOST_NOT_FOUND
 extern int h_errno;
@@ -747,7 +748,7 @@ PP(pp_select)
     else {
        GV **gvp = (GV**)hv_fetch(hv, GvNAME(egv), GvNAMELEN(egv), FALSE);
        if (gvp && *gvp == egv)
-           gv_efullname(TARG, defoutgv);
+           gv_efullname(TARG, defoutgv, Nullch);
        else
            sv_setsv(TARG, sv_2mortal(newRV((SV*)egv)));
        XPUSHTARG;
@@ -841,7 +842,7 @@ PP(pp_enterwrite)
     if (!cv) {
        if (fgv) {
            SV *tmpsv = sv_newmortal();
-           gv_efullname(tmpsv, gv);
+           gv_efullname(tmpsv, fgv, Nullch);
            DIE("Undefined format \"%s\" called",SvPVX(tmpsv));
        }
        DIE("Not a format reference");
@@ -920,7 +921,7 @@ PP(pp_leavewrite)
        cv = GvFORM(fgv);
        if (!cv) {
            SV *tmpsv = sv_newmortal();
-           gv_efullname(tmpsv, fgv);
+           gv_efullname(tmpsv, fgv, Nullch);
            DIE("Undefined top format \"%s\" called",SvPVX(tmpsv));
        }
        return doform(cv,gv,op);
@@ -977,7 +978,7 @@ PP(pp_prtf)
        gv = defoutgv;
     if (!(io = GvIO(gv))) {
        if (dowarn) {
-           gv_fullname(sv,gv);
+           gv_fullname(sv, gv, Nullch);
            warn("Filehandle %s never opened", SvPV(sv,na));
        }
        SETERRNO(EBADF,RMS$_IFI);
@@ -985,7 +986,7 @@ PP(pp_prtf)
     }
     else if (!(fp = IoOFP(io))) {
        if (dowarn)  {
-           gv_fullname(sv,gv);
+           gv_fullname(sv, gv, Nullch);
            if (IoIFP(io))
                warn("Filehandle %s opened only for input", SvPV(sv,na));
            else
@@ -3169,7 +3170,7 @@ PP(pp_sleep)
 
     (void)time(&lasttime);
     if (MAXARG < 1)
-       pause();
+       Pause();
     else {
        duration = POPi;
        sleep((unsigned int)duration);
@@ -4046,12 +4047,9 @@ PP(pp_syscall)
     locking module.
 */
 
-/*  We might need <unistd.h> because it sometimes defines the lockf()
-    constants.  Unfortunately, <unistd.h> causes troubles on some mixed
-    (BSD/POSIX) systems, such as SunOS 4.1.3.  We could just try including
-    <unistd.h> here in this part of the file, but that might
-    conflict with various other #defines and includes above, such as
-       #define vfork fork above.
+/*  The lockf() constants might have been defined in <unistd.h>.
+    Unfortunately, <unistd.h> causes troubles on some mixed
+    (BSD/POSIX) systems, such as SunOS 4.1.3.
 
    Further, the lockf() constants aren't POSIX, so they might not be
    visible if we're compiling with _POSIX_SOURCE defined.  Thus, we'll