diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-04-14 06:54:49 +0200 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-10 18:39:38 +1000 |
commit | b6a1a2ff65a5755d801654f7a41b4854082c96e1 (patch) | |
tree | dfb4a6a1f641cb416fbc426c6a631acbd1c78e03 | |
parent | 828e7cfcf0201d26d8a80110421d7228398079d8 (diff) | |
download | busybox-w32-b6a1a2ff65a5755d801654f7a41b4854082c96e1.tar.gz busybox-w32-b6a1a2ff65a5755d801654f7a41b4854082c96e1.tar.bz2 busybox-w32-b6a1a2ff65a5755d801654f7a41b4854082c96e1.zip |
win32: add mkstemp()
-rw-r--r-- | include/mingw.h | 2 | ||||
-rw-r--r-- | win32/mingw.c | 8 |
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 | ||
130 | NOIMPL(clearenv,void); | 130 | NOIMPL(clearenv,void); |
131 | IMPL(mingw_getenv,char*,NULL,const char *name UNUSED_PARAM); | 131 | IMPL(mingw_getenv,char*,NULL,const char *name UNUSED_PARAM); |
132 | NOIMPL(mkstemp,char *template UNUSED_PARAM); | 132 | int mkstemp(char *template); |
133 | IMPL(realpath,char *,NULL,const char *path UNUSED_PARAM, char *resolved_path UNUSED_PARAM); | 133 | IMPL(realpath,char *,NULL,const char *path UNUSED_PARAM, char *resolved_path UNUSED_PARAM); |
134 | NOIMPL(setenv,const char *name UNUSED_PARAM, const char *value UNUSED_PARAM, int replace UNUSED_PARAM); | 134 | NOIMPL(setenv,const char *name UNUSED_PARAM, const char *value UNUSED_PARAM, int replace UNUSED_PARAM); |
135 | IMPL(unsetenv,void,,const char *env UNUSED_PARAM); | 135 | IMPL(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 | |||
11 | int 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 | } | ||