I am trying to call forkpty
pid_t forkpty(int *amaster, char *name, const struct termios *termp, const
struct winsize *winp);

Only care about file descriptor 'amaster' and result : pid_t

All is good:
  let forkpty = foreign "forkpty" (ptr int @-> ptr void @-> ptr void @->
ptr void @-> returning int)

    let amaster : int ptr = allocate int -1 in
    let pid = forkpty amaster null null null in
    let pipefd = !@ amaster

Do not understand how to convert the int representing file descriptor to
 Unix.file_descr

Or use a view to pass a Unix.file_descr as an int to forkpty ?

Any help appreciated ...
_______________________________________________
Ctypes mailing list
[email protected]
http://lists.ocaml.org/listinfo/ctypes

Reply via email to