Diffstat (limited to 'mcon/U/d_devpoll.U')
1 files changed, 52 insertions, 0 deletions
diff --git a/mcon/U/d_devpoll.U b/mcon/U/d_devpoll.U
new file mode 100644
@@ -0,0 +1,52 @@
+?RCS: $Id: d_devpoll.U 167 2013-05-08 17:58:00Z rmanfredi $
+?RCS: Copyright (c) 2006, Christian Biere
+?RCS: You may redistribute only under the terms of the Artistic License,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic License; a copy of which may be found at the root
+?RCS: of the source tree for dist 4.0.
+?MAKE:d_dev_poll: Trylink cat
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the HAS_DEV_POLL symbol, which
+?S: indicates to the C program that /dev/poll support is available.
+?C: This symbol is defined when /dev/poll can be used.
+?LINT: set d_dev_poll
+: can we use /dev/poll?
+$cat >try.c <<EOC
+ static struct pollfd pfd;
+ static struct dvpoll dvp;
+ static int ret;
+ pfd.fd |= 1;
+ pfd.events |= POLLIN;
+ pfd.events |= POLLPRI;
+ pfd.events |= POLLOUT;
+ pfd.events |= POLLHUP;
+ pfd.events |= POLLERR;
+ pfd.events |= POLLNVAL;
+ pfd.events |= POLLREMOVE;
+ pfd.revents |= 1;
+ dvp.dp_timeout |= 1;
+ dvp.dp_nfds |= 1;
+ dvp.dp_fds = &pfd;
+ ret |= ioctl(1, DP_POLL, &dvp);
+ return 0 != ret;
+cyn="whether /dev/poll can be used"