(* Copyright (C) 1990, Digital Equipment Corporation. *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* Last modified on Fri Jul 20 10:11:02 1990 by muller *) INTERFACE CoreOS (* for AIX386 *); FROM Ctypes IMPORT int, unsigned_int, short, 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 = 8_000104; EWOULDBLOCK = 11; EAGAIN = 11; TYPE struct_stat = RECORD st_dev : long; st_ino : long; st_mode : unsigned_long; st_nlink : unsigned_short; st_uid : unsigned_short; st_gid : unsigned_long; st_rdev : long; st_size : long; st_atime : long; st_spare1 : unsigned_long; st_mtime : long; st_spare2 : unsigned_long; st_ctime : long; st_spare3 : unsigned_long; st_blksize: unsigned_long; st_blocks : unsigned_long; st_gen : unsigned_long; st_type : unsigned_long; st_vfs : unsigned_long; st_flag : unsigned_long; st_cmtcnt : unsigned_long; st_fstore : unsigned_long; st_version: unsigned_long; st_css : short; st_ss : short; st_rdevsite: short; st_spare4 : short; st_nid : long; st_uid_raw: unsigned_long; st_gid_raw: unsigned_long; st_uid_rev_tag: unsigned_long; st_gid_rev_tag: unsigned_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: unsigned_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_onstack: int; (* sigstack state to restore *) sc_mask: int; (* signal mask to restore *) sc_sp: int; (* sp to restore *) sc_pc: int; (* pc to retore *) sc_ps: int; (* psl to restore *) 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 *) SIGVTALRM = 34; SIGPROF = 32; (* profiling time alarm *) <*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.