diff --git a/cbits/HsUnix.c b/cbits/HsUnix.c
index d74917b07f4cc85293f76158203ed65f6f8ffcd6..d6366fc98862bc7f85222a51a6aa8dd821931da8 100644
--- a/cbits/HsUnix.c
+++ b/cbits/HsUnix.c
@@ -132,6 +132,9 @@ int __hsunix_push_module(int fd, const char *module)
 int __hscore_mkstemp(char *filetemplate) {
     return (mkstemp(filetemplate));
 }
+char *__hscore_mkdtemp(char *filetemplate) {
+    return (mkdtemp(filetemplate));
+}
 #endif
 
 #if !defined(__MINGW32__) && !defined(irix_HOST_OS)
diff --git a/include/HsUnix.h b/include/HsUnix.h
index d8a072a7a0830e43064bf547985fc31ad9f49d9c..eecbfe8ed04c5df414841a89c77b1758b990539c 100644
--- a/include/HsUnix.h
+++ b/include/HsUnix.h
@@ -175,6 +175,7 @@ int __hsunix_push_module(int fd, const char *module);
 
 #if !defined(__MINGW32__)
 int __hscore_mkstemp(char *filetemplate);
+char *__hscore_mkdtemp(char *filetemplate);
 #endif
 
 #if !defined(__MINGW32__) && !defined(irix_HOST_OS)