diff options
author | Willy Tarreau <w@1wt.eu> | 2022-02-13 09:52:10 +0100 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2022-04-20 17:05:43 -0700 |
commit | 8cb98b3fce152e8ba46d1e25515deab08d7ec271 (patch) | |
tree | 635d020e39f736057d10f5fad9991e68a91e173d /tools/include/nolibc/nolibc.h | |
parent | tools/nolibc/ctype: add the missing is* functions (diff) | |
download | linux-stable-8cb98b3fce152e8ba46d1e25515deab08d7ec271.tar.xz linux-stable-8cb98b3fce152e8ba46d1e25515deab08d7ec271.zip |
tools/nolibc/types: move the FD_* functions to macros in types.h
FD_SET, FD_CLR, FD_ISSET, FD_ZERO are often expected to be macros and
not functions. In addition we already have a file dedicated to such
macros and types used by syscalls, it's types.h, so let's move them
there and turn them to macros. FD_CLR() and FD_ISSET() were missing,
so they were added. FD_ZERO() now deals with its own loop so that it
doesn't rely on memset() that sets one byte at a time.
Cc: David Laight <David.Laight@aculab.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include/nolibc/nolibc.h')
-rw-r--r-- | tools/include/nolibc/nolibc.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/tools/include/nolibc/nolibc.h b/tools/include/nolibc/nolibc.h index c96c6cb7f3ae..2267d98337ea 100644 --- a/tools/include/nolibc/nolibc.h +++ b/tools/include/nolibc/nolibc.h @@ -118,20 +118,6 @@ const char *ltoa(long in) /* Here come a few helper functions */ -static __attribute__((unused)) -void FD_ZERO(fd_set *set) -{ - memset(set, 0, sizeof(*set)); -} - -static __attribute__((unused)) -void FD_SET(int fd, fd_set *set) -{ - if (fd < 0 || fd >= FD_SETSIZE) - return; - set->fd32[fd / 32] |= 1 << (fd & 31); -} - /* WARNING, it only deals with the 4096 first majors and 256 first minors */ static __attribute__((unused)) dev_t makedev(unsigned int major, unsigned int minor) |