From: Guido Guenther <agx@bert.physik.uni-konstanz.de>
To: linux-mips@fnet.fr, linux@cthulhu.engr.sgi.com
Subject: SIGIO Handler
Date: Thu, 18 May 2000 16:11:36 +0200 [thread overview]
Message-ID: <20000518161135.A26055@bert.physik.uni-konstanz.de> (raw)
[-- 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;
}
next reply other threads:[~2000-05-18 14:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-18 14:11 Guido Guenther [this message]
2000-05-19 12:37 ` SIGIO Handler 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20000518161135.A26055@bert.physik.uni-konstanz.de \
--to=agx@bert.physik.uni-konstanz.de \
--cc=linux-mips@fnet.fr \
--cc=linux@cthulhu.engr.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox