[comp.sys.hp] Porting a program from Sun: async I/O under hp-ux?

korfhage@polyof.poly.edu (A1 willard korfhage (cs) ) (12/04/90)

I just got a couple 400t workstations, running hp-ux 7.03, and I trying
to port an application that currently runs on Suns and RS6000's.
Hp-ux doesn't have the same calls for asynchronous I/O as Suns, and I
would appreciate it if someone could give me a push in the right direction
to fix it.

My problem is that the program makes these calls:

fcntl(fd, F_SETFL, FASYNC) and fcntl(fd, F_SETOWN, getpid())

FASYNC and F_SETOWN aren't defined for hp-ux. Basically, the program is
setting up asynchronous I/O to receive rpc calls and to communication with
some processes running windows. I noticed that there are some 4.2bsd
compatible calls for signals, but I am not sure how they fit into the
scheme of things, if at all.

Thanks for any help.

   Willard

P.S. It was semi-amusing to read in the HP-UX Portability Guide that the
chapter about porting 4.3bsd to HP-UX consists of a single line stating "No
information known..." Not very helpful.

mas@hpindda.cup.hp.com (Margie Spencer) (12/06/90)

>My problem is that the program makes these calls:
>
>fcntl(fd, F_SETFL, FASYNC) and fcntl(fd, F_SETOWN, getpid())
>
>FASYNC and F_SETOWN aren't defined for hp-ux. 
> ....

>  Willard

This is deja-vu!  I just got finished helping someone with a very
similar problem.  Try this ...

1) For the equivalent of F_SETOWN try ...
          
   int pgrp = -getpid();
   ioctl(sock, SIOCSGRP, &pgrp)

2) For the equivalent of FASYNC try ...

   int flag = 1;
   ioctl(sock,FIOASYNC,&flag)