bproc_nodeaddr

Name

bproc_nodeaddr -- return the address of a node

Synopsis

#include <sys/bproc.h>

int bproc_nodeaddr( int node, struct sockaddr * addr, int * size );

Description

bproc_nodeaddr places the address of the master node in struct sockaddr pointed to by addr. The size parameter should be intialized to the amount of space pointed to by addr. The mount of space used in addr is returned in size.

Note that nodes may have multiple IP addresses. If the node is up when bproc_nodeaddr is called, it will return the address that that node is currently up at. Otherwise, it will return the last address the node was up at or if it's never been up, the first address.

Return Value

On success, bproc_nodeaddr will return 0. On error, it will return -1 and errno will be set appropriately.

Errors

EINVAL

node is an invalid node number or node is down.

EBUSY

The BProc system is not running.

See Also

bproc_nodenumber(2)