NAME
ypconnect
—
create connected socket to a YP
server
SYNOPSIS
#include
<sys/socket.h>
int
ypconnect
(int
type);
DESCRIPTION
The
ypconnect
()
system call creates a pre-connected SOCK_STREAM or
SOCK_DGRAM socket to a YP server (either the original
ypserv(8) or
ypldap(8)) for use by
internal library routines. It verifies that the domainname is set, that
ypbind(8) has found a
server and created an advisory locked binding file, and then creates the
connected socket based upon the binding file. This type of socket is
restricted in various ways and is not general purpose.
ypconnect
is only intended for use by internal libc
YP functions.
RETURN VALUES
If successful, ypconnect
() returns a
non-negative integer, the socket file descriptor. Otherwise, a value of -1
is returned and errno is set to indicate the
error.
ERRORS
ypconnect
() will fail if:
- [
EAFNOSUPPORT
] - The YP subsystem is not active.
- [
EFTYPE
] - The YP binding file is strange.
- [
EOWNERDEAD
] - The YP binding file is not locked. YP subsystem is not active.
- [
EMFILE
] - The per-process descriptor table is full.
- [
ENFILE
] - The system file table is full.
- [
ENOBUFS
] - Insufficient resources were available in the system to perform the operation.
SEE ALSO
HISTORY
The ypconnect
() function first appeared in
OpenBSD 7.2.