User`s manual

4-6 Intellio C320Turbo/PCI User's Manual
Syntax for UNIX SVR4
#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 UNIX SVR4
#include <sys/stropts.h>
#include <sys/sysmacros.h>
#define MOBUFED 0x402
struct strioctl ioc;
int count; /* number of bytes queued in the output buffer */
ioc.ic_cmd = MOBUFED;
ioc.ic_timout = 0;
ioc.ic_len = sizeof(int);
ioc.ic_dp = (char *)&count;
ioctl(moxa_fd, I_STR, &ioc);
Note: See MIBUFED for influence of STREAMS driver.