basic.%gethostid C Function/BASIC Program

basic.%gethostid

Command basic.%gethostid C Function/BASIC Program
Applicable release versions: AP/Unix
Category BASIC Program (486)
Description allows a Pick/BASIC application to retrieve the unique 32-bit identifier for the current host. The id is returned as a decimal number.

If the function fails, a value of -1 is returned and the (Pick/BASIC) system(0) function returns the value of "errno".

To compile successfully, the program must include the statement:
cfunction socket.builtin
Syntax variable=%gethostid()
Options
Example
cfunction  socket.builtin
id=%gethostid()
if id=-1 then
  crt 'Cannot get host id. errno=':system(0)
  stop
end
Purpose
Related basic.cfunction
basic.%socket
basic.%listen
basic.%accept
basic.%bind
basic.system