diff options
author | Matt Caswell <matt@openssl.org> | 2015-07-24 08:15:31 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-11-20 23:33:46 +0000 |
commit | f4da39d200a8c2068595b8d5bd5efb78af4224e1 (patch) | |
tree | eb329d8d472063fc60ba93c76a83af7d3217b602 /crypto/async/arch/async_posix.c | |
parent | 252d6d3aa62dccf0dc826644b7da0b6bafa3831b (diff) | |
download | openssl-f4da39d200a8c2068595b8d5bd5efb78af4224e1.zip openssl-f4da39d200a8c2068595b8d5bd5efb78af4224e1.tar.gz openssl-f4da39d200a8c2068595b8d5bd5efb78af4224e1.tar.bz2 |
Initial Async notify code changes
Initial API implemented for notifying applications that an ASYNC_JOB
has completed. Currently only s_server is using this. The Dummy Async
engine "cheats" in that it notifies that it has completed *before* it
pauses the job. A normal async engine would not do that.
Only the posix version of this has been implemented so far, so it will
probably fail to compile on Windows at the moment.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/async/arch/async_posix.c')
-rw-r--r-- | crypto/async/arch/async_posix.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crypto/async/arch/async_posix.c b/crypto/async/arch/async_posix.c index bb799e5..8474ea4 100644 --- a/crypto/async/arch/async_posix.c +++ b/crypto/async/arch/async_posix.c @@ -57,6 +57,7 @@ #ifdef ASYNC_SYSV # include <stddef.h> # include <ucontext.h> +# include <unistd.h> # include <openssl/crypto.h> # include <openssl/async.h> @@ -85,4 +86,29 @@ void ASYNC_FIBRE_free(ASYNC_FIBRE *fibre) if (fibre->fibre.uc_stack.ss_sp) OPENSSL_free(fibre->fibre.uc_stack.ss_sp); } + +int async_pipe(int *pipefds) +{ + if (pipe(pipefds) == 0) + return 1; + + return 0; +} + +int async_write1(int fd, const void *buf) +{ + if (write(fd, buf, 1) > 0) + return 1; + + return 0; +} + +int async_read1(int fd, void *buf) +{ + if (read(fd, buf, 1) > 0) + return 1; + + return 0; +} + #endif |