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-04-20 19:14:01 +0200 |
commit | c63a0fec81bb525c940c182b34929bcba0302fe5 (patch) | |
tree | 2288f72b7228afbdf82c6c7c2f65f788a2b067bb | |
parent | 416378f1ae4dde355dec48758045ca7e4e165850 (diff) | |
download | busybox-w32-c63a0fec81bb525c940c182b34929bcba0302fe5.tar.gz busybox-w32-c63a0fec81bb525c940c182b34929bcba0302fe5.tar.bz2 busybox-w32-c63a0fec81bb525c940c182b34929bcba0302fe5.zip |
win32: add mkstemp()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
-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 3b7aa9469..ccf3060e7 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 | } | ||