native_simulator: constify 'buffer' argument in nsi_host_write()

'buffer' argument is read only, so it can be 'const'. This makes it
compatible with POSIX specification of write(3) syscall.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This commit is contained in:
Marcin Niestroj 2024-02-20 20:02:16 +01:00 committed by Alberto Escolar
commit f9dddc387e
2 changed files with 2 additions and 2 deletions

View file

@ -36,7 +36,7 @@ long nsi_host_read(int fd, void *buffer, unsigned long size);
void *nsi_host_realloc(void *ptr, unsigned long size);
void nsi_host_srandom(unsigned int seed);
char *nsi_host_strdup(const char *s);
long nsi_host_write(int fd, void *buffer, unsigned long size);
long nsi_host_write(int fd, const void *buffer, unsigned long size);
#ifdef __cplusplus
}

View file

@ -71,7 +71,7 @@ char *nsi_host_strdup(const char *s)
return strdup(s);
}
long nsi_host_write(int fd, void *buffer, unsigned long size)
long nsi_host_write(int fd, const void *buffer, unsigned long size)
{
return write(fd, buffer, size);
}