OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [newlib/] [libc/] [include/] [reent.h] - Diff between revs 57 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 57 Rev 1765
/* This header file provides the reentrancy.  */
/* This header file provides the reentrancy.  */
 
 
/* The reentrant system calls here serve two purposes:
/* The reentrant system calls here serve two purposes:
 
 
   1) Provide reentrant versions of the system calls the ANSI C library
   1) Provide reentrant versions of the system calls the ANSI C library
      requires.
      requires.
   2) Provide these system calls in a namespace clean way.
   2) Provide these system calls in a namespace clean way.
 
 
   It is intended that *all* system calls that the ANSI C library needs
   It is intended that *all* system calls that the ANSI C library needs
   be declared here.  It documents them all in one place.  All library access
   be declared here.  It documents them all in one place.  All library access
   to the system is via some form of these functions.
   to the system is via some form of these functions.
 
 
   There are three ways a target may provide the needed syscalls.
   There are three ways a target may provide the needed syscalls.
 
 
   1) Define the reentrant versions of the syscalls directly.
   1) Define the reentrant versions of the syscalls directly.
      (eg: _open_r, _close_r, etc.).  Please keep the namespace clean.
      (eg: _open_r, _close_r, etc.).  Please keep the namespace clean.
      When you do this, set "syscall_dir" to "syscalls" in configure.in,
      When you do this, set "syscall_dir" to "syscalls" in configure.in,
      and add -DREENTRANT_SYSCALLS_PROVIDED to target_cflags in configure.in.
      and add -DREENTRANT_SYSCALLS_PROVIDED to target_cflags in configure.in.
 
 
   2) Define namespace clean versions of the system calls by prefixing
   2) Define namespace clean versions of the system calls by prefixing
      them with '_' (eg: _open, _close, etc.).  Technically, there won't be
      them with '_' (eg: _open, _close, etc.).  Technically, there won't be
      true reentrancy at the syscall level, but the library will be namespace
      true reentrancy at the syscall level, but the library will be namespace
      clean.
      clean.
      When you do this, set "syscall_dir" to "syscalls" in configure.in.
      When you do this, set "syscall_dir" to "syscalls" in configure.in.
 
 
   3) Define or otherwise provide the regular versions of the syscalls
   3) Define or otherwise provide the regular versions of the syscalls
      (eg: open, close, etc.).  The library won't be reentrant nor namespace
      (eg: open, close, etc.).  The library won't be reentrant nor namespace
      clean, but at least it will work.
      clean, but at least it will work.
      When you do this, add -DMISSING_SYSCALL_NAMES to target_cflags in
      When you do this, add -DMISSING_SYSCALL_NAMES to target_cflags in
      configure.in.
      configure.in.
 
 
   Stubs of the reentrant versions of the syscalls exist in the libc/reent
   Stubs of the reentrant versions of the syscalls exist in the libc/reent
   source directory and are used if REENTRANT_SYSCALLS_PROVIDED isn't defined.
   source directory and are used if REENTRANT_SYSCALLS_PROVIDED isn't defined.
   They use the native system calls: _open, _close, etc. if they're available
   They use the native system calls: _open, _close, etc. if they're available
   (MISSING_SYSCALL_NAMES is *not* defined), otherwise open, close, etc.
   (MISSING_SYSCALL_NAMES is *not* defined), otherwise open, close, etc.
   (MISSING_SYSCALL_NAMES *is* defined).  */
   (MISSING_SYSCALL_NAMES *is* defined).  */
 
 
/* WARNING: All identifiers here must begin with an underscore.  This file is
/* WARNING: All identifiers here must begin with an underscore.  This file is
   included by stdio.h and others and we therefore must only use identifiers
   included by stdio.h and others and we therefore must only use identifiers
   in the namespace allotted to us.  */
   in the namespace allotted to us.  */
 
 
#ifndef _REENT_H_
#ifndef _REENT_H_
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
#endif
#define _REENT_H_
#define _REENT_H_
 
 
#include <sys/reent.h>
#include <sys/reent.h>
#include <sys/_types.h>
#include <sys/_types.h>
#include <machine/types.h>
#include <machine/types.h>
 
 
#define __need_size_t
#define __need_size_t
#include <stddef.h>
#include <stddef.h>
 
 
/* FIXME: not namespace clean */
/* FIXME: not namespace clean */
struct stat;
struct stat;
struct tms;
struct tms;
struct timeval;
struct timeval;
struct timezone;
struct timezone;
 
 
/* Reentrant versions of system calls.  */
/* Reentrant versions of system calls.  */
 
 
extern int _close_r _PARAMS ((struct _reent *, int));
extern int _close_r _PARAMS ((struct _reent *, int));
extern int _execve_r _PARAMS ((struct _reent *, char *, char **, char **));
extern int _execve_r _PARAMS ((struct _reent *, char *, char **, char **));
extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int));
extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int));
extern int _fork_r _PARAMS ((struct _reent *));
extern int _fork_r _PARAMS ((struct _reent *));
extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *));
extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *));
extern int _getpid_r _PARAMS ((struct _reent *));
extern int _getpid_r _PARAMS ((struct _reent *));
extern int _kill_r _PARAMS ((struct _reent *, int, int));
extern int _kill_r _PARAMS ((struct _reent *, int, int));
extern int _link_r _PARAMS ((struct _reent *, const char *, const char *));
extern int _link_r _PARAMS ((struct _reent *, const char *, const char *));
extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int));
extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int));
extern int _open_r _PARAMS ((struct _reent *, const char *, int, int));
extern int _open_r _PARAMS ((struct _reent *, const char *, int, int));
extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t));
extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t));
extern void *_sbrk_r _PARAMS ((struct _reent *, size_t));
extern void *_sbrk_r _PARAMS ((struct _reent *, size_t));
extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *));
extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *));
extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *));
extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *));
extern int _unlink_r _PARAMS ((struct _reent *, const char *));
extern int _unlink_r _PARAMS ((struct _reent *, const char *));
extern int _wait_r _PARAMS ((struct _reent *, int *));
extern int _wait_r _PARAMS ((struct _reent *, int *));
extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t));
extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t));
 
 
/* This one is not guaranteed to be available on all targets.  */
/* This one is not guaranteed to be available on all targets.  */
extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *tp, struct timezone *tzp));
extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *tp, struct timezone *tzp));
 
 
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
#endif /* _REENT_H_ */
#endif /* _REENT_H_ */
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.