summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-08-04 14:30:13 +1000
committerTony Cook <tony@develop-help.com>2017-09-11 10:59:42 +1000
commite48855bdd2fc57fc51156f5e4b8dee6b544456c8 (patch)
tree79e0c472f0a2485d7ee7638c30fb5946ce8fae46 /util.h
parentf26b33bdaa1e41fbaf65c649a3208f081fa7571b (diff)
downloadperl-e48855bdd2fc57fc51156f5e4b8dee6b544456c8.tar.gz
(perl #127663) add our own mkstemp() implementation
Needed to generate temp files for safer in-place editing. Not based on any particular implementation, the BSD implementations tend to be wrappers around a megafunction that also does a few variations of mkstemp() and mkdtemp(), which we don't need (yet.) This might also be useful as a replacement for broken mkstemp() implementations that use a mode of 0666 when creating the file, though we'd need to add Configure probing for that.
Diffstat (limited to 'util.h')
-rw-r--r--util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/util.h b/util.h
index 4589808ee1..6b63d90e4f 100644
--- a/util.h
+++ b/util.h
@@ -246,6 +246,10 @@ means arg not present, 1 is empty string/null byte */
((char *) memmem(big, bigend - big, little, lend - little))
#endif
+#if defined(HAS_MKSTEMP) && defined(PERL_CORE)
+# define Perl_my_mkstemp(templte) mkstemp(templte)
+#endif
+
#endif /* PERL_UTIL_H_ */
/*