User`s manual

4-6 Intellio C320Turbo User's Manual
1. MIBUFED
This function let you know how many bytes queued in input buffer when this
function is issued.
Syntax for SCO UNIX/XENIX
#define MIBUFED 0x401
int count; /*number of bytes queued in the buffer */
ioctl(moxa_fd, MIBUFED, &count);
Syntax for SVR4.x UNIX/Solaris x86
#include <sys/stropts.h>
#include <sys/sysmacros.h>
#define MIBUFED 0x401
struct strioctl ioc;
int count; /*number of bytes queued in the buffer */
ioc.ic_cmd = MIBUFED;
ioc.ic_timout = 0;
ioc.ic_len = sizeof(int);
ioc.ic_dp = (char *)&count;
ioctl(moxa_fd, I_STR, &ioc);
Note: Due to the characteristics of STREAMS driver, the returned count of bytes
buffered only reflect the data buffered on MOXA board, not including the data
buffered in STREAMS queue. In this case, the count is for reference only. For
example, returned count may always be zero, but there still are data buffered in
STREAMS queue.
2. MOBUFED
This function let you know the byte count queued in output buffer when this
function is issued.
Syntax for SCO UNIX/XENIX
#define MOBUFED 0x402
int count; /* number of bytes queued in the output buffer */
ioctl(moxa_fd, MOBUFED, &count);
Syntax for SVR4.x UNIX/Solaris x86
#include <sys/stropts.h>