(* Copyright (C) 1990, Digital Equipment Corporation. *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* Last modified on Fri Jul 20 10:13:17 1990 by muller@cs.ruu.nl *) (* modified on Wed Jun 27 15:31:27 1990 by piet@cs.ruu.nl *) INTERFACE CoreOS (* for HP300 *); FROM Ctypes IMPORT int, short, char, unsigned_short, long, unsigned_long, char_star; <*EXTERNAL*> PROCEDURE exit (i: int); CONST R_OK = 8_4; <*EXTERNAL*> PROCEDURE access (path: char_star; mod: int): int; CONST L_SET = 0; <*EXTERNAL*> PROCEDURE lseek (d: int; offset: int; whence: int): int; <*EXTERNAL*> VAR errno: INTEGER; CONST F_GETFL = 3; (* Get fd status flags *) F_SETFL = 4; (* Set fd status flags *) <*EXTERNAL*> PROCEDURE fcntl (fd, request, arg: int): int; CONST O_NDELAY = 4; EWOULDBLOCK = 246; EAGAIN = 11; TYPE dev_t = long; ino_t = unsigned_long; off_t = int; time_t = int; u_short = unsigned_short; struct_stat = RECORD st_dev : dev_t; st_ino : ino_t; st_mode : u_short; st_nlink : short; st_res1 : short; st_res2 : short; st_rdev : dev_t; st_size : off_t; st_atime : time_t; st_spare1 : int; st_mtime : time_t; st_spare2 : int; st_ctime : time_t; st_spare3 : int; st_blksize: long; st_blocks : long; st_spare4a: long; (* pad acl remote *) st_netdev : dev_t; st_netino : ino_t; st_cnode : u_short; st_rcnode : u_short; st_netsite: u_short; st_fstype : short; st_realdev: dev_t; st_basemode: short; st_spareshort: short; st_uid : long; st_gid : long; st_spare41: long; st_spare42: long; st_spare43: long; END; CONST SIFMT :unsigned_short = 8_10000; SIFPIPE = 8_0; SIFPORT = 8_1; SIFCHR = 8_2; SIFDIR = 8_4; SIFBLK = 8_6; SIFREG = 8_10; SIFLNK = 8_12; SIFSOCK = 8_14; <*EXTERNAL*> PROCEDURE fstat (fd: int; VAR buf: struct_stat): int; CONST Mrwrr = 8_0644; O_RDONLY = 8_0000; (* open for reading *) O_WRONLY = 8_0001; (* open for writing *) O_CREAT = 8_0400; (* create if nonexistant *) O_TRUNC = 8_1000; (* truncate to zero length *) O_APPEND = 8_0010; (* append on each write *) <*EXTERNAL*> PROCEDURE open (name: char_star; flags, mode: int): int; <*EXTERNAL*> PROCEDURE read (d: int; buf: char_star; nbytes: int): int; <*EXTERNAL*> PROCEDURE write (d: int; buf: char_star; nbytes: int): int; <*EXTERNAL*> PROCEDURE close (d: int): int; TYPE struct_timeval = RECORD tv_sec: long; (* seconds *) tv_usec: long; (* and microseconds *) END; struct_timezone = RECORD tz_minuteswest: int; (* minutes west of Greewich *) tz_dsttime: int; (* type of dst correction *) END; struct_itimerval = RECORD it_interval: struct_timeval; (* timer interval *) it_value: struct_timeval; (* current value *) END; <*EXTERNAL*> PROCEDURE gettimeofday (VAR t: struct_timeval; VAR z: struct_timezone): int; <*EXTERNAL*> PROCEDURE settimeofday (VAR t: struct_timeval; VAR z: struct_timezone): int; CONST (* which *) ITIMER_REAL = 0; (* real time intervals *) ITIMER_VIRTUAL = 1; ITIMER_PROF = 2; (* user and system virtual time *) <*EXTERNAL*> PROCEDURE setitimer (which: int; VAR value, ovalue: struct_itimerval): int; TYPE struct_sigcontext = RECORD sc_syscall: int; (* interrupted system call if any *) sc_syscall_action: char ; (* what to do after system call *) sc_pad1: char; sc_pad2: char; sc_onstack: char; (* sigstack state to restore *) sc_mask: int; (* signal mask to restore *) sc_sp: int; (* sp to restore *) sc_ps: int; (* ps to restore *) sc_pc: short; (* pc to retore *) END; TYPE SignalHandler = PROCEDURE (sig, code: int; scp: UNTRACED REF struct_sigcontext); struct_sigvec = RECORD sv_handler: SignalHandler; (* signal handler *) sv_mask: int; (* signal mask to apply *) sv_flags: int; (* see signal options below *) END; CONST SIGALRM = 14; (* alarm clock *) SIGPROF = 21; (* profiling time alarm *) SIGVTALRM = 20; <*EXTERNAL*> PROCEDURE sigvec (sig: int; VAR vec, ovec: struct_sigvec): int; <*EXTERNAL*> PROCEDURE sigsetmask (mask: int): int; <*EXTERNAL*> PROCEDURE sigpause (sigmask: int): int; <*INLINE*> PROCEDURE sigmask (n: int): int; END CoreOS.