diff options
author | Werner Koch <wk@gnupg.org> | 2015-09-25 10:45:22 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2015-09-25 11:32:07 +0200 |
commit | 071c2170479869f4c6694ae85d2b113e84482a01 (patch) | |
tree | 00f0ef082a9c2f26b6ee0e26b37c0828d2886f26 /src/visibility.h | |
parent | 61d832c53b7db5367a5542347e3454c882d0bf28 (diff) | |
download | libgpg-error-071c2170479869f4c6694ae85d2b113e84482a01.tar.gz |
estream: Add gpgrt_set_nonblock and gpgrt_poll.
* configure.ac (AC_CHECK_HEADERS): Add sys/select.h and sys/time.h.
* src/estream.c: Include both header if available.
(COOKIE_IOCTL_NONBLOCK): New.
(struct estream_cookie_fd): Add field nonblock.
(func_fd_create): Set nonblock from MODEFLAGS.
(es_func_fd_ioctl): New.
(parse_mode): Add modeflag "nonblock".
(es_fill): Map EWOULDBLOCK to EAGAIN. Do not set error indicator for
EAGAIN.
(es_flush, es_seek, es_write_nbf): Map EWOULDBLOCK to EAGAIN.
(do_fdopen): Call COOKIE_IOCTL_NONBLOCK.
(_gpgrt_set_nonblock): New.
(_gpgrt_get_nonblock): New.
(_gpgrt_poll): New.
* src/gpg-error.h.in (struct _gpgrt_poll_s): New.
(gpgrt_poll_t, es_poll_t): New.
(es_set_nonblock, es_get_nonblock, es_poll): New.
* src/gpg-error.vers, src/gpg-error.def.in: Add gpgrt_set_nonblock,
gpgrt_get_nonblock, and gpgrt_poll.
* src/visibility.c (gpgrt_set_nonblock, gpgrt_get_nonblock): New.
(gpgrt_poll): New.
* tests/t-common.h (DIM): New.
* tests/t-poll.c: New.
* tests/Makefile.am (TESTS): Add t-poll.
(t_poll_LDADD): New.
--
The poll interface uses select(2) internally because that is more
portable than poll(2).
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'src/visibility.h')
-rw-r--r-- | src/visibility.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/visibility.h b/src/visibility.h index 6f7de84..ec3a124 100644 --- a/src/visibility.h +++ b/src/visibility.h @@ -127,6 +127,9 @@ MARK_VISIBLE (gpgrt_vfprintf_unlocked) MARK_VISIBLE (gpgrt_setvbuf) MARK_VISIBLE (gpgrt_setbuf) MARK_VISIBLE (gpgrt_set_binary) +MARK_VISIBLE (gpgrt_set_nonblock) +MARK_VISIBLE (gpgrt_get_nonblock) +MARK_VISIBLE (gpgrt_poll) MARK_VISIBLE (gpgrt_tmpfile) MARK_VISIBLE (gpgrt_opaque_set) MARK_VISIBLE (gpgrt_opaque_get) @@ -232,6 +235,9 @@ MARK_VISIBLE (gpgrt_set_alloc_func) #define gpgrt_setvbuf _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_setbuf _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_set_binary _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_set_nonblock _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_get_nonblock _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_poll _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_tmpfile _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_opaque_set _gpgrt_USE_UNDERSCORED_FUNCTION #define gpgrt_opaque_get _gpgrt_USE_UNDERSCORED_FUNCTION |