ReactOS 0.4.16-dev-258-g81860b4
futime.c File Reference
#include <precomp.h>
#include <time.h>
#include <sys/utime.h>
#include "bitsfixup.h"
#include <internal/wine/msvcrt.h>
Include dependency graph for futime.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RC_INVOKED   1
 

Functions

ioinfoget_ioinfo (int fd)
 
void release_ioinfo (ioinfo *info)
 
int _futime (int fd, struct _utimbuf *filetime)
 

Macro Definition Documentation

◆ RC_INVOKED

#define RC_INVOKED   1

Definition at line 38 of file futime.c.

Function Documentation

◆ _futime()

int _futime ( int  fd,
struct _utimbuf filetime 
)

Definition at line 55 of file futime.c.

56{
58 FILETIME at, wt;
59
60 if (info->handle == INVALID_HANDLE_VALUE)
61 {
63 return -1;
64 }
65
66 if (!filetime)
67 {
68 time_t currTime;
69 _time(&currTime);
71 (LARGE_INTEGER *)&at);
72 wt = at;
73 }
74 else
75 {
77 (LARGE_INTEGER *)&at);
78 if (filetime->actime == filetime->modtime)
79 {
80 wt = at;
81 }
82 else
83 {
85 (LARGE_INTEGER *)&wt);
86 }
87 }
88
89 if (!SetFileTime(info->handle, NULL, &at, &wt))
90 {
93 return -1 ;
94 }
96 return 0;
97}
#define _time
Definition: bitsfixup.h:16
#define NULL
Definition: types.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI SetFileTime(IN HANDLE hFile, CONST FILETIME *lpCreationTime OPTIONAL, CONST FILETIME *lpLastAccessTime OPTIONAL, CONST FILETIME *lpLastWriteTime OPTIONAL)
Definition: fileinfo.c:948
__kernel_time_t time_t
Definition: linux.h:252
ioinfo * get_ioinfo(int fd)
Definition: file.c:181
void release_ioinfo(ioinfo *info)
Definition: file.c:263
NTSYSAPI VOID NTAPI RtlSecondsSince1970ToTime(_In_ ULONG SecondsSince1970, _Out_ PLARGE_INTEGER Time)
void _dosmaperr(unsigned long oserrcode)
Definition: errno.c:79
static int fd
Definition: io.c:51
Definition: file.c:40
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ get_ioinfo()

ioinfo * get_ioinfo ( int  fd)

Definition at line 181 of file file.c.

182{
184 if(ret == &__badioinfo)
185 return ret;
188 return ret;
189}
static void init_ioinfo_cs(ioinfo *info)
Definition: file.c:169
static ioinfo * get_ioinfo_nolock(int fd)
Definition: file.c:158
ioinfo __badioinfo
Definition: file.c:126
int ret
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by _chsize_s(), _close(), _commit(), _dup2(), _eof(), _futime(), _locking(), _lseeki64(), _read(), _setmode(), _write(), get_ioinfo_alloc_fd(), and msvcrt_free_fd().

◆ release_ioinfo()

void release_ioinfo ( ioinfo info)

Definition at line 263 of file file.c.

264{
265 if(info!=&__badioinfo && info->exflag & EF_CRIT_INIT)
267}
#define EF_CRIT_INIT
Definition: file.c:105
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by _chsize_s(), _close(), _commit(), _dup(), _dup2(), _eof(), _futime(), _locking(), _lseeki64(), _read(), _setmode(), _write(), msvcrt_alloc_fd(), msvcrt_free_fd(), and msvcrt_init_io().