To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 535
534  |  536
Subject: 
linux->solaris porting info
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 29 Nov 1999 14:45:53 GMT
Viewed: 
1136 times
  
To whom it may concern: (I think this means Carsten :) This was the
response I got from our resident Solaris/Linux god, conveniently named
Karsten. He believes this one-line fix should have similar behavior. I
can't test it (haven't been able to get other portions of the code to
compile) so I forward it to you in hopes that it is helpful. Let me know
what you find- I may be able to finagle more information out of him if
you need it, or possibly read some man pages myself :)
-Luis (slowly, slowly learning about i/o issues)

---------- Forwarded message ----------
Date: Mon, 22 Nov 1999 16:27:06 -0500 (EST)
From: Karsten Paige Huneycutt <kph@duke.edu>
To: Luis Villa <liv@duke.edu>
Subject: Re: DULUG: linux->solaris porting question

On Fri, 19 Nov 1999, Luis Villa wrote:

signal(SIGIO,sigio_handler);
fcntl(rcxFD(),F_SETFL,O_ASYNC);

are called to attach a handler sigio_handler to the SIGIO which will be
sent when it is possible to do i/o on rcxFD(). AFAICT, under normal
operation, this won't occur.

To get  this behavior on STREAMs objects in Solaris, call, instead of the
fcntl:

ioctl(rcxFD(), I_SETSIG, ARGS),

where you've read the manpage for streamio (section 7I) and have chosen
the most appropriate args.  If you want this for non-STREAMs objects,
you're on your own.

FYI, sockets in Solaris are implemented using STREAMs, as are terminals--
I'm not sure what else this behavior would be useful for.

The man page for fcntl indicates that POSIX has asynchronous IO and the
aio_sigevent to achieve the same goal as the O_ASYNC flag and the related
thrown SIGIO. Which brings me to my question- is there any
straightforward way to replace the fcntl/signal handler pair here with
something else that will send a similar signal in a POSIX system?

I know nothign about making this POSIX-compliant... :)

KH


Karsten Huneycutt           I'll make it all worthwhile, I'll make your
kph@duke.edu                   heart smile!  Strange love, strange highs
http://www.duke.edu/~kph          and strange lows... -- DM, "Strangelove"



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR