Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* "Poll" system call broken?
@ 1998-08-04  2:05 brinkmann
  1998-08-05  7:37 ` Kurt Garloff
  1998-08-06 15:22 ` Erik Troan
  0 siblings, 2 replies; 3+ messages in thread
From: brinkmann @ 1998-08-04  2:05 UTC (permalink / raw)
  To: axp-list; +Cc: jb

I've been experimenting with the "poll" system call using the appended
test program.  It works well on our Solaris machines, but fails with an
"Operation not permitted" error on my Alpha running RH Linux 5.0, both
using stdin and file pointers.  The RH errata makes no mention of any
problems.  Can anyone be of assistance?

Jon
---
Dr. Jon Brinkmann				Apache Point Observatory
Instrument Scientist				2001 Apache Point Road
Internet:	brinkmann@nmsu.edu		P.O. Box 59
URL:	http://www.apo.nmsu.edu/brinkmann/	Sunspot, NM 88349-0059

-------------------8<--------------CUT HERE----------------8<-------------------

#include <stdio.h>
#include <poll.h>

main()
{
	struct pollfd fds[1];
	int n;
	char buffer[BUFSIZ];
/*
	FILE *fp;

	if (NULL == (fp = fopen ("poll_test.tmp", "rw"))) {
		perror ("fopen");
	}

	fds[0].fd = fileno (fp);
*/
	fds[0].fd = fileno (stdin);
	fds[0].events = POLLIN;

	while (1) {
		sleep (1);

		n = poll (fds, (unsigned long int) 1, 2000);
		if (-1 == n) perror ("poll");
		printf ("%d events = %X\trevents = %X\n",
			n, fds[0].events, fds[0].revents);

		if (POLLIN == fds[0].revents) {
			printf ("Found input event\n");
			fgets (buffer, BUFSIZ, stdin);
		}
	}
}


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-08-06 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-08-04  2:05 "Poll" system call broken? brinkmann
1998-08-05  7:37 ` Kurt Garloff
1998-08-06 15:22 ` Erik Troan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox