]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/net/tcpip/v2_0/doc/getpeername.man
Initial revision
[karo-tx-redboot.git] / packages / net / tcpip / v2_0 / doc / getpeername.man
1 NAME
2        getpeername - get name of connected peer
3
4 SYNOPSIS
5        #include <network.h>
6
7        int  getpeername(int  s,  struct sockaddr *name, socklen_t
8        *namelen);
9
10 DESCRIPTION
11        Getpeername returns the name  of  the  peer  connected  to
12        socket  s.  The namelen parameter should be initialized to
13        indicate the amount of  space  pointed  to  by  name.   On
14        return  it  contains  the actual size of the name returned
15        (in bytes).  The name is truncated if the buffer  provided
16        is too small.
17
18 RETURN VALUE
19        On  success,  zero is returned.  On error, -1 is returned,
20        and errno is set appropriately.
21
22 ERRORS
23        EBADF   The argument s is not a valid descriptor.
24
25        ENOTSOCK
26                The argument s is a file, not a socket.
27
28        ENOTCONN
29                The socket is not connected.
30
31        ENOBUFS Insufficient resources were available in the  sys-
32                tem to perform the operation.
33
34