/* Shadow password support for solaris - pdo@cs.umd.edu
* Not just Solaris: at least HP-UX, IRIX, Linux.
* the API is from SysV. --jhi */
+#ifdef __hpux__
+/* There is a MAXINT coming from <shadow.h> <- <hpsecurity.h> <- <values.h>
+ * and another MAXINT from "perl.h" <- <sys/param.h>. */
+#undef MAXINT
+#endif
#include <shadow.h>
#endif
# include <sys/access.h>
#endif
+#if defined(HAS_FCNTL) && defined(F_SETFD) && !defined(FD_CLOEXEC)
+# define FD_CLOEXEC 1 /* NeXT needs this */
+#endif
+
#undef PERL_EFF_ACCESS_R_OK /* EFFective uid/gid ACCESS R_OK */
#undef PERL_EFF_ACCESS_W_OK
#undef PERL_EFF_ACCESS_X_OK
PP(pp_rcatline)
{
- PL_last_in_gv = cGVOP->op_gv;
+ PL_last_in_gv = (GV*)cSVOP->op_sv;
return do_readline();
}
HV *stash = SvSTASH(SvRV(error));
GV *gv = gv_fetchmethod(stash, "PROPAGATE");
if (gv) {
- SV *file = sv_2mortal(newSVsv(GvSV(PL_curcop->cop_filegv)));
+ SV *file = sv_2mortal(newSVsv(CopFILESV(PL_curcop)));
SV *line = sv_2mortal(newSViv(PL_curcop->cop_line));
EXTEND(SP, 3);
PUSHMARK(SP);
if (GvIOp(gv))
IoFLAGS(GvIOp(gv)) &= ~IOf_UNTAINT;
-#if 0 /* no undef means tmpfile() yet */
- if (sv == &PL_sv_undef) {
-#ifdef PerlIO
- PerlIO *fp = PerlIO_tmpfile();
-#else
- PerlIO *fp = tmpfile();
-#endif
- if (fp != Nullfp && do_open(gv, "+>&", 3, FALSE, 0, 0, fp))
- PUSHi( (I32)PL_forkprocess );
- else
- RETPUSHUNDEF;
- RETURN;
- }
-#endif /* no undef means tmpfile() yet */
-
-
if (mg = SvTIED_mg((SV*)gv, 'q')) {
PUSHMARK(SP);
XPUSHs(SvTIED_obj((SV*)gv, mg));
if (ckWARN(WARN_UNTIE)) {
MAGIC * mg ;
if (mg = SvTIED_mg(sv, how)) {
-#ifdef IV_IS_QUAD
if (mg && SvREFCNT(SvRV(mg->mg_obj)) > 1)
Perl_warner(aTHX_ WARN_UNTIE,
- "untie attempted while %" PERL_PRIu64 " inner references still exist",
+ "untie attempted while %"UVuf" inner references still exist",
(UV)SvREFCNT(SvRV(mg->mg_obj)) - 1 ) ;
-#else
- if (mg && SvREFCNT(SvRV(mg->mg_obj)) > 1)
- Perl_warner(aTHX_ WARN_UNTIE,
- "untie attempted while %lu inner references still exist",
- (unsigned long)SvREFCNT(SvRV(mg->mg_obj)) - 1 ) ;
-#endif
}
}
length = -1;
}
if (length < 0) {
- if (IoTYPE(io) == '>' || IoIFP(io) == PerlIO_stdout()
- || IoIFP(io) == PerlIO_stderr())
+ if ((IoTYPE(io) == '>' || IoIFP(io) == PerlIO_stdout()
+ || IoIFP(io) == PerlIO_stderr()) && ckWARN(WARN_IO))
{
SV* sv = sv_newmortal();
gv_efullname3(sv, gv, Nullch);
else
#endif
{
+ /* See the note at doio.c:do_print about filesize limits. --jhi */
length = PerlLIO_write(PerlIO_fileno(IoIFP(io)),
buffer+offset, length);
}
djSP;
GV *gv;
int whence = POPi;
- Off_t offset = POPl;
+ Off_t offset = (Off_t)SvIVx(POPs);
MAGIC *mg;
gv = PL_last_in_gv = (GV*)POPs;
}
else {
retval = SvIV(argsv);
- s = (char*)retval; /* ouch */
+ s = INT2PTR(char*,retval); /* ouch */
}
TAINT_PROPER(optype == OP_IOCTL ? "ioctl" : "fcntl");
STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
- tmpgv = cGVOP->op_gv;
+ tmpgv = (GV*)cSVOP->op_sv;
do_fstat:
if (tmpgv != PL_defgv) {
PL_laststype = OP_STAT;
#endif
PUSHs(sv_2mortal(newSViv(PL_statcache.st_size)));
#ifdef BIG_TIME
- PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_atime)));
- PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_mtime)));
- PUSHs(sv_2mortal(newSVnv((U32)PL_statcache.st_ctime)));
+ PUSHs(sv_2mortal(newSVnv(PL_statcache.st_atime)));
+ PUSHs(sv_2mortal(newSVnv(PL_statcache.st_mtime)));
+ PUSHs(sv_2mortal(newSVnv(PL_statcache.st_ctime)));
#else
PUSHs(sv_2mortal(newSViv(PL_statcache.st_atime)));
PUSHs(sv_2mortal(newSViv(PL_statcache.st_mtime)));
STRLEN n_a;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP->op_gv;
+ gv = (GV*)cSVOP->op_sv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
STRLEN n_a;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP->op_gv;
+ gv = (GV*)cSVOP->op_sv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
else {
if (ckWARN(WARN_UNOPENED))
Perl_warner(aTHX_ WARN_UNOPENED, "Test on unopened file <%s>",
- GvENAME(cGVOP->op_gv));
+ GvENAME((GV*)cSVOP->op_sv));
SETERRNO(EBADF,RMS$_IFI);
RETPUSHUNDEF;
}
PP(pp_wait)
{
-#if !defined(DOSISH) || defined(OS2) || defined(WIN32)
+#if (!defined(DOSISH) || defined(OS2) || defined(WIN32)) && !defined(MACOS_TRADITIONAL)
djSP; dTARGET;
Pid_t childpid;
int argflags;
PP(pp_waitpid)
{
-#if !defined(DOSISH) || defined(OS2) || defined(WIN32)
+#if (!defined(DOSISH) || defined(OS2) || defined(WIN32)) && !defined(MACOS_TRADITIONAL)
djSP; dTARGET;
Pid_t childpid;
int optype;
PerlLIO_close(pp[0]);
if (n) { /* Error */
if (n != sizeof(int))
- Perl_croak(aTHX_ "panic: kid popen errno read");
+ DIE(aTHX_ "panic: kid popen errno read");
errno = errkid; /* Propagate errno from kid */
STATUS_CURRENT = -1;
}
{
#ifdef HAS_GETPGRP
djSP; dTARGET;
- int pid;
- I32 value;
+ Pid_t pid;
+ Pid_t pgrp;
if (MAXARG < 1)
pid = 0;
else
pid = SvIVx(POPs);
#ifdef BSD_GETPGRP
- value = (I32)BSD_GETPGRP(pid);
+ pgrp = (I32)BSD_GETPGRP(pid);
#else
if (pid != 0 && pid != getpid())
DIE(aTHX_ "POSIX getpgrp can't take an argument");
- value = (I32)getpgrp();
+ pgrp = getpgrp();
#endif
- XPUSHi(value);
+ XPUSHi(pgrp);
RETURN;
#else
DIE(aTHX_ PL_no_func, "getpgrp()");
{
#ifdef HAS_SETPGRP
djSP; dTARGET;
- int pgrp;
- int pid;
+ Pid_t pgrp;
+ Pid_t pid;
if (MAXARG < 2) {
pgrp = 0;
pid = 0;
SETi( BSD_SETPGRP(pid, pgrp) >= 0 );
#else
if ((pgrp != 0 && pgrp != getpid()) || (pid != 0 && pid != getpid()))
- DIE(aTHX_ "POSIX setpgrp can't take an argument");
+ DIE(aTHX_ "setpgrp can't take arguments");
SETi( setpgrp() >= 0 );
#endif /* USE_BSDPGRP */
RETURN;
if (!tmbuf)
RETPUSHUNDEF;
tsv = Perl_newSVpvf(aTHX_ "%s %s %2d %02d:%02d:%02d %d",
- dayname[tmbuf->tm_wday],
- monname[tmbuf->tm_mon],
- tmbuf->tm_mday,
- tmbuf->tm_hour,
- tmbuf->tm_min,
- tmbuf->tm_sec,
- tmbuf->tm_year + 1900);
+ dayname[tmbuf->tm_wday],
+ monname[tmbuf->tm_mon],
+ tmbuf->tm_mday,
+ tmbuf->tm_hour,
+ tmbuf->tm_min,
+ tmbuf->tm_sec,
+ tmbuf->tm_year + 1900);
PUSHs(sv_2mortal(tsv));
}
else if (tmbuf) {
PP(pp_spwent)
{
djSP;
-#if defined(HAS_PASSWD) && defined(HAS_SETPWENT) && !defined(CYGWIN)
+#if defined(HAS_PASSWD) && defined(HAS_SETPWENT)
setpwent();
# ifdef HAS_SETSPENT
setspent();
return -1;
}
flock.l_whence = SEEK_SET;
- flock.l_start = flock.l_len = 0L;
+ flock.l_start = flock.l_len = (Off_t)0;
return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &flock);
}