write(hdlc,lapb,llc2)
NAME
write − Transmit data over an HDLC, LAPB, or LLC2 Link
SYNTAX
#include <sys/types.h>
#include <sys/socket.h>
cc = write (s, buf, buflen)
int cc, s;
char ∗buf;
int buflen;
DESCRIPTION
The write() or send() system calls allow a user to queue a data buffer for transmission over an HDLC, LAPB, or LLC2 link.
ARGUMENTS
Input Arguments
s descriptor for a socket that has been returned by the socket() system call.
buf specifies the pointer to the data to be sent
buflen size of the data
flags Null
RETURN VALUE
If the output is successful, the return value (cc) is the number of characters actually sent. Otherwise, -1 is returned and the global variable errno is set to indicate the error.
DIAGNOSTICS
[EBADF] The s value is not a valid socket descriptor.
[EFAULT] The buf argument points outside the allocated address space
[EIDRM] The port has not been opened or is waiting to be closed by the client.This error occurs if the link and/or the station have been disabled by the Network Management.
[EMSGSIZE] The message is longer than the negotiated buffer size.
[ENETDOWN] The link and/or station is disabled by the network management. This error also occurs if the link is inoperative, i.e. if there is no connectivity with the physical layer.
[ENETUNREACH] The link’s protocol operation has been stopped. For more information please refer to the DEC WAN Device Drivers Application Programmer’s Guide.
[EWOULDBLOCK] The socket is marked "non-blocking" and the transmit operation would have been blocked.
[ENETRESET] The link is being initialized but not yet reached the running state. Alternatively, the link is in an error state waiting to be reset or re-initialized.
[ENOPROTOOPT] The station is in Maintenance Mode.