summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2022-07-17 03:01:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2022-07-17 03:01:24 +0000
commit15d5fe5e878f002d21e86a923d3853fbc6130529 (patch)
treeada9c88c77e487ee9e4e9ea35bfd79e4a4a0dd2d /lib/libc
parent23025ad96ed0d243e019e89b49398cc9befb201d (diff)
add ypconnect(2) manual page
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/sys/Makefile.inc5
-rw-r--r--lib/libc/sys/ypconnect.274
2 files changed, 77 insertions, 2 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index dd260c181be..df2038d217c 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.161 2021/12/23 18:50:32 guenther Exp $
+# $OpenBSD: Makefile.inc,v 1.162 2022/07/17 03:01:22 deraadt Exp $
# $NetBSD: Makefile.inc,v 1.35 1995/10/16 23:49:07 jtc Exp $
# @(#)Makefile.inc 8.1 (Berkeley) 6/17/93
@@ -198,4 +198,5 @@ MAN+= __get_tcb.2 __thrsigdivert.2 __thrsleep.2 _exit.2 accept.2 \
sigprocmask.2 sigreturn.2 sigsuspend.2 socket.2 \
socketpair.2 stat.2 statfs.2 swapctl.2 symlink.2 \
sync.2 sysarch.2 syscall.2 sysctl.2 thrkill.2 truncate.2 \
- umask.2 unlink.2 unveil.2 utimes.2 utrace.2 vfork.2 wait.2 write.2
+ umask.2 unlink.2 unveil.2 utimes.2 utrace.2 vfork.2 wait.2 write.2 \
+ ypconnect.2
diff --git a/lib/libc/sys/ypconnect.2 b/lib/libc/sys/ypconnect.2
new file mode 100644
index 00000000000..21db9b46863
--- /dev/null
+++ b/lib/libc/sys/ypconnect.2
@@ -0,0 +1,74 @@
+.\" $OpenBSD: ypconnect.2,v 1.1 2022/07/17 03:01:23 deraadt Exp $
+.\"
+.\" Copyright (c) 2022 Theo de Raadt <deraadt@openbsd.org>
+.\"
+.\" Permission to use, copy, modify, and distribute this software for any
+.\" purpose with or without fee is hereby granted, provided that the above
+.\" copyright notice and this permission notice appear in all copies.
+.\"
+.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.\"
+.Dd $Mdocdate: July 17 2022 $
+.Dt YPCONNECT 2
+.Os
+.Sh NAME
+.Nm ypconnect
+.Nd create connected socket to a YP server
+.Sh SYNOPSIS
+.In sys/socket.h
+.Ft int
+.Fn ypconnect "int type"
+.Sh DESCRIPTION
+The
+.Fn ypconnect
+system call creates a pre-connected
+.Va SOCK_STREAM
+or
+.Va SOCK_DGRAM
+socket to a YP server (either the original
+.Xr ypserv 8
+or
+.Xr ypldap 8 )
+for use by internal library routines.
+It verifies that the domainname is set, that
+.Xr 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.
+.Nm
+is only intended for use by internal libc YP functions.
+.Sh RETURN VALUES
+.Rv -std
+.Sh ERRORS
+.Fn ypconnect
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EAFNOSUPPORT
+The YP subsystem is not active.
+.It BQ Er EFTYPE
+The YP binding file is strange.
+.It Bq Er EOWNERDEAD
+The YP binding file is not locked. YP subsystem is not active.
+.It Bq Er EMFILE
+The per-process descriptor table is full.
+.It Bq Er ENFILE
+The system file table is full.
+.It Bq Er ENOBUFS
+Insufficient resources were available in the system to perform the operation.
+.El
+.Sh SEE ALSO
+.Xr connect 2 ,
+.Xr socket 2 ,
+.Xr ypbind 8
+.Sh HISTORY
+The
+.Fn ypconnect
+function first appeared in
+.Ox 7.2 .