diff options
author | Brian Havard <bjh@apache.org> | 2010-04-12 18:10:48 +0000 |
---|---|---|
committer | Brian Havard <bjh@apache.org> | 2010-04-12 18:10:48 +0000 |
commit | 3ae1c245c4593e92f953b1ad0d44793567281049 (patch) | |
tree | aa98974e81186474ae15001a84d779c601e12e4a /file_io/os2/readwrite.c | |
parent | 2477f7e99d2ffc39f2ff2d47dbd02fec6db8bbc2 (diff) | |
download | apr-3ae1c245c4593e92f953b1ad0d44793567281049.tar.gz apr-3ae1c245c4593e92f953b1ad0d44793567281049.zip |
Hide apr_wait_for_io_or_timeout() from public view and add instead
apr_socket_wait() and apr_file_pipe_wait().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@933338 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/os2/readwrite.c')
-rw-r--r-- | file_io/os2/readwrite.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c index 381c26b62..6eb59fcc0 100644 --- a/file_io/os2/readwrite.c +++ b/file_io/os2/readwrite.c @@ -409,6 +409,31 @@ apr_status_t apr_file_check_read(apr_file_t *fd) +APR_DECLARE(apr_status_t) apr_file_pipe_wait(apr_file_t *pipe, apr_wait_type_t direction) +{ + int rc; + + if (!pipe->pipe) { + /* No support for waiting on a regular file */ + return APR_ENOTIMPL; + } + + if (((pipe->flags & APR_FOPEN_READ) > 0) != (direction == APR_WAIT_READ)) { + /* Attempt to wait for read from the write end of the pipe or vica versa */ + return APR_EINVAL; + } + + rc = DosWaitEventSem(pipe->pipeSem, pipe->timeout >= 0 ? pipe->timeout / 1000 : SEM_INDEFINITE_WAIT); + + if (rc == ERROR_TIMEOUT) { + return APR_TIMEUP; + } + + return APR_FROM_OS_ERROR(rc); +} + + + APR_DECLARE(apr_status_t) apr_file_rotating_check(apr_file_t *thefile) { return APR_ENOTIMPL; |