2021-01-17 17:45:21 +00:00
|
|
|
/* Copyright 2021 Nick Brassel, QMK
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
#include <errno.h>
|
2021-01-17 17:45:21 +00:00
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
|
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
__attribute__((weak, used)) int _open_r(struct _reent *r, const char *path, int flag, int m) {
|
|
|
|
__errno_r(r) = ENOENT;
|
2021-01-17 17:45:21 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _lseek_r(struct _reent *r, int file, int ptr, int dir) {
|
2021-01-19 14:23:03 +00:00
|
|
|
__errno_r(r) = EBADF;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _read_r(struct _reent *r, int file, char *ptr, int len) {
|
|
|
|
__errno_r(r) = EBADF;
|
|
|
|
return -1;
|
2021-01-17 17:45:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _write_r(struct _reent *r, int file, char *ptr, int len) {
|
2021-01-19 14:23:03 +00:00
|
|
|
__errno_r(r) = EBADF;
|
|
|
|
return -1;
|
2021-01-17 17:45:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _close_r(struct _reent *r, int file) {
|
2021-01-19 14:23:03 +00:00
|
|
|
__errno_r(r) = EBADF;
|
|
|
|
return -1;
|
2021-01-17 17:45:21 +00:00
|
|
|
}
|
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
__attribute__((weak, used)) int _link_r(struct _reent *r, const char *oldpath, const char *newpath) {
|
|
|
|
__errno_r(r) = EPERM;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _unlink_r(struct _reent *r, const char *path) {
|
|
|
|
__errno_r(r) = EPERM;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) clock_t _times_r(struct _reent *r, void *t) {
|
|
|
|
__errno_r(r) = EFAULT;
|
|
|
|
return -1;
|
2021-01-17 17:45:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _fstat_r(struct _reent *r, int file, struct stat *st) {
|
2021-01-19 14:23:03 +00:00
|
|
|
__errno_r(r) = EBADF;
|
|
|
|
return -1;
|
2021-01-17 17:45:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _isatty_r(struct _reent *r, int fd) {
|
2021-01-19 14:23:03 +00:00
|
|
|
__errno_r(r) = EBADF;
|
|
|
|
return 0;
|
2021-01-17 17:45:21 +00:00
|
|
|
}
|
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
__attribute__((weak, used)) caddr_t _sbrk_r(struct _reent *r, int incr) {
|
|
|
|
__errno_r(r) = ENOMEM;
|
|
|
|
return (caddr_t)-1;
|
|
|
|
}
|
|
|
|
|
|
|
|
__attribute__((weak, used)) int _kill(int pid, int sig) {
|
|
|
|
errno = EPERM;
|
|
|
|
return -1;
|
|
|
|
}
|
2021-01-17 17:45:21 +00:00
|
|
|
|
|
|
|
__attribute__((weak, used)) pid_t _getpid(void) { return 1; }
|
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
__attribute__((weak, used)) void _fini(void) { return; }
|
|
|
|
|
|
|
|
__attribute__((weak, used, noreturn)) void _exit(int i) {
|
2021-01-17 17:45:21 +00:00
|
|
|
while (1)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
__attribute__((weak, used)) int _gettimeofday_r(struct _reent *r, struct timeval *t, void *tzp) {
|
|
|
|
__errno_r(r) = EPERM;
|
|
|
|
return -1;
|
|
|
|
}
|
2021-01-17 17:45:21 +00:00
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
__attribute__((weak, used)) void *__dso_handle;
|
2021-01-17 17:45:21 +00:00
|
|
|
|
2021-01-19 14:23:03 +00:00
|
|
|
__attribute__((weak, used)) void __cxa_pure_virtual(void) {
|
2021-01-17 17:45:21 +00:00
|
|
|
while (1)
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma GCC diagnostic pop
|