(*
    Title: 	UnixIOXtra - Definitions
    LastEdit:	"Mon Sep 17 16:39:56 1984"
    Author: 	Mick Jordan
		Cambridge University Computer Laboratory

    Less frequently used Unix I/O calls.
    BSD 4.1/4.2 support
*)

DEFINITION MODULE UnixIOXtra;

FROM SYSTEM IMPORT WORD;
FROM SystemTypes IMPORT ShortCARDINAL, LongCARDINAL;

EXPORT QUALIFIED  
    Chmod, Dup, Dup2,  Fstat, Stat,
    Link, Unlink,  Umask, 
    (* assoc types  *) StatBuf;

PROCEDURE Chmod(name : ARRAY OF CHAR; mode : BITSET) : INTEGER;

PROCEDURE Dup(fildes : INTEGER) : INTEGER;

PROCEDURE Dup2(fildes, fildes2 : INTEGER) : INTEGER;

TYPE
    StatBuf = RECORD
		dev   : ShortCARDINAL;
		ino   : ShortCARDINAL;
		mode  : BITSET;
		nlink : ShortCARDINAL;
		uid   : ShortCARDINAL;
		gid   : ShortCARDINAL;
		rdev  : ShortCARDINAL;
		size  : LongCARDINAL;
		atime : LongCARDINAL;
		mtime : LongCARDINAL;
		ctime : LongCARDINAL;
                blksize: LongCARDINAL;
                blocks: LongCARDINAL;
	      END;

PROCEDURE Fstat(fildes : INTEGER; VAR buf : StatBuf) : INTEGER;

PROCEDURE Link(name1, name2 : ARRAY OF CHAR) : INTEGER;


PROCEDURE Stat(name : ARRAY OF CHAR; VAR buf : StatBuf) : INTEGER;

PROCEDURE Unlink(name : ARRAY OF CHAR) : INTEGER;

PROCEDURE Umask(VAR oldmask: BITSET; newmask: BITSET);

END UnixIOXtra.
