1 /* 2 * Copyright 2018 Oticon A/S 3 * Copyright (c) 2023 Nordic Semiconductor ASA 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8 #ifndef _BS_UTIL_OSWRAP_H 9 #define _BS_UTIL_OSWRAP_H 10 11 #include <stdlib.h> 12 #include <stdio.h> 13 #include "bs_types.h" 14 #include "bs_string.h" 15 16 #ifdef __cplusplus 17 extern "C"{ 18 #endif 19 20 void bs_set_sig_term_handler(void (*f)(int), int signals[], int n); 21 #if defined(__linux) 22 uint64_t bs_get_process_start_time(long int pid); 23 #endif 24 void* bs_malloc(size_t size); 25 void* bs_aligned_alloc(size_t alignment, size_t size); 26 void* bs_calloc(size_t nmemb, size_t size); 27 void* bs_realloc(void *ptr, size_t size); 28 void bs_skipline(FILE *file); 29 void bs_readline(char *s, int size, FILE *stream); 30 int bs_createfolder(const char* folderpath); 31 FILE* bs_fopen(const char *file_path, const char *open_type); 32 int bs_create_folders_in_path(const char *path); 33 34 #ifdef __cplusplus 35 } 36 #endif 37 38 #endif 39