summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/sys.ml4
-rw-r--r--stdlib/sys.mli3
2 files changed, 5 insertions, 2 deletions
diff --git a/stdlib/sys.ml b/stdlib/sys.ml
index b666a5a8a..9da1b6c48 100644
--- a/stdlib/sys.ml
+++ b/stdlib/sys.ml
@@ -16,9 +16,9 @@
(* System interface *)
external get_config: unit -> string * int = "sys_get_config"
-external get_argv: unit -> string array = "sys_get_argv"
+external get_argv: unit -> string * string array = "sys_get_argv"
-let argv = get_argv()
+let (executable_name, argv) = get_argv()
let (os_type, word_size) = get_config()
let max_array_length = (1 lsl (word_size - 10)) - 1;;
let max_string_length = word_size / 8 * max_array_length - 1;;
diff --git a/stdlib/sys.mli b/stdlib/sys.mli
index 5333628e2..f733c3ef1 100644
--- a/stdlib/sys.mli
+++ b/stdlib/sys.mli
@@ -21,6 +21,9 @@ val argv : string array
The following elements are the command-line arguments
given to the program. *)
+val executable_name : string
+(** The name of the file containing the executable currently running. *)
+
external file_exists : string -> bool = "sys_file_exists"
(** Test if a file with the given name exists. *)