4 #include <sys/nacl_imc_api.h>
5 #include <sys/nacl_syscalls.h>
8 int read_message(int desc
)
12 struct NaClImcMsgIoVec iov
;
13 struct NaClImcMsgHdr msg
;
15 iov
.length
= sizeof(buf
);
21 int result
= imc_recvmsg(desc
, &msg
, 0);
23 printf("failed, result=%i\n", result
);
28 printf("NaCl got message: ");
29 for(i
= 0; i
< result
; i
++)
31 printf("NaCl received %i FDs\n", msg
.desc_length
);
36 int main(int argc
, char* argv
[])
38 while(read_message(3))