summaryrefslogtreecommitdiff
path: root/vms
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-06-30 02:17:08 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-06-30 02:17:08 +0000
commit0cacb523b3d9abfe9ac5761f31a2c11458e98c49 (patch)
treeacde324ceba735856a8f8a0dc5aa2e408e7ca639 /vms
parente5125a2406cb25f415acb1a11d14e6e53cda219b (diff)
parent674d6c381cbfa67bc93fd195278b889049c14bba (diff)
downloadperl-0cacb523b3d9abfe9ac5761f31a2c11458e98c49.tar.gz
integrate vmsperl changes into mainline
p4raw-id: //depot/perl@6287
Diffstat (limited to 'vms')
-rw-r--r--vms/vms.c22
-rw-r--r--vms/vmsish.h12
2 files changed, 34 insertions, 0 deletions
diff --git a/vms/vms.c b/vms/vms.c
index cc1184b6cf..de4a374637 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -936,6 +936,28 @@ my_chdir(char *dir)
} /* end of my_chdir */
/*}}}*/
+
+/*{{{FILE *my_tmpfile()*/
+FILE *
+my_tmpfile(void)
+{
+ FILE *fp;
+ char *cp;
+ dTHX;
+
+ if ((fp = tmpfile())) return fp;
+
+ New(1323,cp,L_tmpnam+24,char);
+ strcpy(cp,"Sys$Scratch:");
+ tmpnam(cp+strlen(cp));
+ strcat(cp,".Perltmp");
+ fp = fopen(cp,"w+","fop=dlt");
+ Safefree(cp);
+ return fp;
+}
+/*}}}*/
+
+
static void
create_mbx(unsigned short int *chan, struct dsc$descriptor_s *namdsc)
{
diff --git a/vms/vmsish.h b/vms/vmsish.h
index a181e7c3d9..382e314743 100644
--- a/vms/vmsish.h
+++ b/vms/vmsish.h
@@ -110,6 +110,7 @@
#define kill_file Perl_kill_file
#define my_mkdir Perl_my_mkdir
#define my_chdir Perl_my_chdir
+#define my_tmpfile Perl_my_tmpfile
#define my_utime Perl_my_utime
#define rmsexpand Perl_rmsexpand
#define rmsexpand_ts Perl_rmsexpand_ts
@@ -175,6 +176,16 @@
# define vfork my_vfork
#endif
+/*
+ * Toss in a shim to tmpfile which creates a plain temp file if the
+ * RMS tmp mechanism won't work (e.g. if someone is relying on ACLs
+ * from a specific directory to permit creation of files).
+ */
+#ifndef DONT_MASK_RTL_CALLS
+# define tmpfile my_tmpfile
+#endif
+
+
/* BIG_TIME:
* This symbol is defined if Time_t is an unsigned type on this system.
*/
@@ -643,6 +654,7 @@ int do_rmdir (char *);
int kill_file (char *);
int my_mkdir (char *, Mode_t);
int my_chdir (char *);
+FILE * my_tmpfile (void);
int my_utime (char *, struct utimbuf *);
char * rmsexpand (char *, char *, char *, unsigned);
char * rmsexpand_ts (char *, char *, char *, unsigned);