]> git.proxmox.com Git - ceph.git/blame - ceph/src/common/win32/dlfcn.cc
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / common / win32 / dlfcn.cc
CommitLineData
f67539c2
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2020 SUSE LINUX GmbH
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14
15#include <sstream>
16#include <windows.h>
17
18#include "common/errno.h"
19#include "include/dlfcn_compat.h"
20
21
22void* dlopen(const char *filename, int flags) {
23 return LoadLibrary(filename);
24}
25
26int dlclose(void* handle) {
27 //FreeLibrary returns 0 on error, as opposed to dlclose.
28 return !FreeLibrary(handle);
29}
30
31void* dlsym(void* handle, const char* symbol) {
32 return (void*)GetProcAddress(handle, symbol);
33}
34
35dl_errmsg_t dlerror() {
36 return win32_lasterror_str();
37}
38