mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 05:26:58 +00:00
Added some more runtime functions
svn path=/trunk/; revision=1497
This commit is contained in:
parent
8fe6e74b25
commit
624869c3c3
|
@ -1,4 +1,4 @@
|
|||
# $Id: Makefile,v 1.8 2001/01/06 15:49:25 ekohl Exp $
|
||||
# $Id: Makefile,v 1.9 2001/01/07 02:58:31 ekohl Exp $
|
||||
#
|
||||
# ReactOS Operating System
|
||||
#
|
||||
|
@ -46,10 +46,12 @@ OBJECTS_FLOAT = \
|
|||
float/isnan.o
|
||||
|
||||
OBJECTS_IO = \
|
||||
io/access.o \
|
||||
io/close.o \
|
||||
io/fmode.o \
|
||||
io/isatty.o \
|
||||
io/lseek.o \
|
||||
io/mktemp.o \
|
||||
io/open.o \
|
||||
io/read.o \
|
||||
io/setmode.o \
|
||||
|
@ -62,7 +64,9 @@ OBJECTS_MATH = \
|
|||
|
||||
OBJECTS_MISC = \
|
||||
misc/amsg.o \
|
||||
misc/assert.o \
|
||||
misc/dllmain.o \
|
||||
misc/getargs.o \
|
||||
misc/purecall.o \
|
||||
misc/tls.o
|
||||
|
||||
|
@ -83,6 +87,7 @@ OBJECTS_STDIO = \
|
|||
stdio/fflush.o \
|
||||
stdio/fgets.o \
|
||||
stdio/filbuf.o \
|
||||
stdio/fileno.o \
|
||||
stdio/flsbuf.o \
|
||||
stdio/fopen.o \
|
||||
stdio/fprintf.o \
|
||||
|
@ -100,6 +105,7 @@ OBJECTS_STDIO = \
|
|||
stdio/setvbuf.o \
|
||||
stdio/sprintf.o \
|
||||
stdio/stdhnd.o \
|
||||
stdio/tempnam.o \
|
||||
stdio/vfprintf.o \
|
||||
stdio/vfwprint.o \
|
||||
stdio/vprintf.o \
|
||||
|
@ -176,7 +182,8 @@ OBJECTS_STRING = \
|
|||
string/strxfrm.o
|
||||
|
||||
OBJECTS_SYS_STAT = \
|
||||
sys_stat/fstat.o
|
||||
sys_stat/fstat.o \
|
||||
sys_stat/stat.o
|
||||
|
||||
OBJECTS_TIME = \
|
||||
time/time.o \
|
||||
|
|
|
@ -261,23 +261,33 @@ unsigned short _ctype[] = {
|
|||
0 /* 0xff */
|
||||
};
|
||||
|
||||
unsigned short *__p__pctype = _ctype + 1;
|
||||
unsigned short *__p__pwctype = _ctype + 1;
|
||||
unsigned short *_pctype = _ctype + 1;
|
||||
unsigned short *_pwctype = _ctype + 1;
|
||||
|
||||
int _isctype (unsigned int c, int ctypeFlags)
|
||||
unsigned short **__p__pctype(void)
|
||||
{
|
||||
return (__p__pctype[(unsigned char)(c & 0xFF)] & ctypeFlags);
|
||||
return &_pctype;
|
||||
}
|
||||
|
||||
unsigned short **__p__pwctype(void)
|
||||
{
|
||||
return &_pwctype;
|
||||
}
|
||||
|
||||
int _isctype(unsigned int c, int ctypeFlags)
|
||||
{
|
||||
return (_pctype[(unsigned char)(c & 0xFF)] & ctypeFlags);
|
||||
}
|
||||
|
||||
int iswctype(wint_t wc, wctype_t wctypeFlags)
|
||||
{
|
||||
return (__p__pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
|
||||
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
|
||||
}
|
||||
|
||||
// obsolete
|
||||
int is_wctype(wint_t wc, wctype_t wctypeFlags)
|
||||
int is_wctype(wint_t wc, wctype_t wctypeFlags)
|
||||
{
|
||||
return (__p__pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
|
||||
return (_pwctype[(unsigned char)(wc & 0xFF)] & wctypeFlags);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
|
56
reactos/lib/msvcrt/io/access.c
Normal file
56
reactos/lib/msvcrt/io/access.c
Normal file
|
@ -0,0 +1,56 @@
|
|||
#include <windows.h>
|
||||
#include <crtdll/io.h>
|
||||
|
||||
#ifndef F_OK
|
||||
#define F_OK 0x01
|
||||
#endif
|
||||
#ifndef R_OK
|
||||
#define R_OK 0x02
|
||||
#endif
|
||||
#ifndef W_OK
|
||||
#define W_OK 0x04
|
||||
#endif
|
||||
#ifndef X_OK
|
||||
#define X_OK 0x08
|
||||
#endif
|
||||
#ifndef D_OK
|
||||
#define D_OK 0x10
|
||||
#endif
|
||||
|
||||
int _access( const char *_path, int _amode )
|
||||
{
|
||||
DWORD Attributes = GetFileAttributesA(_path);
|
||||
|
||||
if ( Attributes == -1 )
|
||||
return -1;
|
||||
|
||||
if ( (_amode & W_OK) == W_OK ) {
|
||||
if ( (Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY )
|
||||
return -1;
|
||||
}
|
||||
if ( (_amode & D_OK) == D_OK ) {
|
||||
if ( (Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY )
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _waccess( const wchar_t *_path, int _amode )
|
||||
{
|
||||
DWORD Attributes = GetFileAttributesW(_path);
|
||||
|
||||
if ( Attributes == -1 )
|
||||
return -1;
|
||||
|
||||
if ( (_amode & W_OK) == W_OK ) {
|
||||
if ( (Attributes & FILE_ATTRIBUTE_READONLY) == FILE_ATTRIBUTE_READONLY )
|
||||
return -1;
|
||||
}
|
||||
if ( (_amode & D_OK) == D_OK ) {
|
||||
if ( (Attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY )
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -5,5 +5,7 @@
|
|||
#undef _fmode
|
||||
unsigned int _fmode = O_TEXT;
|
||||
|
||||
unsigned int *_fmode_dll = &_fmode;
|
||||
|
||||
unsigned int *__p__fmode(void)
|
||||
{
|
||||
return &_fmode;
|
||||
}
|
||||
|
|
71
reactos/lib/msvcrt/io/mktemp.c
Normal file
71
reactos/lib/msvcrt/io/mktemp.c
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/crtdll/io/mktemp.c
|
||||
* PURPOSE: Makes a temp file based on a template
|
||||
* PROGRAMER: DJ Delorie
|
||||
Boudewijn Dekker
|
||||
* UPDATE HISTORY:
|
||||
* 28/12/98: Appropriated for the Reactos Kernel
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
|
||||
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
|
||||
|
||||
#include <crtdll/stdio.h>
|
||||
#include <crtdll/string.h>
|
||||
#include <crtdll/io.h>
|
||||
|
||||
|
||||
char* _mktemp (char *_template)
|
||||
{
|
||||
static int count = 0;
|
||||
char *cp, *dp;
|
||||
int i, len, xcount, loopcnt;
|
||||
|
||||
len = strlen (_template);
|
||||
cp = _template + len;
|
||||
|
||||
xcount = 0;
|
||||
while (xcount < 6 && cp > _template && cp[-1] == 'X')
|
||||
xcount++, cp--;
|
||||
|
||||
if (xcount) {
|
||||
dp = cp;
|
||||
while (dp > _template && dp[-1] != '/' && dp[-1] != '\\' && dp[-1] != ':')
|
||||
dp--;
|
||||
|
||||
/* Keep the first characters of the template, but turn the rest into
|
||||
Xs. */
|
||||
while (cp > dp + 8 - xcount) {
|
||||
*--cp = 'X';
|
||||
xcount = (xcount >= 6) ? 6 : 1 + xcount;
|
||||
}
|
||||
|
||||
/* If dots occur too early -- squash them. */
|
||||
while (dp < cp) {
|
||||
if (*dp == '.') *dp = 'a';
|
||||
dp++;
|
||||
}
|
||||
|
||||
/* Try to add ".tmp" to the filename. Truncate unused Xs. */
|
||||
if (cp + xcount + 3 < _template + len)
|
||||
strcpy (cp + xcount, ".tmp");
|
||||
else
|
||||
cp[xcount] = 0;
|
||||
|
||||
/* This loop can run up to 2<<(5*6) times, or about 10^9 times. */
|
||||
for (loopcnt = 0; loopcnt < (1 << (5 * xcount)); loopcnt++) {
|
||||
int c = count++;
|
||||
for (i = 0; i < xcount; i++, c >>= 5)
|
||||
cp[i] = "abcdefghijklmnopqrstuvwxyz012345"[c & 0x1f];
|
||||
if (_access(_template,0) == -1)
|
||||
return _template;
|
||||
}
|
||||
}
|
||||
|
||||
/* Failure: truncate the template and return NULL. */
|
||||
*_template = 0;
|
||||
return 0;
|
||||
}
|
12
reactos/lib/msvcrt/misc/assert.c
Normal file
12
reactos/lib/msvcrt/misc/assert.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
||||
#include <crtdll/assert.h>
|
||||
#include <crtdll/stdio.h>
|
||||
#include <crtdll/stdlib.h>
|
||||
#include <crtdll/signal.h>
|
||||
|
||||
void _assert(const char *msg, const char *file, int line)
|
||||
{
|
||||
/* Assertion failed at foo.c line 45: x<y */
|
||||
fprintf(stderr, "Assertion failed at %s line %d: %s\n", file, line, msg);
|
||||
raise(SIGABRT);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: dllmain.c,v 1.2 2000/12/03 17:57:25 ekohl Exp $
|
||||
/* $Id: dllmain.c,v 1.3 2001/01/07 02:58:32 ekohl Exp $
|
||||
*
|
||||
* ReactOS MSVCRT.DLL Compatibility Library
|
||||
*/
|
||||
|
@ -14,15 +14,19 @@ unsigned int _winminor = 0;
|
|||
unsigned int _winmajor = 0;
|
||||
unsigned int _winver = 0;
|
||||
|
||||
char *_acmdln = NULL; /* pointer to ascii command line */
|
||||
char **_environ = NULL; /* pointer to environment block */
|
||||
char *_pgmptr = NULL; /* pointer to program name */
|
||||
|
||||
int __app_type = 0; //_UNKNOWN_APP; /* application type */
|
||||
|
||||
|
||||
/* FUNCTIONS **************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
__stdcall
|
||||
DllMain(
|
||||
PVOID hinstDll,
|
||||
ULONG dwReason,
|
||||
PVOID reserved
|
||||
)
|
||||
BOOLEAN __stdcall
|
||||
DllMain(PVOID hinstDll,
|
||||
ULONG dwReason,
|
||||
PVOID reserved)
|
||||
{
|
||||
switch (dwReason)
|
||||
{
|
||||
|
@ -38,6 +42,9 @@ DllMain(
|
|||
if (!CreateThreadData())
|
||||
return FALSE;
|
||||
|
||||
_acmdln = (char *)GetCommandLineA();
|
||||
_environ = (char **)GetEnvironmentStringsA();
|
||||
|
||||
/* FIXME: more initializations... */
|
||||
|
||||
nAttachCount++;
|
||||
|
@ -57,7 +64,6 @@ DllMain(
|
|||
|
||||
/* FIXME: more cleanup... */
|
||||
|
||||
|
||||
/* destroy tls stuff */
|
||||
DestroyThreadData();
|
||||
}
|
||||
|
@ -67,4 +73,49 @@ DllMain(
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void __set_app_type(int app_type)
|
||||
{
|
||||
__app_type = app_type;
|
||||
}
|
||||
|
||||
|
||||
char **__p__acmdln(void)
|
||||
{
|
||||
return &_acmdln;
|
||||
}
|
||||
|
||||
char ***__p__environ(void)
|
||||
{
|
||||
return &_environ;
|
||||
}
|
||||
|
||||
unsigned int *__p__osver(void)
|
||||
{
|
||||
return &_osver;
|
||||
}
|
||||
|
||||
char **__p__pgmptr(void)
|
||||
{
|
||||
return &_pgmptr;
|
||||
}
|
||||
|
||||
unsigned int *__p__winmajor(void)
|
||||
{
|
||||
return &_winmajor;
|
||||
}
|
||||
|
||||
unsigned int *__p__winminor(void)
|
||||
{
|
||||
return &_winminor;
|
||||
}
|
||||
|
||||
unsigned int *__p__winver(void)
|
||||
{
|
||||
return &_winver;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* EOF */
|
||||
|
|
79
reactos/lib/msvcrt/misc/getargs.c
Normal file
79
reactos/lib/msvcrt/misc/getargs.c
Normal file
|
@ -0,0 +1,79 @@
|
|||
#include <windows.h>
|
||||
#include <msvcrt/stdlib.h>
|
||||
#include <msvcrt/string.h>
|
||||
|
||||
extern char *_acmdln;
|
||||
extern char *_pgmptr;
|
||||
extern char **_environ;
|
||||
|
||||
#undef __argv
|
||||
#undef __argc
|
||||
|
||||
char *xargv[1024];
|
||||
|
||||
char **__argv = xargv;
|
||||
int __argc = 0;
|
||||
|
||||
|
||||
int __getmainargs(int *argc,char ***argv,char ***env,int flag)
|
||||
{
|
||||
int i,afterlastspace;
|
||||
DWORD version;
|
||||
|
||||
/* missing threading init */
|
||||
|
||||
i=0;
|
||||
afterlastspace=0;
|
||||
|
||||
while (_acmdln[i])
|
||||
{
|
||||
if (_acmdln[i]==' ')
|
||||
{
|
||||
__argc++;
|
||||
_acmdln[i]='\0';
|
||||
__argv[__argc-1] = strdup(_acmdln + afterlastspace);
|
||||
i++;
|
||||
while (_acmdln[i]==' ')
|
||||
i++;
|
||||
afterlastspace=i;
|
||||
}
|
||||
else
|
||||
{
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
if (_acmdln[afterlastspace] != 0)
|
||||
{
|
||||
__argc++;
|
||||
_acmdln[i]='\0';
|
||||
__argv[__argc-1] = strdup(_acmdln+afterlastspace);
|
||||
}
|
||||
HeapValidate(GetProcessHeap(),0,NULL);
|
||||
|
||||
*argc = __argc;
|
||||
*argv = __argv;
|
||||
*env = _environ;
|
||||
|
||||
_pgmptr = strdup((char *)argv[0]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int *__p___argc(void)
|
||||
{
|
||||
return &__argc;
|
||||
}
|
||||
|
||||
char ***__p___argv(void)
|
||||
{
|
||||
return &__argv;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int _chkstk(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: msvcrt.def,v 1.3 2001/01/06 15:49:25 ekohl Exp $
|
||||
; $Id: msvcrt.def,v 1.4 2001/01/07 02:58:31 ekohl Exp $
|
||||
;
|
||||
; ReactOS MSVCRT Compatibility Library
|
||||
;
|
||||
|
@ -89,8 +89,8 @@ EXPORTS
|
|||
; __RTDynamicCast
|
||||
; __RTtypeid
|
||||
; __STRINGTOLD
|
||||
; __argc
|
||||
; __argv
|
||||
__argc
|
||||
__argv
|
||||
; __badioinfo
|
||||
; __crtCompareStringA
|
||||
; __crtGetLocaleInfoW
|
||||
|
@ -98,7 +98,7 @@ EXPORTS
|
|||
; __dllonexit
|
||||
; __doserrno
|
||||
; __fpecode
|
||||
; __getmainargs
|
||||
__getmainargs
|
||||
; __initenv
|
||||
__isascii
|
||||
__iscsym
|
||||
|
@ -108,38 +108,38 @@ __iscsymf
|
|||
; __lc_handle
|
||||
; __lconv_init
|
||||
; __mb_cur_max
|
||||
; __p___argc
|
||||
; __p___argv
|
||||
__p___argc
|
||||
__p___argv
|
||||
; __p___initenv
|
||||
; __p___mb_cur_max
|
||||
; __p___wargv
|
||||
; __p___winitenv
|
||||
; __p__acmdln
|
||||
__p__acmdln
|
||||
; __p__amblksiz
|
||||
; __p__commode
|
||||
; __p__daylight
|
||||
; __p__dstbias
|
||||
; __p__environ
|
||||
__p__environ
|
||||
; __p__fileinfo
|
||||
; __p__fmode
|
||||
__p__fmode
|
||||
; __p__iob
|
||||
; __p__mbcasemap
|
||||
; __p__mbctype
|
||||
; __p__osver
|
||||
__p__pctype DATA
|
||||
; __p__pgmptr
|
||||
__p__pwctype DATA
|
||||
__p__osver
|
||||
__p__pctype
|
||||
__p__pgmptr
|
||||
__p__pwctype
|
||||
; __p__timezone
|
||||
; __p__tzname
|
||||
; __p__wcmdln
|
||||
; __p__wenviron
|
||||
; __p__winmajor
|
||||
; __p__winminor
|
||||
; __p__winver
|
||||
__p__winmajor
|
||||
__p__winminor
|
||||
__p__winver
|
||||
; __p__wpgmptr
|
||||
; __pioinfo
|
||||
; __pxcptinfoptrs
|
||||
; __set_app_type
|
||||
__set_app_type
|
||||
; __setlc_active
|
||||
; __setusermatherr
|
||||
__threadhandle
|
||||
|
@ -152,8 +152,8 @@ __toascii
|
|||
; __wgetmainargs
|
||||
; __winitenv
|
||||
; _abnormal_termination
|
||||
; _access
|
||||
; _acmdln
|
||||
_access
|
||||
_acmdln DATA
|
||||
; _adj_fdiv_m16i
|
||||
; _adj_fdiv_m32
|
||||
; _adj_fdiv_m32i
|
||||
|
@ -170,7 +170,7 @@ __toascii
|
|||
; _adjust_fdiv
|
||||
_aexit_rtn
|
||||
_amsg_exit
|
||||
; _assert
|
||||
_assert
|
||||
; _atodbl
|
||||
; _atoi64
|
||||
; _atoldbl
|
||||
|
@ -208,7 +208,7 @@ _ctype DATA
|
|||
; _ecvt
|
||||
_endthread
|
||||
_endthreadex
|
||||
; _environ
|
||||
_environ DATA
|
||||
; _eof
|
||||
_errno
|
||||
; _except_handler2
|
||||
|
@ -232,7 +232,7 @@ _filbuf
|
|||
; _fileinfo
|
||||
; _filelength
|
||||
; _filelengthi64
|
||||
; _fileno
|
||||
_fileno
|
||||
; _findclose
|
||||
; _findfirst
|
||||
; _findfirsti64
|
||||
|
@ -241,7 +241,7 @@ _filbuf
|
|||
_finite
|
||||
_flsbuf
|
||||
_flushall
|
||||
_fmode
|
||||
_fmode DATA
|
||||
; _fpclass
|
||||
; _fpieee_flt
|
||||
_fpreset
|
||||
|
@ -397,7 +397,7 @@ _makepath
|
|||
_memccpy
|
||||
_memicmp
|
||||
_mkdir
|
||||
; _mktemp
|
||||
_mktemp
|
||||
; _msize
|
||||
; _nextafter
|
||||
; _onexit
|
||||
|
@ -408,8 +408,8 @@ _osver DATA
|
|||
; _outpd
|
||||
; _outpw
|
||||
; _pclose
|
||||
; _pctype
|
||||
; _pgmptr
|
||||
_pctype DATA
|
||||
_pgmptr DATA
|
||||
; _pipe
|
||||
; _popen
|
||||
_purecall
|
||||
|
@ -417,7 +417,7 @@ _purecall
|
|||
_putenv
|
||||
; _putw
|
||||
; _putws
|
||||
; _pwctype
|
||||
_pwctype DATA
|
||||
_read
|
||||
_rmdir
|
||||
; _rmtmp
|
||||
|
@ -452,7 +452,7 @@ _snwprintf
|
|||
; _spawnvp
|
||||
; _spawnvpe
|
||||
_splitpath
|
||||
; _stat
|
||||
_stat
|
||||
; _stati64
|
||||
; _statusfp
|
||||
_strcmpi
|
||||
|
@ -475,7 +475,7 @@ _sys_errlist DATA
|
|||
_sys_nerr DATA
|
||||
; _tell
|
||||
; _telli64
|
||||
; _tempnam
|
||||
_tempnam
|
||||
; _timezone
|
||||
_tolower
|
||||
_toupper
|
||||
|
@ -493,7 +493,7 @@ _unloaddll
|
|||
; _utime
|
||||
_vsnprintf
|
||||
_vsnwprintf
|
||||
; _waccess
|
||||
_waccess
|
||||
; _wasctime
|
||||
_wchdir
|
||||
; _wchmod
|
||||
|
@ -540,7 +540,7 @@ _wmkdir
|
|||
; _wmktemp
|
||||
_wopen
|
||||
; _wperror
|
||||
; _wpgmptr
|
||||
; _wpgmptr DATA
|
||||
; _wpopen
|
||||
_wputenv
|
||||
_wremove
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#include <crtdll/stdio.h>
|
||||
|
||||
#if 0
|
||||
#undef fileno
|
||||
int fileno(FILE *f)
|
||||
{
|
||||
return f->_file;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int _fileno(FILE *f)
|
||||
{
|
||||
|
|
|
@ -4,10 +4,13 @@
|
|||
#include <crtdll/stdio.h>
|
||||
#include <crtdll/io.h>
|
||||
#include <crtdll/fcntl.h>
|
||||
#include <crtdll/internal/file.h>
|
||||
//#include <crtdll/internal/file.h>
|
||||
|
||||
//might change fopen(file,mode) -> fsopen(file,mode,_SH_DENYNO);
|
||||
|
||||
#undef _fmode
|
||||
extern unsigned int _fmode;
|
||||
|
||||
FILE * __alloc_file(void);
|
||||
|
||||
|
||||
|
|
21
reactos/lib/msvcrt/stdio/tempnam.c
Normal file
21
reactos/lib/msvcrt/stdio/tempnam.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <windows.h>
|
||||
#include <crtdll/stdio.h>
|
||||
#include <crtdll/stdlib.h>
|
||||
|
||||
|
||||
char *_tempnam(const char *dir,const char *prefix )
|
||||
{
|
||||
char *TempFileName = malloc(MAX_PATH);
|
||||
char *d;
|
||||
if ( dir == NULL )
|
||||
d = getenv("TMP");
|
||||
else
|
||||
d = (char *)dir;
|
||||
|
||||
if ( GetTempFileNameA(d, prefix, 0, TempFileName ) == 0 ) {
|
||||
free(TempFileName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return TempFileName;
|
||||
}
|
17
reactos/lib/msvcrt/sys_stat/stat.c
Normal file
17
reactos/lib/msvcrt/sys_stat/stat.c
Normal file
|
@ -0,0 +1,17 @@
|
|||
#include <crtdll/sys/types.h>
|
||||
#include <crtdll/sys/stat.h>
|
||||
#include <crtdll/fcntl.h>
|
||||
#include <crtdll/io.h>
|
||||
|
||||
|
||||
int _stat( const char *path, struct stat *buffer )
|
||||
{
|
||||
int fd = _open(path,_O_RDONLY);
|
||||
int ret;
|
||||
|
||||
ret = fstat(fd,buffer);
|
||||
_close(fd);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
Loading…
Reference in a new issue