diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2006-04-09 03:56:18 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2006-04-09 03:56:18 +0000 |
commit | d434bb6ec9ec6eb99ccd7d112bcf4e9e9232f252 (patch) | |
tree | 5368739370889b4c3f51dd39316cfa0299883ae9 /file_io | |
parent | 11ec838d5926717bfb804efb0f0fe49d79b3e6e8 (diff) | |
download | libapr-d434bb6ec9ec6eb99ccd7d112bcf4e9e9232f252.tar.gz |
Backport implementations for apr_os_pipe_put[_ex]
and ENOTIMPL stub for apr_file_namedpipe_create.
Backports: 392653, 392669
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x@392673 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r-- | file_io/win32/pipe.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/file_io/win32/pipe.c b/file_io/win32/pipe.c index 4fd3a7187..97ba9e79a 100644 --- a/file_io/win32/pipe.c +++ b/file_io/win32/pipe.c @@ -178,3 +178,51 @@ apr_status_t apr_create_nt_pipe(apr_file_t **in, apr_file_t **out, return APR_SUCCESS; #endif /* _WIN32_WCE */ } + + +APR_DECLARE(apr_status_t) apr_file_namedpipe_create(const char *filename, + apr_fileperms_t perm, + apr_pool_t *pool) +{ + /* Not yet implemented, interface not suitable. + * Win32 requires the named pipe to be *opened* at the time it's + * created, and to do so, blocking or non blocking must be elected. + */ + return APR_ENOTIMPL; +} + + +/* XXX: Problem; we need to choose between blocking and nonblocking based + * on how *thefile was opened, and we don't have that information :-/ + * Hack; assume a blocking socket, since the most common use for the fn + * would be to handle stdio-style or blocking pipes. Win32 doesn't have + * select() blocking for pipes anyways :( + */ +APR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file, + apr_os_file_t *thefile, + int register_cleanup, + apr_pool_t *pool) +{ + (*file) = apr_pcalloc(pool, sizeof(apr_file_t)); + (*file)->pool = pool; + (*file)->pipe = 1; + (*file)->timeout = -1; + (*file)->ungetchar = -1; + (*file)->filehand = *thefile; + (void) apr_pollset_create(&(*file)->pollset, 1, pool, 0); + + if (register_cleanup) { + apr_pool_cleanup_register(pool, *file, file_cleanup, + apr_pool_cleanup_null); + } + + return APR_SUCCESS; +} + + +APR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file, + apr_os_file_t *thefile, + apr_pool_t *pool) +{ + return apr_os_pipe_put_ex(file, thefile, 0, pool); +} |