Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/inet_addr.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/inet_addr.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/inet_addr.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/inet_addr.html on line 8

inet_addr()

Convert a string into a numeric Internet address

Synopsis:

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

in_addr_t inet_addr( const char * cp );

Arguments:

cp
A pointer to a string that represents an Internet address.

Library:

libsocket

Use the -l socket option to qcc to link against this library.

Description:

The inet_addr() routine converts a string representing an IPv4 Internet address (for example, 127.0.0.1) into a numeric Internet address. To convert a hostname such as ftp.qnx.com, call gethostbyname().

All Internet addresses are returned in network byte order (bytes are ordered from left to right). All network numbers and local address parts are returned as machine-format integer values. For more information on Internet addresses, see inet_net_ntop().

Returns:

An Internet address, or INADDR_NONE if an error occurs.

Classification:

POSIX 1003.1

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Caveats:

Although the value INADDR_NONE (0xFFFFFFFF) is a valid broadcast address, inet_addr() always indicates failure when returning that value. The inet_aton() function doesn't share this problem.

See also:

inet_aton(), inet_network()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/i/inet_addr.html on line 132

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/i/inet_addr.html on line 132