#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__i386)		/* XXX: Are these headers needed at all? */
#include <sys/sysi86.h>
#include <sys/v86.h>
#endif
#include <sys/psw.h>

#include "solaris-io.h"

int iopfd = 0;

int openiop() {
  if ((iopfd = open("/devices/pseudo/iop@0:iop", O_RDONLY)) < 0) {
    perror("OPEN failed\n");
    return iopfd;
  }
  return 0;
}

int closeiop() {
  return close(iopfd);
}
