[Info-vax] "bad select 38" (OpenSSL on VMS)
Neil Rieck
n.rieck at sympatico.ca
Fri Sep 16 07:41:23 EDT 2016
On Wednesday, September 14, 2016 at 8:55:10 AM UTC-4, John E. Malmberg wrote:
> 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
Yep, well, I didn't write that code. I suspect someone at Compaq did -AND- they may have intended to get it into the official OpenSSL distro.
My advice you you is to get your working code into the OpenSSL distro so that others (including HP/HPE/VSI) aren't required to engage in a coding ritual every time a new version of OpenSSL is published.
Neil Rieck
Waterloo, Ontario, Canada.
#########
More information about the Info-vax
mailing list