Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] OS X: Trouble with threads + execv
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-07-07 (22:42)
From: Nathaniel Gray <n8gray@c...>
Subject: [Caml-list] OS X: Trouble with threads + execv

I'm seeing some confusing behavior on OS X (10.3.4) relating to 
pthreads and the execv family of calls.  It appears that when the 
scheduler thread (from otherlibs/systhreads/ is 
running, any call to execv will fail with "Operation not supported."  
The same applies to execvp, execve, and execvpe.

Here's a small test program:

--- begin ---
open Unix
let args = [| "ocamlc.opt"; "-v" |];;
handle_unix_error (execv "/usr/local/bin/ocamlc.opt") args;;
--- End ---

I build with:
ocamlopt -thread unix.cmxa threads.cmxa -linkall

The result:
[n8gray@golux tmp]$ a.out
a.out: "execv" failed on "/usr/local/bin/ocamlc.opt": Operation not 

If I build the program without linking to threads.cmxa then it works as 

Is this expected behavior?


 >>>-- Nathaniel Gray -- Caltech Computer Science ------>
 >>>-- Mojave Project -- -->

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: