'\"macro stdmacro
.if n .pH g3n.t_look @(#)t_look	40.5 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} t_look 3N "Networking Support Utilities" "\&"
.if \nX=1 .ds x} t_look 3N "Networking Support Utilities"
.if \nX=2 .ds x} t_look 3N "" "\&"
.if \nX=3 .ds x} t_look "" "" "\&"
.if \nX=4 .ds x} t_look "NS_LIB" "EXTENSION" " "
.TH \*(x}
.SH NAME
\f4t_look\f1 \- look at the current event on a transport endpoint
.SH SYNOPSIS
\f4#include <tiuser.h>\f1
.PP
\f4int t_look(fd)\f1
.br
\f4int fd;\f1
.SH DESCRIPTION
This function returns the current event
on the transport endpoint specified by
\f4fd\fP.
This function enables a transport provider to notify a transport user of an
asynchronous event when the user is issuing functions in synchronous mode.
Certain events require immediate notification of the user and are indicated
by a specific error, \f4TLOOK\fP, on the current or next function to
be executed.
.P
This function also enables a transport user to poll a transport endpoint
periodically for asynchronous events.
.P
On failure, \f4t_errno\f1 may be set to one of the following:
.TP 15
\f4[TBADF]\fP
The specified file descriptor does not refer to a transport endpoint.
.TP
\f4[TSYSERR]\fP
A system error has occurred during execution of this function.
.SH SEE ALSO
\f4t_open\fP(3N).
.br
\f2UNIX System V Network Programmer's Guide\f1.
.SH DIAGNOSTICS
Upon success, \f4t_look\fP returns a value that indicates which of the
allowable events has occurred, or returns zero if no event exists.
One of the following events is returned:
.TP 19
\f4T_LISTEN\fP
connection indication received
.TP
\f4T_CONNECT\fP
connect confirmation received
.TP
\f4T_DATA\fP
normal data received		
.TP
\f4T_EXDATA\fP
expedited data received	
.TP
\f4T_DISCONNECT\fP
disconnect received
.TP
\f4T_UDERR\fP
datagram error indication	
.TP
\f4T_ORDREL\fP
orderly release indication
.PP
On failure, \-1 is returned and \f4t_errno\fP is set to indicate the error.
.Ee
