diff options
author | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-29 20:04:05 +0000 |
---|---|---|
committer | luther <luther@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-08-29 20:04:05 +0000 |
commit | f3bcb51e8e17ad5628d7e0f5b7307ae3dee15b96 (patch) | |
tree | b9656e12bd9cefffbd90415f0cc7fbe53ae903d4 | |
parent | ec8e9893969874f3175dba5a7eb6b98b4d9abbd1 (diff) | |
download | ATCD-f3bcb51e8e17ad5628d7e0f5b7307ae3dee15b96.tar.gz |
Tue Aug 29 14:57:04 2000 Luther J Baker <luther@cs.wustl.edu>
-rw-r--r-- | PACE/ChangeLog | 6 | ||||
-rw-r--r-- | PACE/pace/win32/stat.h | 2 | ||||
-rw-r--r-- | PACE/pace/win32/stat.inl | 19 |
3 files changed, 21 insertions, 6 deletions
diff --git a/PACE/ChangeLog b/PACE/ChangeLog index fde37b73a3c..f534fde0966 100644 --- a/PACE/ChangeLog +++ b/PACE/ChangeLog @@ -1,3 +1,9 @@ +Tue Aug 29 14:57:04 2000 Luther J Baker <luther@cs.wustl.edu> + + * pace/win32/stat.inl (pace_stat): + + Implemented pace_fstat and pace_stat. + Tue Aug 29 14:14:45 2000 Luther J Baker <luther@cs.wustl.edu> * pace/stat.h (pace_fstat): diff --git a/PACE/pace/win32/stat.h b/PACE/pace/win32/stat.h index 85e5a65aeca..e05363468ad 100644 --- a/PACE/pace/win32/stat.h +++ b/PACE/pace/win32/stat.h @@ -51,7 +51,7 @@ extern "C" { #ifndef PACE_STAT #define PACE_STAT - typedef struct _stat pace_stat_s; + typedef struct stat pace_stat_s; #endif /* PACE_STAT */ #if (PACE_HAS_POSIX_FS_UOF) diff --git a/PACE/pace/win32/stat.inl b/PACE/pace/win32/stat.inl index 6a87faf13c5..94138bcfb71 100644 --- a/PACE/pace/win32/stat.inl +++ b/PACE/pace/win32/stat.inl @@ -40,10 +40,19 @@ PACE_INLINE int pace_fstat (PACE_HANDLE fildes, pace_stat_s * buf) { - PACE_UNUSED_ARG (fildes); - PACE_UNUSED_ARG (buf); - PACE_ERRNO_NO_SUPPORT_RETURN (-1); - /* return _fstat (fildes, buf); */ + /* There are two impl in ACE. This is the simpler. But requires + * you to close the temporary file desc. */ + int retval = -1; + int fd = _open_osfhandle ((long) fildes, 0); + if (fd != -1) + { + retval = ::_fstat (fd, (struct _stat *) stp); + } + + _close (fd); + + /* Remember to close the file handle. */ + return retval; } #endif /* PACE_HAS_POSIX_FS_UOF */ @@ -72,7 +81,7 @@ PACE_INLINE int pace_stat (const char * path, pace_stat_s * buf) { - return _stat (path, buf); + return _stat (path, (struct _stat *)buf); } #endif /* PACE_HAS_POSIX_FS_UOF */ |