Files
Cpp-in-Embedded-Systems/Chapter07/error_handling/cstdlib_support/nosys_stubs.c
Amar Mahmutbegovic 6a6dd5db58 clean build warnings
2025-05-12 22:26:38 +02:00

22 lines
527 B
C

#include <sys/stat.h>
#include <errno.h>
#include <_ansi.h>
#include <reent.h>
/* Minimal implementation of _fstat_r */
int _fstat_r(struct _reent *r, int file, struct stat *st) {
st->st_mode = S_IFCHR; /* Character device */
return 0;
}
/* Minimal implementation of _getpid_r */
int _getpid_r(struct _reent *r) {
return 1; /* Return a dummy process ID */
}
/* Minimal implementation of _kill_r */
int _kill_r(struct _reent *r, int pid, int sig) {
r->_errno = EINVAL;
return -1; /* Indicate failure */
}