From 56cb4234e5662769045031a7818f3b90d8116331 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 19 Sep 2021 15:05:39 +0000 Subject: Test availability of mkstemps(3) and provide a fallback implementation in case it is missing; needed for SUN Solaris 10. --- test-mkstemps.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test-mkstemps.c (limited to 'test-mkstemps.c') diff --git a/test-mkstemps.c b/test-mkstemps.c new file mode 100644 index 00000000..31460dca --- /dev/null +++ b/test-mkstemps.c @@ -0,0 +1,12 @@ +#include +#include + +int +main(void) +{ + char filename[] = "/tmp/temp.XXXXXX.suffix"; + + if (mkstemps(filename, 7) == -1) + return 1; + return unlink(filename) == -1; +} -- cgit