diff options
author | Manoj Srivastava <srivasta@golden-gryphon.com> | 2014-04-27 17:54:01 -0700 |
---|---|---|
committer | Manoj Srivastava <srivasta@golden-gryphon.com> | 2014-04-27 17:54:01 -0700 |
commit | 8f5e5726134ce5b4bd436b16f367796d851df553 (patch) | |
tree | 0ce2ad130721dcf917d7f81fb8495bf0a189d266 /mcon/U/d_devpoll.U | |
parent | 02bf7be6fc0f798790ef5b2160bc89a77b909428 (diff) |
Imported Upstream version 3.5-36
Diffstat (limited to 'mcon/U/d_devpoll.U')
-rw-r--r-- | mcon/U/d_devpoll.U | 52 |
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 index 0000000..f5c1da5 --- /dev/null +++ b/mcon/U/d_devpoll.U @@ -0,0 +1,52 @@ +?RCS: $Id: d_devpoll.U 167 2013-05-08 17:58:00Z rmanfredi $ +?RCS: +?RCS: Copyright (c) 2006, Christian Biere +?RCS: +?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. +?RCS: +?MAKE:d_dev_poll: Trylink cat +?MAKE: -pick add $@ %< +?S:d_dev_poll: +?S: This variable conditionally defines the HAS_DEV_POLL symbol, which +?S: indicates to the C program that /dev/poll support is available. +?S:. +?C:HAS_DEV_POLL: +?C: This symbol is defined when /dev/poll can be used. +?C:. +?H:#$d_dev_poll HAS_DEV_POLL +?H:. +?LINT: set d_dev_poll +: can we use /dev/poll? +$cat >try.c <<EOC +#include <poll.h> +#include <stropts.h> +#include <sys/devpoll.h> +int main(void) +{ + 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; +} +EOC +cyn="whether /dev/poll can be used" +set d_dev_poll +eval $trylink + |