basic.%gethostid

C Function/BASIC Program, Releases: AP/Unix

Gets the unique identifier of the current host.

Syntax

variable=%gethostid()

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

Example

cfunction socket.builtin
id=%gethostid()
if id=-1 then
crt 'Cannot get host id. errno=':system(0)
stop
end

See Also

Command Name Type Description
basic.cfunction Definition Declare a list of C functions.
basic.%socket C Function Creates a socket.
basic.%listen C Function Listens for incoming connections and limits the backlog of incoming connections.
basic.%accept C Function Accept a connection on a socket.
basic.%bind C Function Binds a name to a socket.
basic.system Function Displays status of system-controlled variables.

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.