mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-10-26 00:18:31 -04:00
* [EGD-4330] file streams ld preload library It is concept library LD_PRELOAD for handle syscalls wrapper to the image fat file. * [EGD-4330] Stdlib implementation * [EGD-4330] Stdio syscalls * [EGD-4330] Dir searching stdlib replacement * [EGD-4330] NL at end of file * [EGD-4261] Working version of library wrapper * [EGD-4330] Script for run emulator on fs image Run phone emulator using filesystem image * [EGD-4261] Missing debug file * [EGD-4330] Not needed to link... * [EGD-4330] Code review fixes #1 iosyscalls * [EGD-4330] Code review fixes round #2 * [EGD-4330] Code review round #3 * Ident fixes * [EGD-4330] Ident fixes * [EGD-4330] Code review round #4 Co-authored-by: Lucjan Bryndza <lucjan.bryndza@mudita.com>
22 lines
718 B
C++
22 lines
718 B
C++
// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <stdio.h>
|
|
#include <dlfcn.h>
|
|
|
|
namespace vfsn::debug::internal {
|
|
static inline void trace_syscall( const char* fn)
|
|
{
|
|
int (*real_fprintf)(FILE *__restrict __stream, const char *__restrict __format, ...);
|
|
real_fprintf = reinterpret_cast<decltype(real_fprintf)>(dlsym(RTLD_NEXT, "fprintf"));
|
|
real_fprintf(stderr,">>>>>>> CALL FUNC [%s] <<<<<<<\n", fn );
|
|
}
|
|
}
|
|
#ifdef DEBUG_SHARED_LIBRARY_FS_LIB
|
|
#define TRACE_SYSCALL() vfsn::debug::internal::trace_syscall(__PRETTY_FUNCTION__)
|
|
#else
|
|
#define TRACE_SYSCALL() do {} while(0)
|
|
#endif
|