diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1996-10-31 16:01:50 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1996-10-31 16:01:50 +0000 |
commit | 200961621caaa71fa6d6944bff1cf5906c62c866 (patch) | |
tree | 5a7c42391a8ddca1e96acd1625c0d2dd20a662c7 | |
parent | e8fd01d69a5fee0fa94723bafdf80b9389f290d0 (diff) |
Ajout sys_close.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1128 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | byterun/sys.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/byterun/sys.c b/byterun/sys.c index ee6d8f7fa..a131b19e1 100644 --- a/byterun/sys.c +++ b/byterun/sys.c @@ -125,6 +125,13 @@ value sys_open(path, flags, perm) /* ML */ return Val_long(ret); } +value sys_close(fd) /* ML */ + value fd; +{ + close(Int_val(fd)); + return Val_unit; +} + value sys_file_exists(name) /* ML */ value name; { @@ -203,15 +210,15 @@ value sys_system_command(command) /* ML */ value sys_get_config(unit) /* ML */ value unit; { -#define result (r[0]) + value result; Push_roots (r, 1); - result = alloc_tuple (2); - Modify (&Field (result, 0), copy_string (OCAML_OS_TYPE)); - Modify (&Field (result, 1), Val_long (8*sizeof(value))); + r[0] = copy_string(OCAML_OS_TYPE); + result = alloc_tuple(2); + Field(result, 0) = r[0]; + Field(result, 1) = Val_long (8 * sizeof(value)); Pop_roots (); return result; -#undef result } /* Search path function */ |