aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-14 06:54:49 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-10 18:39:38 +1000
commitb6a1a2ff65a5755d801654f7a41b4854082c96e1 (patch)
treedfb4a6a1f641cb416fbc426c6a631acbd1c78e03
parent828e7cfcf0201d26d8a80110421d7228398079d8 (diff)
downloadbusybox-w32-b6a1a2ff65a5755d801654f7a41b4854082c96e1.tar.gz
busybox-w32-b6a1a2ff65a5755d801654f7a41b4854082c96e1.tar.bz2
busybox-w32-b6a1a2ff65a5755d801654f7a41b4854082c96e1.zip
win32: add mkstemp()
-rw-r--r--include/mingw.h2
-rw-r--r--win32/mingw.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/include/mingw.h b/include/mingw.h
index 1c923089f..75f70e5ef 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -129,7 +129,7 @@ int fdprintf(int fd, const char *format, ...);
129 129
130NOIMPL(clearenv,void); 130NOIMPL(clearenv,void);
131IMPL(mingw_getenv,char*,NULL,const char *name UNUSED_PARAM); 131IMPL(mingw_getenv,char*,NULL,const char *name UNUSED_PARAM);
132NOIMPL(mkstemp,char *template UNUSED_PARAM); 132int mkstemp(char *template);
133IMPL(realpath,char *,NULL,const char *path UNUSED_PARAM, char *resolved_path UNUSED_PARAM); 133IMPL(realpath,char *,NULL,const char *path UNUSED_PARAM, char *resolved_path UNUSED_PARAM);
134NOIMPL(setenv,const char *name UNUSED_PARAM, const char *value UNUSED_PARAM, int replace UNUSED_PARAM); 134NOIMPL(setenv,const char *name UNUSED_PARAM, const char *value UNUSED_PARAM, int replace UNUSED_PARAM);
135IMPL(unsetenv,void,,const char *env UNUSED_PARAM); 135IMPL(unsetenv,void,,const char *env UNUSED_PARAM);
diff --git a/win32/mingw.c b/win32/mingw.c
index b92fa82a5..3611872ec 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -7,3 +7,11 @@ unsigned int sleep (unsigned int seconds)
7 Sleep(seconds*1000); 7 Sleep(seconds*1000);
8 return 0; 8 return 0;
9} 9}
10
11int mkstemp(char *template)
12{
13 char *filename = mktemp(template);
14 if (filename == NULL)
15 return -1;
16 return open(filename, O_RDWR | O_CREAT, 0600);
17}