HP OpenVMS Systems

ask the wizard
Content starts here

Fortran and TCP/IP, system services?

» close window

The Question is:

 
How do I implement the C functions
gethostbyname()and gethostbyaddr() in Fortran?
I've found reference to using a QIO call with
IO$_ACPCONTROL with a subfunction code to search the BIND database but there
 are no Fortran examples.  I guess my problem is the structures I need to
 define and throw into the QIO call.
 


The Answer is :

 
  It would likely be easiest to to directly call a C routine from the
  Fortran code.
 
  Alternatively, please investigate the existing Macro32 example program
  TCPIP$EXAMPLES:TCPIP$TCP_CLIENT_QIO.MAR.  (This example assumes TCP/IP
  Services V5.0 or later is in use.)
 
  If you wish to call sys$qio or sys$qiow from Fortran, various examples
  are available -- unfortunately, the OpenVMS Wizard is not in a position
  to provide an example of every call to every routine from every language.
  Accordingly, you will want to review existing example programs, the
  examples in the Support databases (for customers with support contracts),
  and programs that call common system services such as sys$getjpiw or
  sys$getsyiw.  In conjunction with the Fortran documentation (and
  particularly the Fortran User's Manual for OpenVMS Alpha and its
  examples of calling system services -- an example of sys$qiow is
  included there) and the OpenVMS calling standard documentation, you
  should be able to code and debug a call to most any OpenVMS system
  service routine.
 

answer written or last revised on ( 26-NOV-2001 )

» close window