clean build warnings
This commit is contained in:
21
Chapter07/error_handling/cstdlib_support/nosys_stubs.c
Normal file
21
Chapter07/error_handling/cstdlib_support/nosys_stubs.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#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 */
|
||||
}
|
||||
Reference in New Issue
Block a user