File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929#include <stdio.h>
3030#include <sys/mman.h>
3131#include <sys/stat.h>
32+ #include <sys/syscall.h>
3233#include <fcntl.h>
3334#include <unistd.h>
3435#include <errno.h>
@@ -87,6 +88,18 @@ uint32_t hal_sim_get_dualbank_state(void);
8788char * * main_argv ;
8889int main_argc ;
8990
91+ static int sim_memfd_create (const char * name , unsigned int flags )
92+ {
93+ #if defined(__linux__ ) && defined(SYS_memfd_create )
94+ return (int )syscall (SYS_memfd_create , name , flags );
95+ #else
96+ (void )name ;
97+ (void )flags ;
98+ errno = ENOSYS ;
99+ return -1 ;
100+ #endif
101+ }
102+
90103#ifdef WOLFBOOT_ENABLE_WOLFHSM_CLIENT
91104
92105/* Client configuration/contexts */
@@ -559,7 +572,7 @@ void do_boot(const uint32_t *app_offset)
559572 exit (0 );
560573#else
561574 char * envp [1 ] = {NULL };
562- int fd = memfd_create ("test_app" , 0 );
575+ int fd = sim_memfd_create ("test_app" , 0 );
563576 size_t wret ;
564577 if (fd == -1 ) {
565578 wolfBoot_printf ( "memfd error\n" );
You can’t perform that action at this time.
0 commit comments