X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=fd.c;h=4928850e38d7d01688702d8acb8e898da53e284d;hb=c430e588047c5db3eb0d043c4dd1378680ec2bcf;hp=f5d326c044d4e9b08aec613b25845a9e074aa3ea;hpb=7062b8a307355422f2c69b44b65f23eab17ce15d;p=paraslash.git diff --git a/fd.c b/fd.c index f5d326c0..4928850e 100644 --- a/fd.c +++ b/fd.c @@ -84,3 +84,18 @@ int mark_fd_nonblock(int fd) return 1; } +/** + * set a file descriptor in a fd_set + * + * \param fd the file descriptor to be set + * \param fds the file descriptor set + * \param max_fileno highest-numbered file descriptor + * + * This wrapper for FD_SET() passes its first two arguments to \p FD_SET. Upon + * return, \a max_fileno contains the maximum of the old_value and \a fd. +*/ +void para_fd_set(int fd, fd_set *fds, int *max_fileno) +{ + FD_SET(fd, fds); + *max_fileno = MAX(*max_fileno, fd); +}