![]() |
![]() |
|
|
![]() |
![]() |
X25/9000: X.25/9000 Programmer's Guide > Chapter 4 Sending and Receiving
Data![]() Getting Next Message Status |
|
You can use the ioctl(X25_NEXT_MSG_STAT) system call to obtain information about the next available message. ioctl(X25_NEXT_MSG_STAT) is almost always used when the ioctl(X25_SET_FRAGMENT_SIZE) is used. ioctl(X25_NEXT_MSG_STAT) returns the following information:
The syntax for the ioctl(X25_NEXT_MSG_STAT) system call and its parameters are described below.
sdA socket descriptor for an SVC socket. X25_NEXT_MSG_STATIndicates that the status of the socket is being obtained. statusIndicates the current status of the next message. If status.x25_msg_size is 0, there is no message in the queue; otherwise, it indicates the size of the next message or the next fragment of a message to be read. This is useful to ensure that there is enough buffer space for the next read system call. The status.x25_msg_flags field indicates whether the D or Q bits were set in the next message to be read. The status.x25_msg_flags field also indicates if the next fragment is the last fragment in the message. The M bit was set in the last packet of the last message fragment read (this means that this is a continuation of the previous message fragment). The position of these bits in the field are indicated by the X25_MDTF_BIT, X25_D_BIT, and X25_Q_BIT definitions. errUpon successful completion, err is set to 0. Otherwise, a value of -1 is returned and errno is set to indicate the error. |
![]() |
||
![]() |
![]() |
![]() |
|||||||||
|