[Info-vax] "bad select 38" (OpenSSL on VMS)

John E. Malmberg wb8tyw at qsl.net_work
Wed Sep 14 08:56:03 EDT 2016


On 9/13/2016 10:32 PM, Neil Rieck wrote:
>
> I discovered a piece of code (term_sock.c) which appeared in the
> Compaq library which "did not include any author information" or
> "copyright info" which I republished here:
>
> http://www3.sympatico.ca/n.rieck/demo_vms_html/term_sock_c.html >

That method uses ASTs to have terminal input feed a TCP/IP socket so 
that the actual select() or poll() can be used.  In this case, the 
terminal input has already been read into an additional buffer.

It has an overhead of 3 extra channels for each terminal input monitored.

I think that the calling program would need a wrapper to main() or VMS 
specific code to dup2 the new socket to stdin.


My wrapper method opens a channel to the devices so uses sys$qiow() 
calls to test if input is available on a terminal or mailbox device.  No 
actual reading of the input is done.

It has an overhead of one extra channel per device monitored.  It was 
designed for use the now old port of the gtk+ components so that it 
could with terminals, pipes, and X11.

The design allowed the extra channel to be created/deleted on each call, 
or cached if more wrappers are needed for other I/O in the program, such 
as simulating the termios API.

It allows an unmodified source program to be used, except for the case 
of X11, where a wrapper to main() should be used to dup2() file 
descriptors to /dev/null for the X11 eventflag to make sure nothing
grabs it.  Since X11 uses lib$get_ef to get the event flag, and by 
default only two are free, it is easy for a wrapper to make sure that 
those file descriptors are not used for real I/O.

Regards,
-John
wb8tyw at qsl_network




More information about the Info-vax mailing list