Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)
send(2) OSS System Calls Reference Manual
32-bit Guardian and 64-bit OSS clients can pass 32-bit pointers and 64-bit pointers to send64_().
NOTES
This function requires that the feature-test macro _XOPEN_SOURCE_EXTENDED be specified
when you compile the module.
When data can be sent, a call to the select() function indicates that the file descriptor for the
socket is ready for writing.
Calling the send() function with a flags parameter of 0 (zero) is identical to calling the write( )
function.
To use the send() functionality in a threaded application that uses the Standard POSIX Threads
library, see spt_sendx(2).
To use this function in a threaded application that uses the POSIX User Thread Model library on
systems running J06.10 or later RVUs or H06.21 or later RVUs, you must perform all of the fol-
lowing tasks to make the function thread-aware in a multi-threaded application:
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Link the application to the zputdll library (/G/system/zdllnnn/zputdll).
A call to the thread-aware send() function with a flags parameter value of 0 (zero) is identical to
a call to the thread-aware write() function.
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
To use this function in a 32-bit threaded application that uses the POSIX User Thread Model
library on systems running H06.24 or later RVUs or J06.13 or later RVUs, perform the same
tasks (described above) used to enable the function on systems running H06.21/J06.10 or later
RVUs.
To use this function in a 64-bit threaded application that uses the POSIX User Thread Model
library on systems running H06.24 or later RVUs or J06.13 or later RVUs, you must perform all
of the following tasks:
• Compile the application using the _PUT_MODEL_ feature test macro or equivalent
compiler command option.
• Compile the application using the -Wlp64 compiler command option.
• Link the application to the yputdll library (/G/system/zdllnnn/yputdll).
For detailed information about writing multi-threaded and 64-bit applications for the Open Sys-
tem Services environment, see the Open System Services Programmer’s Guide.
RETURN VALUES
Upon successful completion, the send() function returns the number of bytes sent. Otherwise,
the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the send() function sets errno to the corresponding
value:
[EBADF] The socket parameter is not a valid file descriptor.
This error is also returned if the send( ) function is thread-aware and the socket
becomes invalid (is closed by another thread).
7−28 Hewlett-Packard Company 527186-023