Eliminate linker warnings for syscalls

pull/714/head
Thomas Cook 2026-03-01 19:30:36 -05:00 committed by Daniele Lacamera
parent dd4312679b
commit f819c04dfd
1 changed files with 62 additions and 0 deletions

View File

@ -105,3 +105,65 @@ void main(void)
__asm__ volatile ("wfi");
}
}
#include "sys/stat.h"
int _getpid(void)
{
return 1;
}
int _kill(int pid, int sig)
{
(void)pid;
(void)sig;
return -1;
}
void _exit(int status)
{
_kill(status, -1);
while (1) {}
}
int _read(int file, char *ptr, int len)
{
(void)file;
(void)ptr;
(void)len;
return -1;
}
int _write(int file, char *ptr, int len)
{
(void)file;
(void)ptr;
return len;
}
int _close(int file)
{
(void)file;
return -1;
}
int _isatty(int file)
{
(void)file;
return 1;
}
int _lseek(int file, int ptr, int dir)
{
(void)file;
(void)ptr;
(void)dir;
return 0;
}
int _fstat(int file, struct stat *st)
{
(void)file;
st->st_mode = S_IFCHR;
return 0;
}