Skip to content

Commit 30e5ea0

Browse files
tpamborcfriedt
authored andcommitted
native_simulator: Get latest from upstream
Align with native_simulator's upstream main 4eab13716376e63236d77013f996a897d24dd780 Which includes: 4eab137 Host trampolines: Add getenv/setenv Signed-off-by: Tim Pambor <[email protected]>
1 parent cc4e1d9 commit 30e5ea0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

scripts/native_simulator/common/src/include/nsi_host_trampolines.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ int nsi_host_close(int fd);
2727
/* void nsi_host_exit (int status); Use nsi_exit() instead */
2828
void nsi_host_free(void *ptr);
2929
char *nsi_host_getcwd(char *buf, unsigned long size);
30+
char *nsi_host_getenv(const char *name);
3031
int nsi_host_isatty(int fd);
3132
void *nsi_host_malloc(unsigned long size);
3233
int nsi_host_open(const char *pathname, int flags);
3334
/* int nsi_host_printf (const char *fmt, ...); Use the nsi_tracing.h equivalents */
3435
long nsi_host_random(void);
3536
long nsi_host_read(int fd, void *buffer, unsigned long size);
3637
void *nsi_host_realloc(void *ptr, unsigned long size);
38+
int nsi_host_setenv(const char *name, const char *value, int overwrite);
3739
void nsi_host_srandom(unsigned int seed);
3840
char *nsi_host_strdup(const char *s);
3941
long nsi_host_write(int fd, const void *buffer, unsigned long size);

scripts/native_simulator/common/src/nsi_host_trampolines.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ char *nsi_host_getcwd(char *buf, unsigned long size)
3131
return getcwd(buf, size);
3232
}
3333

34+
char *nsi_host_getenv(const char *name)
35+
{
36+
return getenv(name);
37+
}
38+
3439
int nsi_host_isatty(int fd)
3540
{
3641
return isatty(fd);
@@ -61,6 +66,11 @@ void *nsi_host_realloc(void *ptr, unsigned long size)
6166
return realloc(ptr, size);
6267
}
6368

69+
int nsi_host_setenv(const char *name, const char *value, int overwrite)
70+
{
71+
return setenv(name, value, overwrite);
72+
}
73+
6474
void nsi_host_srandom(unsigned int seed)
6575
{
6676
srandom(seed);

0 commit comments

Comments
 (0)