val ( ^/^ ) : string -> string -> string val regexp_of_glob : string -> string val date_str : unit -> string val message : string -> unit val command : string -> unit val input_lines : in_channel -> string list val new_get_process_output : string -> Unix.process_status * string list val old_get_process_output : string -> string list val get_process_output : string -> string list val exists : string -> bool val sh_mount : ?opts:string list -> string -> string -> unit val sh_umount : ?opts:string list -> string -> unit val mkdir : ?opts:string list -> string -> unit val rmdir : ?opts:string list -> string -> unit val grep : ?opts:string list -> string -> string -> string list val cp : ?opts:string list -> string -> string -> unit val mv : ?opts:string list -> string -> string -> unit val rm : ?opts:string list -> string -> unit val touch : ?opts:string list -> string -> unit val umount_if_mounted : string -> unit val mount_once : ?opts:string list -> string -> string -> unit val map_over_file : (string -> string) -> string -> unit val kill_by_cwd : string -> unit val umount_below : string -> string list (** [fchroot path f] runs function [f] in a chroot at [path] *) val fchroot : string -> (unit -> 'a) -> 'a (** [fork_and_chroot path f] forks process, chroots to [path] and executes function [f]. The parent process will wait for the child process to exit before continuing The function f should return a status (integer). Fchroot will return this value. If f throws an exception, fchroot will return -1. *) val fork_and_chroot : string -> (unit -> int) -> Unix.process_status (** From /usr/include/linux/limits.h, the number of bytes in atomic write to a pipe *) external pipe_buf : unit -> int = "pipe_buf_native" (** [fchdir file_descr] change the current directory to that specified by the open [file_descr] *) external fchdir : Unix.file_descr -> unit = "fchdir_native" external realpath : string -> string = "realpath_native" (** openlog (ident : string) (option : int) (facility : int) option flags: LOG_PID=1 LOG_CONS=2 LOG_ODELAY=4 LOG_NDELAY=8 LOG_NOWAIT=16 LOG_PERROR=32 facilities: LOG_KERN (0 \<\< 3) /* kernel messages */ LOG_USER (1 \<\< 3) /* random user-level messages */ LOG_MAIL (2 \<\< 3) /* mail system */ LOG_DAEMON (3 \<\< 3) /* system daemons */ LOG_AUTH (4 \<\< 3) /* security/authorization messages */ LOG_SYSLOG (5 \<\< 3) /* messages generated internally by syslogd */ LOG_LPR (6 \<\< 3) /* line printer subsystem */ LOG_NEWS (7 \<\< 3) /* network news subsystem */ LOG_UUCP (8 \<\< 3) /* UUCP subsystem */ LOG_CRON (9 \<\< 3) /* clock daemon */ LOG_AUTHPRIV (10 \<\< 3) /* security/authorization messages (private) */ LOG_FTP (11 \<\< 3) /* ftp daemon */ *) external openlog : string -> int -> int -> unit = "openlog_native" (** syslog (priority : int) (message : string) priority is the OR of a facility and one of the following: LOG_EMERG=0 system is unusable LOG_ALERT=1 action must be taken immediately LOG_CRIT=2 critical conditions LOG_ERR=3 error conditions LOG_WARNING=4 warning conditions LOG_NOTICE=5 normal, but significant, condition LOG_INFO=6 informational message LOG_DEBUG=7 debug-level message *) external syslog : int -> string -> unit = "syslog_native" external closelog : unit -> unit = "closelog_native" external lchown: string -> int -> int -> unit = "lchown_native" external seteuid: int -> unit = "seteuid_native" external setresuid: int -> int -> int -> unit = "setresuid_native" (* Evaluate a thunk as the effective user. This will convince things like mount(2) that you really are root if you are executing suid. *) val su : ?newuid:int -> (unit -> 'a) -> 'a type mountflag = MS_RDONLY (* Mount read-only *) | MS_NOSUID (* Ignore suid and sgid bits *) | MS_NODEV (* Disallow access to device special files *) | MS_NOEXEC (* Disallow program execution *) | MS_SYNCHRONOUS (* Writes are synced at once *) | MS_REMOUNT (* Alter flags of a mounted FS *) | MS_MANDLOCK (* Allow mandatory locks on an FS *) | MS_DIRSYNC (* Directory modifications are synchronous *) | MS_NOATIME (* Do not update access times. *) | MS_NODIRATIME (* Do not update directory access times *) | MS_BIND | MS_MOVE | MS_REC | MS_VERBOSE | MS_POSIXACL (* VFS does not apply the umask *) | MS_ONE_SECOND (* fs has 1 sec a/m/ctime resolution *) | MS_ACTIVE | MS_NOUSER type umount2flag = MNT_FORCE | MNT_DETACH external mount: string (* source *) -> string (* target *) -> string (* e.g. reiserfs, proc *) -> mountflag list -> string (* usually a comma separated list of options *) -> unit (* 0 for success, -1 for error *) = "mount_native" external umount : string (* target *) -> unit (* 0 for success, -1 for error *) = "umount_native" external umount2 : string (* target *) -> umount2flag list -> unit = "umount2_native" type file_kind = S_REG | S_DIR | S_CHR | S_BLK | S_LNK | S_FIFO | S_SOCK external mknod : string (* pathname *) -> file_kind (* file_kind, e.g., S_CHR = character special *) -> int (* mode *) -> int (* major device number *) -> int (* minor device number *) -> unit = "mknod_native" external pivot_root : string (* new root *) -> string (* put_old *) -> unit = "pivot_root_native" external init_module : string (* module name *) -> string (* path name of module *) -> unit = "init_module_native" external uname_r : unit -> string = "uname_r_native" val do_locked : ?wait:float -> (unit -> 'a) -> string -> unit