mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-10-18 01:02:50 +08:00
add more stub for newlib porting.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@669 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
12
components/libc/newlib/math.c
Normal file
12
components/libc/newlib/math.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <math.h>
|
||||
|
||||
/* Fix me */
|
||||
double sin(double x)
|
||||
{
|
||||
#warning sin function not supported for this platform
|
||||
}
|
||||
|
||||
double cos(double x)
|
||||
{
|
||||
#warning cos function not supported for this platform
|
||||
}
|
@@ -1,8 +1,57 @@
|
||||
#include <reent.h>
|
||||
#include <sys/errno.h>
|
||||
|
||||
int _fork_r (struct _reent *ptr)
|
||||
int _fork_r (struct _reent *r)
|
||||
{
|
||||
/* return "not supported" */
|
||||
ptr->errno = ENOTSUP;
|
||||
r->_errno = ENOTSUP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
_ssize_t
|
||||
_read_r (struct _reent *r, int fd, void *buf, size_t nbytes)
|
||||
{
|
||||
_ssize_t rc;
|
||||
|
||||
rc = -1;
|
||||
|
||||
/* return "not supported" */
|
||||
r->_errno = ENOTSUP;
|
||||
return rc;
|
||||
}
|
||||
|
||||
_ssize_t
|
||||
_write_r (struct _reent *r, int fd, const void *buf, size_t nbytes)
|
||||
{
|
||||
_ssize_t rc;
|
||||
|
||||
rc = -1;
|
||||
|
||||
/* return "not supported" */
|
||||
r->_errno = ENOTSUP;
|
||||
return rc;
|
||||
}
|
||||
|
||||
int
|
||||
_close_r (struct _reent *r, int fd)
|
||||
{
|
||||
_ssize_t rc;
|
||||
|
||||
rc = -1;
|
||||
|
||||
/* return "not supported" */
|
||||
r->_errno = ENOTSUP;
|
||||
return rc;
|
||||
}
|
||||
|
||||
_off_t
|
||||
_lseek_r (struct _reent *r, int fd, _off_t offset, int whence)
|
||||
{
|
||||
_ssize_t rc;
|
||||
|
||||
rc = -1;
|
||||
|
||||
/* return "not supported" */
|
||||
r->_errno = ENOTSUP;
|
||||
return rc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user