]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - sched.h
sched: Introduce sched_{read,write}_ok().
[paraslash.git] / sched.h
diff --git a/sched.h b/sched.h
index 4695da05040d1934e0c23a12db9bb14c7e9f799c..e0ca0c011bb0d4838a4071098e4c172403fac015 100644 (file)
--- a/sched.h
+++ b/sched.h
@@ -80,3 +80,13 @@ void sched_request_timeout(struct timeval *to, struct sched *s);
 void sched_request_timeout_ms(long unsigned ms, struct sched *s);
 int sched_request_barrier(struct timeval *barrier, struct sched *s);
 int sched_request_barrier_or_min_delay(struct timeval *barrier, struct sched *s);
+
+static inline bool sched_read_ok(int fd, const struct sched *s)
+{
+       return FD_ISSET(fd, &s->rfds);
+}
+
+static inline bool sched_write_ok(int fd, const struct sched *s)
+{
+       return FD_ISSET(fd, &s->wfds);
+}