summaryrefslogtreecommitdiff
path: root/static/unix-v10/man3/udp.3
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/unix-v10/man3/udp.3
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/unix-v10/man3/udp.3')
-rw-r--r--static/unix-v10/man3/udp.383
1 files changed, 83 insertions, 0 deletions
diff --git a/static/unix-v10/man3/udp.3 b/static/unix-v10/man3/udp.3
new file mode 100644
index 00000000..a449c974
--- /dev/null
+++ b/static/unix-v10/man3/udp.3
@@ -0,0 +1,83 @@
+.TH UDP 3X
+.CT 2 comm_mach
+.SH NAME
+udp_connect, udp_listen, udp_datagram \(mi udp networking functions
+.SH SYNOPSIS
+.nf
+.B #include <sys/inet/udp_user.h>
+.PP
+.B int udp_connect(sport, dhost, dport)
+.B in_addr dhost;
+.B udp_port sport, dport;
+.PP
+.B int udp_listen(sport, reply)
+.B udp_port sport;
+.B struct udpreply *reply;
+.PP
+.B int udp_datagram(sport)
+.B udp_port sport;
+.PP
+.SH DESCRIPTION
+These routines are loaded by the
+.B -lin
+option of
+.IR ld (1).
+.PP
+UDP (universal datagram protocol) is a protocol layered
+upon IP (internet protocol).
+It provides datagram service between end points called sockets.
+A socket address is composed of the internet address
+of its host and the port number to which
+the socket is bound.
+.PP
+.I Udp_connect
+returns the file descriptor of a UDP socket bound to port
+.I sport.
+Each
+.IR read (2)
+from this file descriptor will only accept datagrams from the UDP
+socket at host
+.I dhost,
+port
+.IR dport ;
+a
+.IR write
+on this file descriptor will be sent to that socket.
+.PP
+.I Udp_listen
+returns the file descriptor of a UDP socket bound to port
+.I sport
+and waits for a datagram to be sent to that port.
+Once a message has been received from another socket,
+all writes
+will go to that socket and
+reads will only accept data from that socket.
+.PP
+.I Udp_datagram
+returns the file descriptor of a UDP socket bound to port
+.I sport.
+Messages written to the file descriptor must start with a
+.B struct udpaddr
+which contains the destination of the message.
+.IP
+.EX
+.ta \w'struct 'u +\w'updaddr 'u
+struct udpaddr {
+ in_addr host;
+ int port;
+};
+.EE
+.PP
+Messages read from the file descriptor also start with a
+.B struct udpaddr
+and contain the address of the source socket.
+.SH FILES
+.TP 12
+.F /dev/udp*
+the socket devices
+.SH SEE ALSO
+.IR internet (3),
+.IR tcp (3)
+.SH DIAGNOSTICS
+All these routines
+returns \-1 on failure.