#include <stdio.h>

extern int $$ferr;
extern int $$iosb[2];
char buf[2048];

main(argc,argv)
int argc;
char *argv[];
{
  FILE *fp;
  int fpret, io[2], fe;

  fp = fopenx(argv[1], argv[2], atoi(argv[3]), atoi(argv[4]));

  printf("\n openned %s with ferr %d\n", argv[1], $$ferr);

  fpret = fgetb(buf, atoi(argv[5]), atoi(argv[6]), fp);
  io[0] = $$iosb[0];
  io[1] = $$iosb[1];
  fe = $$ferr;
  printf("fget() %d byte, $$iosb[0] %o, $$iosb[1] %o, ferr %d\n", 
  	fpret, io[0], io[1], fe);

  sleep(20);
  fclose(fp);
}
