char mode[PERL_MODE_MAX]; /* file mode ("r\0", "rb\0", "ab\0" etc.) */
SV *namesv;
+ PERL_ARGS_ASSERT_DO_OPENN;
+
Zero(mode,sizeof(mode),char);
PL_forkprocess = 1; /* assume true if no fork */
IoTYPE(io) = PerlIO_intmode2str(rawmode, &mode[ix], &writing);
- namesv = sv_2mortal(newSVpvn(oname,len));
+ namesv = newSVpvn_flags(oname, len, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,tend - type));
+ namesv = newSVpvn_flags(type, tend - type, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,tend - type));
+ namesv = newSVpvn_flags(type, tend - type, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,tend - type));
+ namesv = newSVpvn_flags(type, tend - type, SVs_TEMP);
num_svs = 1;
svp = &namesv;
type = NULL;
Gid_t filegid;
IO * const io = GvIOp(gv);
+ PERL_ARGS_ASSERT_NEXTARGV;
+
if (!PL_argvoutgv)
PL_argvoutgv = gv_fetchpvs("ARGVOUT", GV_ADD|GV_NOTQUAL, SVt_PVIO);
if (io && (IoFLAGS(io) & IOf_ARGV) && (IoFLAGS(io) & IOf_START)) {
if (!gv)
gv = PL_argvgv;
- if (!gv || SvTYPE(gv) != SVt_PVGV) {
+ if (!gv || !isGV_with_GP(gv)) {
if (not_implicit)
SETERRNO(EBADF,SS_IVCHAN);
return FALSE;
dVAR;
bool retval = FALSE;
+ PERL_ARGS_ASSERT_IO_CLOSE;
+
if (IoIFP(io)) {
if (IoTYPE(io) == IoTYPE_PIPE) {
const int status = PerlProc_pclose(IoIFP(io));
dVAR;
register IO * const io = GvIO(gv);
+ PERL_ARGS_ASSERT_DO_EOF;
+
if (!io)
return TRUE;
else if ((IoTYPE(io) == IoTYPE_WRONLY) && ckWARN(WARN_IO))
register IO *io = NULL;
register PerlIO *fp;
+ PERL_ARGS_ASSERT_DO_TELL;
+
if (gv && (io = GvIO(gv)) && (fp = IoIFP(io))) {
#ifdef ULTRIX_STDIO_BOTCH
if (PerlIO_eof(fp))
register IO *io = NULL;
register PerlIO *fp;
+ PERL_ARGS_ASSERT_DO_SYSSEEK;
+
if (gv && (io = GvIO(gv)) && (fp = IoIFP(io)))
return PerlLIO_lseek(PerlIO_fileno(fp), pos, whence);
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
}
int
-Perl_mode_from_discipline(pTHX_ SV *discp)
+Perl_mode_from_discipline(pTHX_ const char *s, STRLEN len)
{
int mode = O_BINARY;
- if (discp) {
- STRLEN len;
- const char *s = SvPV_const(discp,len);
+ if (s) {
while (*s) {
if (*s == ':') {
switch (s[1]) {
Perl_do_print(pTHX_ register SV *sv, PerlIO *fp)
{
dVAR;
+
+ PERL_ARGS_ASSERT_DO_PRINT;
+
/* assuming fp is checked earlier */
if (!sv)
return TRUE;
const char *s;
STRLEN len;
PUTBACK;
- if (SvTYPE(sv) == SVt_PVGV) {
+ if (isGV_with_GP(sv)) {
gv = (GV*)sv;
goto do_fstat;
}
- else if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVGV) {
+ else if (SvROK(sv) && isGV_with_GP(SvRV(sv))) {
gv = (GV*)SvRV(sv);
goto do_fstat;
}
static const char no_prev_lstat[] = "The stat preceding -l _ wasn't an lstat";
dSP;
SV *sv;
+ const char *file;
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
if (cGVOP_gv == PL_defgv) {
PL_statgv = NULL;
sv = POPs;
PUTBACK;
- if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PVGV && ckWARN(WARN_IO)) {
+ if (SvROK(sv) && isGV_with_GP(SvRV(sv)) && ckWARN(WARN_IO)) {
Perl_warner(aTHX_ packWARN(WARN_IO), "Use of -l on filehandle %s",
GvENAME((GV*) SvRV(sv)));
return (PL_laststatval = -1);
}
- /* XXX Do really need to be calling SvPV() all these times? */
- sv_setpv(PL_statname,SvPV_nolen_const(sv));
- PL_laststatval = PerlLIO_lstat(SvPV_nolen_const(sv),&PL_statcache);
- if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(SvPV_nolen_const(sv), '\n'))
+ file = SvPV_nolen_const(sv);
+ sv_setpv(PL_statname,file);
+ PL_laststatval = PerlLIO_lstat(file,&PL_statcache);
+ if (PL_laststatval < 0 && ckWARN(WARN_NEWLINE) && strchr(file, '\n'))
Perl_warner(aTHX_ packWARN(WARN_NEWLINE), PL_warn_nl, "lstat");
return PL_laststatval;
}
S_exec_failed(pTHX_ const char *cmd, int fd, int do_report)
{
const int e = errno;
+ PERL_ARGS_ASSERT_EXEC_FAILED;
if (ckWARN(WARN_EXEC))
Perl_warner(aTHX_ packWARN(WARN_EXEC), "Can't exec \"%s\": %s",
cmd, Strerror(e));
int fd, int do_report)
{
dVAR;
+ PERL_ARGS_ASSERT_DO_AEXEC5;
#if defined(MACOS_TRADITIONAL) || defined(__SYMBIAN32__) || defined(__LIBCATAMOUNT__)
Perl_croak(aTHX_ "exec? I'm not *that* kind of operating system");
#else
register char *s;
char *buf;
char *cmd;
-
/* Make a copy so we can change it */
const Size_t cmdlen = strlen(incmd) + 1;
+
+ PERL_ARGS_ASSERT_DO_EXEC3;
+
Newx(buf, cmdlen, char);
cmd = buf;
memcpy(cmd, incmd, cmdlen);
const char *s;
SV ** const oldmark = mark;
+ PERL_ARGS_ASSERT_APPLY;
+
/* Doing this ahead of the switch statement preserves the old behaviour,
where attempting to use kill as a taint test test would fail on
platforms where kill was not defined. */
tot = sp - mark;
while (++mark <= sp) {
GV* gv;
- if (SvTYPE(*mark) == SVt_PVGV) {
+ if (isGV_with_GP(*mark)) {
gv = (GV*)*mark;
do_fchmod:
if (GvIO(gv) && IoIFP(GvIOp(gv))) {
tot--;
}
}
- else if (SvROK(*mark) && SvTYPE(SvRV(*mark)) == SVt_PVGV) {
+ else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
gv = (GV*)SvRV(*mark);
goto do_fchmod;
}
tot = sp - mark;
while (++mark <= sp) {
GV* gv;
- if (SvTYPE(*mark) == SVt_PVGV) {
+ if (isGV_with_GP(*mark)) {
gv = (GV*)*mark;
do_fchown:
if (GvIO(gv) && IoIFP(GvIOp(gv))) {
tot--;
}
}
- else if (SvROK(*mark) && SvTYPE(SvRV(*mark)) == SVt_PVGV) {
+ else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
gv = (GV*)SvRV(*mark);
goto do_fchown;
}
tot = sp - mark;
while (++mark <= sp) {
GV* gv;
- if (SvTYPE(*mark) == SVt_PVGV) {
+ if (isGV_with_GP(*mark)) {
gv = (GV*)*mark;
do_futimes:
if (GvIO(gv) && IoIFP(GvIOp(gv))) {
tot--;
}
}
- else if (SvROK(*mark) && SvTYPE(SvRV(*mark)) == SVt_PVGV) {
+ else if (SvROK(*mark) && isGV_with_GP(SvRV(*mark))) {
gv = (GV*)SvRV(*mark);
goto do_futimes;
}
*/
{
dVAR;
+
+ PERL_ARGS_ASSERT_CANDO;
+
#ifdef DOSISH
/* [Comments and code from Len Reed]
* MS-DOS "user" is similar to UNIX's "superuser," but can't write
const I32 n = (optype == OP_MSGGET) ? 0 : SvIVx(*++mark);
const I32 flags = SvIVx(*++mark);
+ PERL_ARGS_ASSERT_DO_IPCGET;
PERL_UNUSED_ARG(sp);
SETERRNO(0,0);
STRLEN infosize = 0;
I32 getinfo = (cmd == IPC_STAT);
+ PERL_ARGS_ASSERT_DO_IPCCTL;
PERL_UNUSED_ARG(sp);
switch (optype)
const char * const mbuf = SvPV_const(mstr, len);
const I32 msize = len - sizeof(long);
+ PERL_ARGS_ASSERT_DO_MSGSND;
PERL_UNUSED_ARG(sp);
if (msize < 0)
I32 msize, flags, ret;
const I32 id = SvIVx(*++mark);
SV * const mstr = *++mark;
+
+ PERL_ARGS_ASSERT_DO_MSGRCV;
PERL_UNUSED_ARG(sp);
/* suppress warning when reading into undef var --jhi */
const I32 id = SvIVx(*++mark);
SV * const opstr = *++mark;
const char * const opbuf = SvPV_const(opstr, opsize);
+
+ PERL_ARGS_ASSERT_DO_SEMOP;
PERL_UNUSED_ARG(sp);
if (opsize < 3 * SHORTSIZE
SV * const mstr = *++mark;
const I32 mpos = SvIVx(*++mark);
const I32 msize = SvIVx(*++mark);
+
+ PERL_ARGS_ASSERT_DO_SHMIO;
PERL_UNUSED_ARG(sp);
SETERRNO(0,0);
dVAR;
SV * const tmpcmd = newSV(0);
PerlIO *fp;
+
+ PERL_ARGS_ASSERT_START_GLOB;
+
ENTER;
SAVEFREESV(tmpcmd);
#ifdef VMS /* expand the wildcards right here, rather than opening a pipe, */