home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!boulder!ucsu!ucsu.Colorado.EDU!baileyc
- From: baileyc@ucsu.Colorado.EDU (Christopher R. Bailey)
- Subject: SIGIO signal on HP pa-risc??? help needed
- Message-ID: <1992Dec12.005923.765@ucsu.Colorado.EDU>
- Keywords: SIGIO, fcntl, HP, System V, BSD, signal, socket
- Sender: news@ucsu.Colorado.EDU (USENET News System)
- Nntp-Posting-Host: ucsu.colorado.edu
- Organization: University of Colorado, Boulder
- Distribution: usa
- Date: Sat, 12 Dec 1992 00:59:23 GMT
- Lines: 39
-
-
- I have some code I am trying to port to an HP pa-risc architecture machine.
- The only thing it's choking on is some signal stuff. It doesn't know about
- the requests F_SETOWN and FASYNC. This code works on Sun and Dec (and I think
- IBM RS/6000 :-). I couldn't find anything in the man pages for fcntl() about
- these. They are used to allow the SIGIO and SIGURG signals. I was wondering
- how to implement this on an HP pa-risc machine. I believe these are BSD
- things, because the HP's we have that are running 4.3 BSD (HP 300's and 700)
- have it. This is being used in the app to receive X windows events and call
- the signal handler which deals with the events. If anyone has any example
- code that would be great. I guess this may be true for any Sys V???
-
- Here is the two short functions that utilize SIGIO.
-
- setup_sigio()
- {
- sock = display->fd;
- socket_flags = fcntl(sock, F_GETFL, 0);
- socket_count = 0;
- signal(SIGIO, handle_sigio);
- fcntl(sock, F_SETOWN, getpid() );
- }
-
- enable_sigio()
- {
- if(++socket_count == 1)
- fcntl(sock, F_SETFL, socket_flags | FASYNC);
- }
-
- disable_sigio()
- {
- if(--socket_count == 0)
- fcntl(sock, F_SETFL, socket_flags & ~FASYNC);
- }
- --
- Christopher R. Bailey |Internet: baileyc@dendrite.cs.colorado.edu
- University of Colorado at Boulder|CompuServe: 70403,1522
- /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
- Ride Fast, Take Chances!
-