Added mktemp(3).

This is a stupid, ugly function added for compatibility.
This commit is contained in:
Jonas 'Sortie' Termansen 2012-03-04 17:29:50 +01:00
parent 5d826ec284
commit b1b123109a
2 changed files with 14 additions and 0 deletions

View File

@ -89,6 +89,9 @@ size_t mbstowcs(wchar_t *restrict, const char* restrict, size_t);
int mbtowc(wchar_t *restrict, const char* restrict, size_t);
char* mkdtemp(char*);
int mkstemp(char*);
#if !defined(_SORTIX_SOURCE)
char* mktemp(char* templ);
#endif
long mrand48(void);
long nrand48(unsigned short[3]);
int posix_memalign(void**, size_t, size_t);

View File

@ -292,6 +292,17 @@ namespace Maxsi
{
return SysFStat(fd, st);
}
// TODO: This is a hacky implementation of a stupid function.
char* mktemp(char* templ)
{
size_t templlen = strlen(templ);
for ( size_t i = templlen-6UL; i < templlen; i++ )
{
templ[i] = '0' + rand() % 10;
}
return templ;
}
#endif
}