diff options
author | pjd <pjd@FreeBSD.org> | 2011-02-02 15:46:28 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-02-02 15:46:28 +0000 |
commit | 1267c20f911e08de277a22060d9bc42148f9afc0 (patch) | |
tree | 14572a6733b1467ecd161cefb488eb923dad681b /sbin/hastd/proto_impl.h | |
parent | 3acb629cd228ce6366df06b502aea7ca95055b91 (diff) | |
download | FreeBSD-src-1267c20f911e08de277a22060d9bc42148f9afc0.zip FreeBSD-src-1267c20f911e08de277a22060d9bc42148f9afc0.tar.gz |
Add proto_connect_wait() to wait for connection to finish.
If timeout argument to proto_connect() is -1, then the caller needs to use
this new function to wait for connection.
This change is in preparation for capsicum, where sandboxed worker wants
to ask main process to connect in worker's behalf and pass descriptor
to the worker. Because we don't want the main process to wait for the
connection, it will start async connection and pass descriptor to the
worker who will be responsible for waiting for the connection to finish.
MFC after: 1 week
Diffstat (limited to 'sbin/hastd/proto_impl.h')
-rw-r--r-- | sbin/hastd/proto_impl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/hastd/proto_impl.h b/sbin/hastd/proto_impl.h index 93dcd99..0168640 100644 --- a/sbin/hastd/proto_impl.h +++ b/sbin/hastd/proto_impl.h @@ -41,6 +41,7 @@ typedef int hp_client_t(const char *, void **); typedef int hp_connect_t(void *, int); +typedef int hp_connect_wait_t(void *, int); typedef int hp_server_t(const char *, void **); typedef int hp_accept_t(void *, void **); typedef int hp_send_t(void *, const unsigned char *, size_t); @@ -57,6 +58,7 @@ struct hast_proto { const char *hp_name; hp_client_t *hp_client; hp_connect_t *hp_connect; + hp_connect_wait_t *hp_connect_wait; hp_server_t *hp_server; hp_accept_t *hp_accept; hp_send_t *hp_send; |