Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ send(2X) — UNIX 2.9BSD

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

send(2x)

socket(2x)

SEND(2X)  —  Unix Programmer’s Manual

NAME

send − send message from a socket

SYNOPSIS

#include <sys/socket.h> send(s, to, msg, len)
int cc, s;
struct sockaddr ∗to;
char ∗msg;
int len;

DESCRIPTION

Send is used to transmit a message to another socket from a SOCK_DGRAM or SOCK_RAW socket.  The address of the target is given by to.  The length of the message is given by len.  If the message is too long to pass atomically through the underlying protocol, then the error EMSGSIZE is returned, and the message is not transmitted. 

No indication of failure to deliver is implicit in send.  Some locally detected errors may be reported to the user through the return value from send being −1 with the errors being stored in the external variable errno. 

If no messages space is are available at the socket to hold the message to be transmitted, then send normally blocks, unless the socket is SO_NONBLOCKING in which case a cc of −1 is returned with the external variable errno set to EWOULDBLOCK.  The select(2x) call may be used to determine when it is possible to send more data.

SEE ALSO

send(2x), socket(2x)

BUGS

An option to provide a SIGIO signal when data is available to be received is planned, but not yet implemented. 

This call is provisional, and will exist in a slightly different form in 4.2bsd. 

7th Edition  —  3/17/82

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026