All rights reserved.
%sccs.include.redist.man%
@(#)connect.2 6.8 (Berkeley) 06/23/90
#include <sys/types.h> #include <sys/socket.h>connect(s, name, namelen) int s; struct sockaddr *name; int namelen;
20 [EBADF] S is not a valid descriptor.
20 [ENOTSOCK] S is a descriptor for a file, not a socket.
20 [EADDRNOTAVAIL] The specified address is not available on this machine.
20 [EAFNOSUPPORT] Addresses in the specified address family cannot be used with this socket.
20 [EISCONN] The socket is already connected.
20 [ETIMEDOUT] Connection establishment timed out without establishing a connection.
20 [ECONNREFUSED] The attempt to connect was forcefully rejected.
20 [ENETUNREACH] The network isn't reachable from this host.
20 [EADDRINUSE] The address is already in use.
20 [EFAULT] The name parameter specifies an area outside the process address space.
20 [EINPROGRESS] The socket is non-blocking and the connection cannot be completed immediately. It is possible to select (2) for completion by selecting the socket for writing.
20 [EALREADY] The socket is non-blocking and a previous connection attempt has not yet been completed.
The following errors are specific to connecting names in the UNIX domain. These errors may not apply in future versions of the UNIX IPC domain.
15 [ENOTDIR] A component of the path prefix is not a directory.
15 [EINVAL] The pathname contains a character with the high-order bit set.
15 [ENAMETOOLONG] A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.
15 [ENOENT] The named socket does not exist.
15 [EACCES] Search permission is denied for a component of the path prefix.
15 [EACCES] Write access to the named socket is denied.
15 [ELOOP] Too many symbolic links were encountered in translating the pathname.