Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

t_rcvuderr() - get error information about a sent datagram

&pagelevel(4)&pagelevel

#include <xti.h>

int t_rcvuderr(int fd, struct t_uderr *uderr);

Description

The user can get information about an error which occurred with a previously sent or received datagram in connectionless mode, with the t_rcvuderr() function. t_rcvuderr() should only be called after an error is indicated.

The fd parameter specifies the local transport endpoint over which the error message was received. The uderr parameter is a pointer to an object of type struct t_uderr.

The t_uderr structure is declared in <xti.h> as follows:

struct t_uderr {
   struct netbuf addr;
   struct netbuf opt;
   long error;
};

Before calling t_rcvuderr(), the user must supply the maxlen component in uderr->addr with the value of each maximum buffer size.

Returning protocol-specific options in uderr->opt is not supported by the transport provider.

t_uderr() returns a protocol-specific error code in uderr->error. This error code corresponds to one of the possible values for the errno error variable (defined in <errno.h>). The following codes are currently possible:

EADDRNOTAVAIL

The partner to which the datagram was last to be sent with t_sndudata() is not reachable.

ENETDOWN

The transport endpoint was cut off by the transport system. In this case, the user should close the transport endpoint with t_close().

If the user does not want to determine the faulty datagram, he can pass the null pointer as the current parameter for uderr with the t_rcvuderr() call.

Return value

0:

If successful.

-1:

If an error occurs. t_ errno is set to indicate the error.

Errors

TBADF

The specified file descriptor does not reference a transport endpoint.

TBUFOVFLW

The number of bytes reserved for the protocol address to be returned or the options is too small to store this information. The information that is to be returned in *uderr is not considered.

TNOTSUPPORT

This function is not supported by the underlying transport provider.

TNOUDERR

There is currently no error message for a datagram on the specified transport endpoint.

TSYSERR

A system error occurred during execution of this function.

See also

t_rcvudata(), t_sndudata()