mirror of
https://github.com/Ralim/IronOS.git
synced 2025-02-26 07:53:55 +00:00
Drop stubs
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
#include "stub.h"
|
||||
#include <errno.h>
|
||||
|
||||
int _close(int fd) { return _stub(EBADF); }
|
||||
@@ -1,6 +0,0 @@
|
||||
#include "stub.h"
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int _fstat(int fd, struct stat *st) { return _stub(EBADF); }
|
||||
@@ -1,13 +0,0 @@
|
||||
#include "nuclei_sdk_soc.h"
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
int _gettimeofday(struct timeval *tp, void *tzp) {
|
||||
uint64_t cycles;
|
||||
|
||||
cycles = __get_rv_cycle();
|
||||
|
||||
tp->tv_sec = cycles / SystemCoreClock;
|
||||
tp->tv_usec = (cycles % SystemCoreClock) * 1000000 / SystemCoreClock;
|
||||
return 0;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
/* See LICENSE of license details. */
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
int _isatty(int fd) {
|
||||
if (fd == STDOUT_FILENO || fd == STDERR_FILENO) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#include "stub.h"
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
off_t _lseek(int fd, off_t ptr, int dir) { return _stub(EBADF); }
|
||||
@@ -1,9 +0,0 @@
|
||||
#include "gd32vf103_usart.h"
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// #define UART_AUTO_ECHO
|
||||
|
||||
ssize_t _read(int fd, void *ptr, size_t len) { return -1; }
|
||||
@@ -1,18 +0,0 @@
|
||||
/* See LICENSE of license details. */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void *_sbrk(ptrdiff_t incr) {
|
||||
extern char _end[];
|
||||
extern char _heap_end[];
|
||||
static char *curbrk = _end;
|
||||
|
||||
if ((curbrk + incr < _end) || (curbrk + incr > _heap_end)) {
|
||||
return NULL - 1;
|
||||
}
|
||||
|
||||
curbrk += incr;
|
||||
return curbrk - incr;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
|
||||
static inline int _stub(int err) { return -1; }
|
||||
Reference in New Issue
Block a user