File: fionread.c

package info (click to toggle)
tcputils 0.6.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 148 kB
  • ctags: 105
  • sloc: ansic: 1,277; makefile: 105
file content (15 lines) | stat: -rw-r--r-- 242 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
#include <sys/filio.h>

int
main(int argc,
     char **argv)
{
    long unread = 0;
    int status = 0;

    status = ioctl(0, FIONREAD, &unread);
    printf("Status: %d    Unread: %ld\n", status, unread);

    return 0;
}