1 /***********************************************************************/
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
12 /***********************************************************************/
21 #include "unixsupport.h"
25 #include "socketaddr.h"
27 CAMLprim value
unix_accept(value sock
)
32 union sock_addr_union addr
;
33 socklen_param_type addr_len
;
35 addr_len
= sizeof(addr
);
36 enter_blocking_section();
37 retcode
= accept(Int_val(sock
), &addr
.s_gen
, &addr_len
);
38 leave_blocking_section();
39 if (retcode
== -1) uerror("accept", Nothing
);
40 a
= alloc_sockaddr(&addr
, addr_len
, retcode
);
42 res
= alloc_small(2, 0);
43 Field(res
, 0) = Val_int(retcode
);
51 CAMLprim value
unix_accept(value sock
)
52 { invalid_argument("accept not implemented"); }