NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libtelnetd.a #include <arpa/telnetd.h>int telnetdWrite(telnetdSessionHandle * hdl, void * buf, unsigned int nchar);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The telnetdWrite() function attempts to write nchar characters from the buffer pointed to by buf , to the TELNET session designated by the hdl handle.
If the TELNET connection cannot accept data immediately and the connection socket has O_NONBLOCK set, telnetdWrite() returns -1 and sets errno to EAGAIN . Otherwise, telnetdWrite() blocks until data can be accepted.
The O_NONBLOCK option can be set for the connection socket by calling fcntl(2POSIX) after the TELNET session has been initialized by telnetdInit() .
For the TELNET session designated by the hdl handle, the telnetdFlush function causes any buffered data (that is, data waiting to be written) to be written to the TELNET connection socket.
On successful completion, telnetdWrite() returns the number of characters actually written; this number may be less than nchar .
On successful completion, telnetdFlush() returns the number of characters flushed from the buffer.
In case of failure, both functions return -1 and set errno to indicate the error.
errno is set to EINVAL if telnetdFlush() or telnetdWrite() is called with an invalid hdl handle.
The telnetdWrite() and telnetdFlush() functions may fail and set errno to any of the errors specified for the write(2POSIX) function.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUE | ERRORS | ATTRIBUTES | SEE ALSO