-
Notifications
You must be signed in to change notification settings - Fork 5
/
ordma_close.c
35 lines (31 loc) · 1.32 KB
/
ordma_close.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/***********************************************************************/
/* */
/* OCaml */
/* */
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
/* */
/* Copyright 1996 Institut National de Recherche en Informatique et */
/* en Automatique. All rights reserved. This file is distributed */
/* under the terms of the GNU Library General Public License, with */
/* the special exception on linking described in file ../../LICENSE. */
/* */
/***********************************************************************/
#include <caml/mlvalues.h>
#include <caml/signals.h>
#include <caml/unixsupport.h>
#include <rdma/rsocket.h>
#include "ordma_debug.h"
CAMLprim value ordma_rclose(value fd)
{
int ret;
int fd_ = Int_val(fd);
ORDMA_LOG("ordma_rclose(%i)", fd_);
caml_enter_blocking_section();
ret = rclose(fd_);
caml_leave_blocking_section();
ORDMA_LOG("ordma_rclose(%i),ret=%i",fd_,ret);
if (ret == -1) {
uerror("close", Nothing);
}
return Val_unit;
}