forked from Imagelibrary/rtems
Moved reentrant wrappers into their own file.
This commit is contained in:
@@ -371,18 +371,16 @@ void exit(int status)
|
|||||||
* These are directly supported (and completely correct) in the posix api.
|
* These are directly supported (and completely correct) in the posix api.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(RTEMS_POSIX_API)
|
|
||||||
pid_t __getpid(void)
|
pid_t __getpid(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return getpid();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
|
/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
|
||||||
#if !defined(RTEMS_POSIX_API)
|
#if !defined(RTEMS_POSIX_API)
|
||||||
pid_t getpid(void)
|
pid_t getpid(void)
|
||||||
{
|
{
|
||||||
return __getpid();
|
return (0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@ LIB=${ARCH}/${LIBNAME}
|
|||||||
|
|
||||||
# C and C++ source names, if any, go here -- minus the .c or .cc
|
# C and C++ source names, if any, go here -- minus the .c or .cc
|
||||||
C_PIECES=__gettod __brk __times malloc syscalls \
|
C_PIECES=__gettod __brk __times malloc syscalls \
|
||||||
no_libc newlibc newlibif support unixlibc libio hosterr tcattr
|
no_libc newlibc newlibif newlibifr support unixlibc \
|
||||||
|
libio hosterr tcattr
|
||||||
C_FILES=$(C_PIECES:%=%.c)
|
C_FILES=$(C_PIECES:%=%.c)
|
||||||
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
C_O_FILES=$(C_PIECES:%=${ARCH}/%.o)
|
||||||
|
|
||||||
|
|||||||
@@ -371,18 +371,16 @@ void exit(int status)
|
|||||||
* These are directly supported (and completely correct) in the posix api.
|
* These are directly supported (and completely correct) in the posix api.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(RTEMS_POSIX_API)
|
|
||||||
pid_t __getpid(void)
|
pid_t __getpid(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return getpid();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
|
/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
|
||||||
#if !defined(RTEMS_POSIX_API)
|
#if !defined(RTEMS_POSIX_API)
|
||||||
pid_t getpid(void)
|
pid_t getpid(void)
|
||||||
{
|
{
|
||||||
return __getpid();
|
return (0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <reent.h>
|
||||||
|
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
|
||||||
|
|||||||
89
c/src/lib/libc/newlibifr.c
Normal file
89
c/src/lib/libc/newlibifr.c
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* This file contains the glue which maps newlib system calls onto their
|
||||||
|
* RTEMS implementations. This formerly was in the file
|
||||||
|
* libgloss/rtems/iface.c which was installed as rtems.o. Merging this
|
||||||
|
* into the RTEMS source tree minimizes the files which must be linked
|
||||||
|
* to build an rtems application.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
#if defined(RTEMS_NEWLIB)
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <reent.h>
|
||||||
|
|
||||||
|
#include <termios.h>
|
||||||
|
|
||||||
|
#include "internal.h"
|
||||||
|
#include "libio.h"
|
||||||
|
|
||||||
|
_ssize_t
|
||||||
|
_read_r(struct _reent *ptr,
|
||||||
|
int fd,
|
||||||
|
void *buf,
|
||||||
|
size_t nbytes)
|
||||||
|
{
|
||||||
|
return __rtems_read(fd, buf, nbytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
long
|
||||||
|
_write_r(struct _reent *ptr,
|
||||||
|
int fd,
|
||||||
|
const void *buf,
|
||||||
|
size_t nbytes
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return __rtems_write(fd, buf, nbytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
_open_r(struct _reent *ptr,
|
||||||
|
const char *buf,
|
||||||
|
int flags,
|
||||||
|
int mode)
|
||||||
|
{
|
||||||
|
return __rtems_open(buf, flags, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
_close_r(struct _reent *ptr,
|
||||||
|
int fd)
|
||||||
|
{
|
||||||
|
return __rtems_close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
off_t
|
||||||
|
_lseek_r(struct _reent *ptr,
|
||||||
|
int fd,
|
||||||
|
off_t offset,
|
||||||
|
int whence)
|
||||||
|
{
|
||||||
|
return __rtems_lseek(fd, offset, whence);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
_fstat_r(struct _reent *ptr,
|
||||||
|
int fd,
|
||||||
|
struct stat *buf)
|
||||||
|
{
|
||||||
|
return __rtems_fstat(fd, buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
pid_t _getpid_r(struct _reent *ptr)
|
||||||
|
{
|
||||||
|
pid_t __getpid();
|
||||||
|
return __getpid();
|
||||||
|
}
|
||||||
|
|
||||||
|
int _kill_r( struct _reent *ptr, pid_t pid, int sig )
|
||||||
|
{
|
||||||
|
int __kill();
|
||||||
|
return __kill(pid, sig);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -371,18 +371,16 @@ void exit(int status)
|
|||||||
* These are directly supported (and completely correct) in the posix api.
|
* These are directly supported (and completely correct) in the posix api.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(RTEMS_POSIX_API)
|
|
||||||
pid_t __getpid(void)
|
pid_t __getpid(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return getpid();
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
|
/* #if !defined(RTEMS_POSIX_API) || defined(__GO32__) */
|
||||||
#if !defined(RTEMS_POSIX_API)
|
#if !defined(RTEMS_POSIX_API)
|
||||||
pid_t getpid(void)
|
pid_t getpid(void)
|
||||||
{
|
{
|
||||||
return __getpid();
|
return (0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user