Linux MIPS Architecture development
 help / color / mirror / Atom feed
* SIGIO Handler
@ 2000-05-18 14:11 Guido Guenther
  2000-05-19 12:37 ` Ralf Baechle
  2000-05-22  2:32 ` Hiroyuki Machida
  0 siblings, 2 replies; 10+ messages in thread
From: Guido Guenther @ 2000-05-18 14:11 UTC (permalink / raw)
  To: linux-mips, linux

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

I'm still trying to get the mouse to work under X. The problem seems not
to be related to X itself but to a kernel/glibc problem. X uses a SIGIO
handler to "get notified" about mouse events. I wrote my own small SIGIO
handler(see attached program) which works fine on my intel box but not
on an indy (glibc-2.0.6-3lm/linux-2.2.13-20000211). Could please someone
else run the attached program on mips/mipsel and check if it works or
give me a hint where to start to look for the problem.
Regards,
 -- Guido

-- 
GPG-Public Key: http://honk.physik.uni-konstanz.de/~agx/guenther.gpg.asc

[-- Attachment #2: sigio.c --]
[-- Type: text/x-csrc, Size: 1105 bytes --]

# include <unistd.h>
# include <signal.h>
# include <fcntl.h>
# include <sys/time.h>
# include <errno.h>
# include <stdio.h>
# include <string.h>

static int fd = 0;
fd_set sig_mask;

static void
sigio_handler (int sig)
{
	int	    i;
	fd_set  ready;
	struct timeval  to;
	int	    r;

	ready = sig_mask;
	to.tv_sec = 0;
	to.tv_usec = 0;
	while(((r = select (fd+1, &ready, 0, 0, &to)) == -1) && (errno == EINTR));
	if (FD_ISSET (fd, &ready))
    		printf("SIGIO Handler for fd %d\n", fd);
}

main()
{
	struct sigaction sa;
	struct sigaction osa;

	printf("Installing SIGIO handler for fd: %d\n", fd);
	printf("Hitting return should call the SIGIO Handler\n");
	sigemptyset(&sa.sa_mask);
	sigaddset(&sa.sa_mask, SIGIO);
	sa.sa_flags   = 0;
	sa.sa_handler = sigio_handler;
	sigaction(SIGIO, &sa, &osa);

	FD_SET (fd, &sig_mask);
	if (fcntl(fd, F_SETOWN, getpid()) == -1) {
		printf("fcntl(%d, F_SETOWN): %s\n", fd, strerror(errno));
		return 1;
	}
	if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) {
		printf("fcntl(%d, O_ASYNC): %s\n", fd, strerror(errno));
		return 1;
	}
	while(1);
	return 0;
}

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

end of thread, other threads:[~2000-05-24 10:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-18 14:11 SIGIO Handler Guido Guenther
2000-05-19 12:37 ` Ralf Baechle
2000-05-22  2:32 ` Hiroyuki Machida
2000-05-22 11:31   ` Ralf Baechle
2000-05-22 13:30     ` Guido Guenther
2000-05-22 19:57       ` Ralf Baechle
2000-05-22 20:07         ` Guido Guenther
2000-05-22 20:13           ` Ralf Baechle
2000-05-24  9:57             ` Guido Guenther
2000-05-23  2:11         ` Ralf Baechle

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