home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / cmlmcmpw.sit / Caml Light / Lib / unix.mli < prev    next >
Encoding:
Text File  |  1991-05-01  |  2.9 KB  |  74 lines  |  [TEXT/MPS ]

  1. (* Some Unix system calls. *)
  2.  
  3. exception OS_error of int;;
  4.         (* Raised by some functions in the unix and io modules, when
  5.            the underlying system call fails. The argument to OS_error
  6.            is the Unix error code (errno). See intro(2). *)
  7.  
  8. value command_line : string vect
  9.         (* The command line arguments given to the process. *)
  10. ;;
  11.  
  12. type file_stat =
  13.   { st_dev: int;              (* st_dev --- device number *)          
  14.     st_ino: int;              (* st_ino --- inode number *)
  15.     st_mode: int;             (* st_mode --- access rights *)
  16.     st_nlink: int;            (* st_nlink --- number of hard links *)
  17.     st_uid: int;              (* st_uid --- user id of owner *)
  18.     st_gid: int;              (* st_gid --- group id of owner *)
  19.     st_rdev: int;             (* st_rdev --- device type *)
  20.     st_size: int;             (* st_size --- total size, in bytes *)
  21.     st_atime: int;            (* st_atime --- date of last access *)
  22.     st_mtime: int;            (* st_mtime --- date of last modification *)
  23.     st_ctime: int;            (* st_ctime --- date of last status change *)
  24.     st_blksize: int;          (* st_blksize --- optimal buffer size *)
  25.     st_blocks: int }          (* st_blocks --- number of blocks used *)
  26. ;;
  27.  
  28. type times =
  29.   { tms_real: float;          (* real time *)
  30.     tms_utime: float;         (* tms_utime - process user time *)
  31.     tms_stime: float;         (* tms_stime - process system time *)
  32.     tms_cutime: float;        (* tms_cutime - children user time *)
  33.     tms_cstime: float }       (* tms_cstime - children system time *)
  34. ;;
  35.          
  36. (* See the corresponding man pages in section 2. *)
  37.  
  38. value exit : int -> 'a = 1 "unix_exit"
  39.   and open : string -> int -> int -> int = 3 "unix_open"
  40.   and close : int -> int = 1 "unix_close"
  41.   and read : int -> string -> int -> int -> int = 4 "unix_read"
  42.   and write : int -> string -> int -> int -> int = 4 "unix_write"
  43.   and lseek : int -> int -> int -> int = 3 "unix_lseek"
  44.   and truncate : string -> int -> int = 2 "unix_truncate"
  45.   and stat : string -> file_stat = 1 "unix_stat" "alloc"
  46.   and fstat : int -> file_stat = 1 "unix_fstat" "alloc"
  47.   and link : string -> string -> int = 2 "unix_link"
  48.   and unlink : string -> int = 1 "unix_unlink"
  49.   and pipe : unit -> int * int = 1 "unix_pipe" "alloc"
  50.   and times : unit -> times = 1 "unix_times" "alloc"
  51.   and fork : unit -> int = 1 "unix_fork"
  52.   and execv : string -> string vect -> unit = 2 "unix_execv"
  53.   and os_errno : unit -> int = 1 "os_errno"
  54.   and os_error_message : int -> string = 1 "os_error_message" "alloc"
  55. ;;
  56.  
  57. (* Open modes and rights. See open(2). *)
  58.  
  59. value mode_rdonly : int
  60. and mode_wronly : int
  61. and mode_rdwr : int
  62. and mode_creat : int
  63. and mode_trunc : int
  64. and mode_excl : int
  65. and rights_read : int
  66. and rights_write : int
  67. and rights_exec : int
  68. and rights_owner : int
  69. and rights_group : int
  70. and rights_others : int
  71. and rights_everything : int
  72. and rights_everybody : int
  73. ;;
  74.