<div dir="ltr"><div>I am trying to call forkpty</div><div>pid_t forkpty(int *amaster, char *name, const struct termios *termp, const struct winsize *winp);</div><div><br></div><div>Only care about file descriptor 'amaster' and result : pid_t</div>
<div><br></div><div>All is good:</div><div><div> let forkpty = foreign "forkpty" (ptr int @-> ptr void @-> ptr void @-> ptr void @-> returning int)</div></div><div><br></div><div><div> let amaster : int ptr = allocate int -1 in</div>
<div> let pid = forkpty amaster null null null in</div></div><div> let pipefd = !@ amaster <br></div><div><br></div><div>Do not understand how to convert the int representing file descriptor to Unix.file_descr</div>
<div><br></div><div>Or use a view to pass a Unix.file_descr as an int to forkpty ?</div><div><br></div><div>Any help appreciated ...</div><div><br></div></div>