logging: strip down and clean `log.h` and `log.c`
[babeltrace.git] / src / compat / mman.c
index 1051913d16d3ac4f0275df854b470d1068bd2b45..251e87354d1a40e1908c522d4031d7095b1eed47 100644 (file)
@@ -1,29 +1,11 @@
 /*
- * compat/compat_mman.h
+ * SPDX-License-Identifier: MIT
  *
- * Copyright (C) 2013   JP Ikaheimonen <jp_ikaheimonen@mentor.com>
- *               2016   Michael Jeanson <mjeanson@efficios.com>
+ * Copyright (C) 2013 JP Ikaheimonen <jp_ikaheimonen@mentor.com>
+ * Copyright (C) 2016 Michael Jeanson <mjeanson@efficios.com>
  *
  * These sources are based on ftp://g.oswego.edu/pub/misc/malloc.c
  * file by Doug Lea, released to the public domain.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
  */
 
 #define BT_LOG_OUTPUT_LEVEL (mapping->log_level)
@@ -38,7 +20,6 @@
  * On macOS, we need a dummy symbol so that the linker won't
  * complain of an empty table of contents.
  */
-BT_HIDDEN
 int bt_mman_dummy_symbol;
 #endif /* __APPLE__ */
 
@@ -171,9 +152,8 @@ DWORD map_prot_flags(int prot, DWORD *dwDesiredAccess)
        return 0;
 }
 
-BT_HIDDEN
-void *bt_mmap(void *addr, size_t length, int prot, int flags, int fd,
-               off_t offset, int log_level)
+void *bt_mmap(size_t length, int prot, int flags, int fd, off_t offset,
+               int log_level)
 {
        struct mmap_mapping *mapping = NULL;
        void *mapping_addr;
@@ -272,8 +252,7 @@ error:
        return MAP_FAILED;
 }
 
-BT_HIDDEN
-int bt_munmap(void *addr, size_t length)
+int bt_munmap(void *addr, size_t length __attribute__((unused)))
 {
        int ret = 0;
        struct mmap_mapping *mapping = addr;
@@ -301,13 +280,12 @@ end:
        return ret;
 }
 
-BT_HIDDEN
 size_t bt_mmap_get_offset_align_size(int log_level)
 {
        SYSTEM_INFO sysinfo;
 
        GetNativeSystemInfo(&sysinfo);
-       BT_LOG_WRITE_CUR_LVL(BT_LOG_DEBUG, log_level, BT_LOG_TAG,
+       BT_LOG_WRITE_PRINTF_CUR_LVL(BT_LOG_DEBUG, log_level, BT_LOG_TAG,
                "Allocator granularity is %lu.",
                sysinfo.dwAllocationGranularity);
 
This page took 0.02401 seconds and 4 git commands to generate.