diff options
Diffstat (limited to 'PACE/pace')
-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 |
5 files changed, 51 insertions, 26 deletions
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 */ |