Skip to content

Commit f819c04

Browse files
twcook86danielinux
authored andcommitted
Eliminate linker warnings for syscalls
1 parent dd43126 commit f819c04

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

test-app/app_lpc55s69.c

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,65 @@ void main(void)
105105
__asm__ volatile ("wfi");
106106
}
107107
}
108+
109+
110+
#include "sys/stat.h"
111+
int _getpid(void)
112+
{
113+
return 1;
114+
}
115+
116+
int _kill(int pid, int sig)
117+
{
118+
(void)pid;
119+
(void)sig;
120+
return -1;
121+
}
122+
123+
void _exit(int status)
124+
{
125+
_kill(status, -1);
126+
while (1) {}
127+
}
128+
129+
int _read(int file, char *ptr, int len)
130+
{
131+
(void)file;
132+
(void)ptr;
133+
(void)len;
134+
return -1;
135+
}
136+
137+
int _write(int file, char *ptr, int len)
138+
{
139+
(void)file;
140+
(void)ptr;
141+
return len;
142+
}
143+
144+
int _close(int file)
145+
{
146+
(void)file;
147+
return -1;
148+
}
149+
150+
int _isatty(int file)
151+
{
152+
(void)file;
153+
return 1;
154+
}
155+
156+
int _lseek(int file, int ptr, int dir)
157+
{
158+
(void)file;
159+
(void)ptr;
160+
(void)dir;
161+
return 0;
162+
}
163+
164+
int _fstat(int file, struct stat *st)
165+
{
166+
(void)file;
167+
st->st_mode = S_IFCHR;
168+
return 0;
169+
}

0 commit comments

Comments
 (0)