diff options
author | joeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-13 19:04:36 +0000 |
---|---|---|
committer | joeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-03-13 19:04:36 +0000 |
commit | cccad3876498a177255dea1b8016e1d985af20e5 (patch) | |
tree | b77f95d39300d62e7c4b1769af3a897ddf99815b /PACE | |
parent | 34e74fcd7745ba34dbe55a4b75b09beb6226ea79 (diff) | |
download | ATCD-cccad3876498a177255dea1b8016e1d985af20e5.tar.gz |
Tue Mar 13 12:58:09 2001 Joe Hoffert <joeh@cs.wustl.edu>
Diffstat (limited to 'PACE')
-rw-r--r-- | PACE/ChangeLog | 19 | ||||
-rw-r--r-- | PACE/pace/win32/setjmp.inl | 20 | ||||
-rw-r--r-- | PACE/pace/win32/stdio.c | 31 | ||||
-rw-r--r-- | PACE/pace/win32/time.inl | 2 | ||||
-rw-r--r-- | PACE/pace/win32/unistd.c | 19 | ||||
-rw-r--r-- | PACE/pace/win32/unistd.inl | 5 |
6 files changed, 70 insertions, 26 deletions
diff --git a/PACE/ChangeLog b/PACE/ChangeLog index 375b1a9302b..1f13dc31ef0 100644 --- a/PACE/ChangeLog +++ b/PACE/ChangeLog @@ -1,3 +1,22 @@ +Tue Mar 13 12:58:09 2001 Joe Hoffert <joeh@cs.wustl.edu> + + * pace/win32/setjmp.inl: + Removed function calls to setjmp and sigsetjmp since + these are now macros. + + * pace/win32/stdio.c: + Adding pace_win32_fseek function to support pace_fseek. + + * pace/win32/time.inl: + Adding support for tzset for Windows. + + * pace/win32/unistd.c: + Adding call to pace_win32_read function and cleaned up + pace_write code. + + * pace/win32/unistd.inl: + Adding pace_win32_read function to support pace_read. + Wed Feb 28 15:04:41 2001 Joe Hoffert <joeh@cs.wustl.edu> * pace/posix/string.inl (pace_strtok_r): diff --git a/PACE/pace/win32/setjmp.inl b/PACE/pace/win32/setjmp.inl index 974cb96c141..d3be714dfd4 100644 --- a/PACE/pace/win32/setjmp.inl +++ b/PACE/pace/win32/setjmp.inl @@ -15,26 +15,6 @@ #if (PACE_HAS_POSIX_CLS_UOF) PACE_INLINE -int -pace_setjmp (pace_jmp_buf env) -{ - return setjmp (env); -} -#endif /* PACE_HAS_POSIX_CLS_UOF */ - -#if (PACE_HAS_POSIX_SIG_UOF) -PACE_INLINE -int -pace_sigsetjmp (pace_sigjmp_buf env, int savemask) -{ - PACE_UNUSED_ARG (env); - PACE_UNUSED_ARG (savemask); - PACE_ERRNO_NO_SUPPORT_RETURN (-1); -} -#endif /* PACE_HAS_POSIX_SIG_UOF */ - -#if (PACE_HAS_POSIX_CLS_UOF) -PACE_INLINE void pace_longjmp (pace_jmp_buf env, int val) { diff --git a/PACE/pace/win32/stdio.c b/PACE/pace/win32/stdio.c index ff45c694a56..17aecda89ed 100644 --- a/PACE/pace/win32/stdio.c +++ b/PACE/pace/win32/stdio.c @@ -18,3 +18,34 @@ #if !defined (PACE_HAS_INLINE) # include "pace/win32/stdio.inl" #endif /* ! PACE_HAS_INLINE */ + + +#if (PACE_HAS_POSIX_FM_UOF) +int +pace_win32_fseek (FILE * stream, long offset, int whence) +{ +# if SEEK_SET != FILE_BEGIN \ + || SEEK_CUR != FILE_CURRENT \ + || SEEK_END != FILE_END + //#error Windows NT is evil AND rude! + switch (whence) + { + case SEEK_SET: + whence = FILE_BEGIN; + break; + case SEEK_CUR: + whence = FILE_CURRENT; + break; + case SEEK_END: + whence = FILE_END; + break; + default: + errno = EINVAL; + return -1; // rather safe than sorry + } +# endif /* SEEK_SET != FILE_BEGIN + || SEEK_CUR != FILE_CURRENT + || SEEK_END != FILE_END */ + PACE_OSCALL_RETURN (::fseek (stream, offset, whence), int, -1); +} +#endif /* PACE_HAS_POSIX_FM_UOF */ diff --git a/PACE/pace/win32/time.inl b/PACE/pace/win32/time.inl index cb2df7e7db4..7b0f2ba079f 100644 --- a/PACE/pace/win32/time.inl +++ b/PACE/pace/win32/time.inl @@ -259,7 +259,7 @@ PACE_INLINE void pace_tzset () { - PACE_ERRNO_NO_SUPPORT (); + ::_tzset (); return; } #endif /* PACE_HAS_POSIX_CLS_UOF */ diff --git a/PACE/pace/win32/unistd.c b/PACE/pace/win32/unistd.c index e2c9aaab55c..0fbc4c2f6cf 100644 --- a/PACE/pace/win32/unistd.c +++ b/PACE/pace/win32/unistd.c @@ -117,7 +117,7 @@ pace_win32_write (PACE_HANDLE fildes, const void * buf, size_t nbyte) { DWORD bytes_written; /* This is set to 0 byte WriteFile. */ - if (WriteFile (fildes, buf, nbyte, &bytes_written, 0)) + if (::WriteFile (fildes, buf, nbyte, &bytes_written, 0)) { return (pace_ssize_t) bytes_written; } @@ -127,3 +127,20 @@ pace_win32_write (PACE_HANDLE fildes, const void * buf, size_t nbyte) } } #endif /* PACE_HAS_POSIX_DI_UOF */ + +#if (PACE_HAS_POSIX_DI_UOF) +pace_ssize_t +pace_win32_read (PACE_HANDLE fildes, const void * buf, size_t nbyte) +{ + DWORD ok_len; + + if (::ReadFile (handle, buf, len, &ok_len, 0)) + { + return (ssize_t) ok_len; + } + else + { + PACE_FAIL_RETURN (-1); + } +} +#endif /* PACE_HAS_POSIX_DI_UOF */ diff --git a/PACE/pace/win32/unistd.inl b/PACE/pace/win32/unistd.inl index bccc6bb6f48..79948c658a6 100644 --- a/PACE/pace/win32/unistd.inl +++ b/PACE/pace/win32/unistd.inl @@ -373,10 +373,7 @@ PACE_INLINE pace_ssize_t pace_read (PACE_HANDLE fildes, void * buf, size_t nbyte) { - PACE_UNUSED_ARG (fildes); - PACE_UNUSED_ARG (buf); - PACE_UNUSED_ARG (nbyte); - PACE_ERRNO_NO_SUPPORT_RETURN (-1); + return pace_win32_read (fildes, buf, nbyte); } #endif /* PACE_HAS_POSIX_DI_UOF */ |