diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-11-02 13:45:49 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2012-11-05 17:13:39 +0100 |
commit | e42889f83f261e2ac34014649476fae638a6e1f2 (patch) | |
tree | ef8bb82176ed890b5d2c976e3f10b4441742c0a5 /lib/tsocket/tsocket.h | |
parent | 71e1c080cbd033b3118952c2da05186252fc411a (diff) | |
download | samba-e42889f83f261e2ac34014649476fae638a6e1f2.tar.gz samba-e42889f83f261e2ac34014649476fae638a6e1f2.tar.xz samba-e42889f83f261e2ac34014649476fae638a6e1f2.zip |
lib/tsocket: disable the syscall optimization for recvfrom/readv by default
We only do the optimization on recvfrom/readv if the caller asked for it.
This is needed because in most cases we preferr to flush send
buffers before receiving incoming requests.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/tsocket/tsocket.h')
-rw-r--r-- | lib/tsocket/tsocket.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/tsocket/tsocket.h b/lib/tsocket/tsocket.h index 3aca5361241..98f864e6a57 100644 --- a/lib/tsocket/tsocket.h +++ b/lib/tsocket/tsocket.h @@ -627,6 +627,27 @@ int _tsocket_address_unix_from_path(TALLOC_CTX *mem_ctx, char *tsocket_address_unix_path(const struct tsocket_address *addr, TALLOC_CTX *mem_ctx); +/** + * @brief Request a syscall optimization for tdgram_recvfrom_send() + * + * This function is only used to reduce the amount of syscalls and + * optimize performance. You should only use this if you know + * what you're doing. + * + * The optimization is off by default. + * + * @param[in] dgram The tdgram_context of a bsd socket, if this + * not a bsd socket the function does nothing. + * + * @param[in] on The boolean value to turn the optimization on and off. + * + * @return The old boolean value. + * + * @see tdgram_recvfrom_send() + */ +bool tdgram_bsd_optimize_recvfrom(struct tdgram_context *dgram, + bool on); + #ifdef DOXYGEN /** * @brief Create a tdgram_context for a ipv4 or ipv6 UDP communication. @@ -689,6 +710,27 @@ int _tdgram_unix_socket(const struct tsocket_address *local, #endif /** + * @brief Request a syscall optimization for tstream_readv_send() + * + * This function is only used to reduce the amount of syscalls and + * optimize performance. You should only use this if you know + * what you're doing. + * + * The optimization is off by default. + * + * @param[in] stream The tstream_context of a bsd socket, if this + * not a bsd socket the function does nothing. + * + * @param[in] on The boolean value to turn the optimization on and off. + * + * @return The old boolean value. + * + * @see tstream_readv_send() + */ +bool tstream_bsd_optimize_readv(struct tstream_context *stream, + bool on); + +/** * @brief Connect async to a TCP endpoint and create a tstream_context for the * stream based communication. * |