mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-22 10:50:15 -10:00
core_load_file() is the loader the load check will use, so that a file swapped after the check is not the one loaded. On Android it loads from the checked fd with android_dlopen_ext, named by the core's real path. On Windows it loads by path while the check's handle, which shares only reads, holds the file. Elsewhere it loads the path. On Apple, core_load_framework_binary() names the binary dylib_load opens inside a .framework, so the check can read that file. RetroArch doesn't build or call either yet; the core_signature harness tests them.
30 lines
914 B
C
30 lines
914 B
C
/* Copyright (C) 2026 The RetroArch team
|
|
* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
#ifndef CORE_LOAD_FILE_H__
|
|
#define CORE_LOAD_FILE_H__
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <boolean.h>
|
|
#include <dynamic/dylib.h>
|
|
#include <retro_common_api.h>
|
|
|
|
#include "core_signature.h"
|
|
|
|
RETRO_BEGIN_DECLS
|
|
|
|
/* Loads the core f (non-NULL) was opened from, path being the resolved
|
|
* absolute path f was opened by (Android: its real path). Android loads
|
|
* from f itself; Windows by path while f, sharing nothing but reads,
|
|
* holds the file; elsewhere by path. f stays open: close it after. */
|
|
dylib_t core_load_file(core_file_t *f, const char *path);
|
|
|
|
/* Apple builds only, where dylib_load opens a .framework folder's
|
|
* binary, <name>.framework/<name>, so the check must too. s must not
|
|
* overlap path. False for other paths. */
|
|
bool core_load_framework_binary(const char *path, char *s, size_t len);
|
|
|
|
RETRO_END_DECLS
|
|
|
|
#endif
|