From: Christopher Faulet Date: Wed, 30 Aug 2017 07:59:38 +0000 (+0200) Subject: MINOR: fd: Add fd_active function X-Git-Tag: v1.8-dev3~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8db2fdfabaada02eabc92193b951d1821e49c1ba;p=thirdparty%2Fhaproxy.git MINOR: fd: Add fd_active function This inlined function is used to check if a fd is active for receive or send. It will ease threads support integration. --- diff --git a/include/proto/fd.h b/include/proto/fd.h index 38c12b687e..526f895950 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -241,6 +241,14 @@ static inline int fd_send_polled(const int fd) return (unsigned)fdtab[fd].state & FD_EV_POLLED_W; } +/* + * returns true if the FD is active for recv or send + */ +static inline int fd_active(const int fd) +{ + return (unsigned)fdtab[fd].state & FD_EV_ACTIVE_RW; +} + /* Disable processing recv events on fd */ static inline void fd_stop_recv(int fd) {