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/g/getsockname.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/g/getsockname.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/g/getsockname.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/g/getsockname.html on line 8

getsockname()

Get the name of a socket

Synopsis:

#include <sys/socket.h>

int getsockname( int s, 
                 struct sockaddr * name,
                 socklen_t * namelen );

Arguments:

s
The file descriptor of the socket whose name you want to get.
name
A pointer to a sockaddr object where the function can store the socket's name.
namelen
A pointer to a socklen_t object that initially indicates the amount of space pointed to by name. The function updates namelen to contain the actual size of the name (in bytes).

Library:

libsocket

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

Description:

The getsockname() function returns the current name for the specified socket.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EBADF
Invalid descriptor s.
EFAULT
The name parameter points to memory that isn't in a valid part of the process address space.
ENOBUFS
Insufficient resources were available in the system to perform the operation.

Classification:

POSIX 1003.1

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

See also:

getpeername()


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/g/getsockname.html on line 157

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/g/getsockname.html on line 157