From fdb8f90b22f8d4993b5937d55f5cbffc45ae940c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 31 May 2021 07:49:38 -0700 Subject: New: mkdtemp and mkstemp functions. * configure: check for mkstemp and mkdtemp. * stream.c (stdio_set_prop): Implement setting the :name property. We need this in mkstemp_wrap in order to punch in the temporary name, so that the application can retrieve it. (mkdtemp_wrap, mkstemp_wrap): New functions. (stream_init): Register mkdtemp and mkstemp intrinsics. * stream.h (mkdtemp_wrap, mkstemp_wrap): Declared. * txr.1: Documented. * share/txr/stdlib/doc-syms.tl: Updated. --- configure | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'configure') diff --git a/configure b/configure index bf5cfb82..666a238d 100755 --- a/configure +++ b/configure @@ -3228,6 +3228,27 @@ if [ -z "$have_winsize" ] ; then printf "no\n" fi +printf "Checking for mkstemp/mkdtemp ... " + +cat > conftest.c < + +int main(int argc, char **argv) +{ + char templ[] = "abcXXXXXX"; + int fd = mkstemp(templ); + char *s = mkdtemp(templ); + return 0; +} +! + +if conftest ; then + printf "yes\n" + printf "#define HAVE_MKSTEMP 1\n" >> config.h +else + printf "no\n" +fi + printf "Checking for mkstemps ... " cat > conftest.c <