Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stub implementations of unused syscalls explicitly #1966

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions source/Core/Src/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,14 @@
/* Functions */
void initialise_monitor_handles() {}

/* Syscalls (stub implementations to avoid compile warnings and possibe future problems) */
int _getpid(void) { return 1; }

#if defined(MODEL_Pinecil) || defined(MODEL_Pinecilv2)
// do nothing here because some stubs and real implementations added for Pinecils already
#else
off_t _lseek(int fd, off_t ptr, int dir) { return -1; }
ssize_t _read(int fd, void *ptr, size_t len) { return -1; }
ssize_t _write(int fd, const void *ptr, size_t len) { return -1; }
int _close(int fd) { return -1; }
#endif