Break a connection between a process and a channel
Synopsis:
#include <sys/neutrino.h>
int ConnectDetach( int coid );
int ConnectDetach_r( int coid );
Arguments:
- coid
- The connection ID of the connection you want to break.
Library:
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
Description:
The ConnectDetach() and ConnectDetach_r()
kernel calls detach the connection specified by the coid
argument.
When the connection is detached:
- If a client thread is SEND-blocked on the connection (e.g., it's called
MsgSend(),
but the server hasn't received the message), the send fails and returns with an error.
- If a client thread is REPLY-blocked on the connection (e.g., it's called MsgSend(), and
the server received the message), the kernel sends an unblock pulse to the server.
These functions are identical except in the way they indicate errors.
See the Returns section for details.
Blocking states
These calls don't block.
Returns:
The only difference between these functions is the way they indicate errors:
- ConnectDetach()
- If an error occurs, the function returns -1 and sets
errno.
Any other value returned indicates success.
- ConnectDetach_r()
- EOK is returned on success. This function does NOT set errno.
If an error occurs, the function returns a value in the Errors section.
Errors:
- EINVAL
- The connection specified by coid doesn't exist.
Classification:
QNX Neutrino
Safety: |
|
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
Yes |
Thread |
Yes |