summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libdl/dlclose.c
blob: 384550c476254fdef04b1d2a8f05c1dbd8838105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "_dl_int.h"

int dlclose (void *handle)
{
  if (handle) {
    struct _dl_handle *h = handle;
    if (h->lnk_count) {
      --h->lnk_count;
      return -1;
    }
    if (munmap(h->mem_base,h->mem_size)!=0) return -1;
  }
  return 0;
}