/*
 * $Date: $
 * $Source: $
 * $Revision: $
 * $State: $
 *
 * $Log: $
 */

#ifndef _EMU_IOCTLQ_H
#define _EMU_IOCTLQ_H

#include "emu_defs.h"

#include <sys/types.h>

/*
 * IOCTL defintions
 */
#define NOWAIT  0
#define WAIT    1
#define TEST    2
#define POLL    3

struct ioctlq {
  int fd, req, param3;
  int queued;
};

EXTERN struct ioctlq iq   INIT({0, 0, 0, 0}); /* one-entry queue for ioctl's */
EXTERN u_char in_ioctl    INIT(0);
EXTERN struct ioctlq curi INIT({0, 0, 0, 0});

#ifdef CONFIG_SIG
typedef struct { int fd; int irq; } SillyG_t;
#endif

extern void  ioctl_queue_run(void);
extern int   ioctl_queue(int, int, int);
extern int   ioctl_execute(int, int, int);

extern void  io_select(fd_set);
extern void  io_select_init(void);
extern void  io_select_add(int, unsigned char);
extern void  io_select_remove(int, unsigned char);

#endif /* EMU_H */
