}
if (!thatio) {
#ifdef EINVAL
- SETERRNO(EINVAL,SS$_IVCHAN);
+ SETERRNO(EINVAL,VMS_SS_IVCHAN);
#endif
goto say_false;
}
gv = PL_argvgv;
if (!gv || SvTYPE(gv) != SVt_PVGV) {
if (not_implicit)
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
return FALSE;
}
io = GvIO(gv);
if (not_implicit) {
if (ckWARN(WARN_UNOPENED)) /* no check for closed here */
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
}
return FALSE;
}
IoOFP(io) = IoIFP(io) = Nullfp;
}
else if (not_implicit) {
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
}
return retval;
}
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
return (Off_t)-1;
}
}
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
return FALSE;
}
return PerlLIO_lseek(PerlIO_fileno(fp), pos, whence);
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
return (Off_t)-1;
}
opbuf = SvPV(opstr, opsize);
if (opsize < 3 * SHORTSIZE
|| (opsize % (3 * SHORTSIZE))) {
- SETERRNO(EINVAL,LIB$_INVARG);
+ SETERRNO(EINVAL,VMS_LIB_INVARG);
return -1;
}
SETERRNO(0,0);
break;
case '!':
SETERRNO(SvIOK(sv) ? SvIVX(sv) : SvOK(sv) ? sv_2iv(sv) : 0,
- (SvIV(sv) == EVMSERR) ? 4 : vaxc$errno);
+#ifdef VMS
+ (SvIV(sv) == EVMSERR) ? 4 : vaxc$errno
+#else
+ 0);
break;
case '<':
PL_uid = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
/* now parse the script */
- SETERRNO(0,SS$_NORMAL);
+ SETERRNO(0,VMS_SS_NORMAL);
PL_error_count = 0;
#ifdef MACOS_TRADITIONAL
if (gMacPerl_SyntaxError = (yyparse() || PL_error_count)) {
#include "wince.h"
#endif
+/* These definitions are sneaky.
+ * Their only purpose is to avoid warnings on strict ANSI (non-VMS)
+ * compilers which get huffy about dollars in identifiers,
+ * which is common practise in VMS. The definitions in the
+ * non-VMS branch are not used -- but their only point is to
+ * be something non-dollared. */
+#ifdef VMS
+#define VMS_SS_NORMAL SS$_NORMAL
+#define VMS_SS_IVCHAN SS$_IVCHAN
+#define VMS_RMS_IFI RMS$_FAC
+#define VMS_RMS_IFI RMS$_IFI
+#else
+#define VMS_LIB_INVARG EINVAL
+#define VMS_SS_NORMAL 0
+#define VMS_SS_IVCHAN EBADF
+#define VMS_RMS_FAC 0
+#define VMS_RMS_IFI EBADF
+#endif
+
#endif /* Include guard */
if (f && *f)
return (*PerlIOBase(f)->tab->Close) (f);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
return new;
}
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return NULL;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Fileno) (f);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Read) (f, vbuf, count);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Unread) (f, vbuf, count);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Write) (f, vbuf, count);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Seek) (f, offset, whence);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Tell) (f);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
}
else {
PerlIO_debug("Cannot flush f=%p :%s\n", f, tab->name);
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
else {
PerlIO_debug("Cannot flush f=%p\n", f);
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Fill) (f);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (PerlIOBase(f)->flags & PERLIO_F_UTF8) != 0;
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Eof) (f);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
return (*PerlIOBase(f)->tab->Error) (f);
else {
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
return -1;
}
}
if (f && *f)
(*PerlIOBase(f)->tab->Clearerr) (f);
else
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
}
#undef PerlIO_setlinebuf
if (f && *f)
(*PerlIOBase(f)->tab->Setlinebuf) (f);
else
- SETERRNO(EBADF, SS$_IVCHAN);
+ SETERRNO(EBADF, VMS_SS_IVCHAN);
}
#undef PerlIO_has_base
l->flags |= PERLIO_F_TRUNCATE | PERLIO_F_CANWRITE;
break;
default:
- SETERRNO(EINVAL, LIB$_INVARG);
+ SETERRNO(EINVAL, VMS_LIB_INVARG);
return -1;
}
while (*mode) {
l->flags |= PERLIO_F_CRLF;
break;
default:
- SETERRNO(EINVAL, LIB$_INVARG);
+ SETERRNO(EINVAL, VMS_LIB_INVARG);
return -1;
}
}
*/
oflags |= O_BINARY;
if (*mode || oflags == -1) {
- SETERRNO(EINVAL, LIB$_INVARG);
+ SETERRNO(EINVAL, VMS_LIB_INVARG);
oflags = -1;
}
return oflags;
if (!page_size) {
#if defined(HAS_SYSCONF) && (defined(_SC_PAGESIZE) || defined(_SC_PAGE_SIZE))
{
- SETERRNO(0, SS$_NORMAL);
+ SETERRNO(0, VMS_SS_NORMAL);
# ifdef _SC_PAGESIZE
page_size = sysconf(_SC_PAGESIZE);
# else
if (f && len == sizeof(Off_t))
return PerlIO_seek(f, *posn, SEEK_SET);
}
- SETERRNO(EINVAL, SS$_IVCHAN);
+ SETERRNO(EINVAL, VMS_SS_IVCHAN);
return -1;
}
#else
#endif
}
}
- SETERRNO(EINVAL, SS$_IVCHAN);
+ SETERRNO(EINVAL, VMS_SS_IVCHAN);
return -1;
}
#endif
RETPUSHUNDEF;
}
else
- SETERRNO(0, SS$_NORMAL);
+ SETERRNO(0, VMS_SS_NORMAL);
/* Assume success here to prevent recursive requirement. */
len = strlen(name);
goto had_magic;
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
goto just_say_no;
}
else if (!(fp = IoOFP(io))) {
else if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
}
- SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI);
+ SETERRNO(EBADF,IoIFP(io)?VMS_RMS_FAC:VMS_RMS_IFI);
goto just_say_no;
}
else {
if (!(io = GvIO(gv))) {
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
goto just_say_no;
}
else if (!(fp = IoOFP(io))) {
else if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
}
- SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI);
+ SETERRNO(EBADF,IoIFP(io)?VMS_RMS_FAC:VMS_RMS_IFI);
goto just_say_no;
}
else {
if (result)
RETPUSHYES;
if (!errno)
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
RETPUSHUNDEF;
}
#else
if (!io || !argsv || !IoIFP(io)) {
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,RMS$_IFI); /* well, sort of... */
+ SETERRNO(EBADF,VMS_RMS_IFI); /* well, sort of... */
RETPUSHUNDEF;
}
if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
value = 0;
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
}
PUSHi(value);
RETURN;
report_evil_fh(gv, io, PL_op->op_type);
if (IoIFP(io))
do_close(gv, FALSE);
- SETERRNO(EBADF,LIB$_INVARG);
+ SETERRNO(EBADF,VMS_LIB_INVARG);
RETPUSHUNDEF;
}
nuts:
if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "bind");
nuts:
if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "connect");
nuts:
if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "listen");
nuts:
if (ckWARN(WARN_CLOSED))
report_evil_fh(ggv, ggv ? GvIO(ggv) : 0, PL_op->op_type);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
badexit:
RETPUSHUNDEF;
nuts:
if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, PL_op->op_type);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_sock_func, "shutdown");
nuts:
if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, optype);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
nuts2:
RETPUSHUNDEF;
nuts:
if (ckWARN(WARN_CLOSED))
report_evil_fh(gv, io, optype);
- SETERRNO(EBADF,SS$_IVCHAN);
+ SETERRNO(EBADF,VMS_SS_IVCHAN);
nuts2:
RETPUSHUNDEF;
gv = cGVOP_gv;
report_evil_fh(gv, GvIO(gv), PL_op->op_type);
}
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
RETPUSHUNDEF;
}
}
RETPUSHYES;
nope:
if (!errno)
- SETERRNO(EBADF,RMS$_IFI);
+ SETERRNO(EBADF,VMS_RMS_IFI);
RETPUSHUNDEF;
#else
DIE(aTHX_ PL_no_dir_func, "closedir");
if (pdb)
return pdb;
- SETERRNO(0,SS$_NORMAL);
+ SETERRNO(0,VMS_SS_NORMAL);
return "BEGIN { require 'perl5db.pl' }";
}
return "";