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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [newlib/] [libc/] [reent/] [signalr.c] - Diff between revs 148 and 158

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 148 Rev 158
/* Reentrant versions of syscalls need to support signal/raise.
/* Reentrant versions of syscalls need to support signal/raise.
   These implementations just call the usual system calls.  */
   These implementations just call the usual system calls.  */
 
 
#include <reent.h>
#include <reent.h>
#include <signal.h>
#include <signal.h>
#include <unistd.h>
#include <unistd.h>
#include <_syslist.h>
#include <_syslist.h>
 
 
/* Some targets provides their own versions of these functions.  Those
/* Some targets provides their own versions of these functions.  Those
   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
   targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS.  */
 
 
#ifdef _REENT_ONLY
#ifdef _REENT_ONLY
#ifndef REENTRANT_SYSCALLS_PROVIDED
#ifndef REENTRANT_SYSCALLS_PROVIDED
#define REENTRANT_SYSCALLS_PROVIDED
#define REENTRANT_SYSCALLS_PROVIDED
#endif
#endif
#endif
#endif
 
 
#ifdef REENTRANT_SYSCALLS_PROVIDED
#ifdef REENTRANT_SYSCALLS_PROVIDED
 
 
int _dummy_link_syscalls = 1;
int _dummy_link_syscalls = 1;
 
 
#else
#else
 
 
/* We use the errno variable used by the system dependent layer.  */
/* We use the errno variable used by the system dependent layer.  */
#undef errno
#undef errno
extern int errno;
extern int errno;
 
 
/*
/*
FUNCTION
FUNCTION
        <<_kill_r>>---Reentrant version of kill
        <<_kill_r>>---Reentrant version of kill
 
 
INDEX
INDEX
        _kill_r
        _kill_r
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <reent.h>
        #include <reent.h>
        int _kill_r(struct _reent *<[ptr]>, int <[pid]>, int <[sig]>);
        int _kill_r(struct _reent *<[ptr]>, int <[pid]>, int <[sig]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <reent.h>
        #include <reent.h>
        int _kill_r(<[ptr]>, <[pid]>, <[sig]>)
        int _kill_r(<[ptr]>, <[pid]>, <[sig]>)
        struct _reent *<[ptr]>;
        struct _reent *<[ptr]>;
        int <[pid]>;
        int <[pid]>;
        int <[sig]>;
        int <[sig]>;
 
 
DESCRIPTION
DESCRIPTION
        This is a reentrant version of <<kill>>.  It
        This is a reentrant version of <<kill>>.  It
        takes a pointer to the global data block, which holds
        takes a pointer to the global data block, which holds
        <<errno>>.
        <<errno>>.
*/
*/
 
 
int
int
_DEFUN (_kill_r, (ptr, pid, sig),
_DEFUN (_kill_r, (ptr, pid, sig),
     struct _reent *ptr _AND
     struct _reent *ptr _AND
     int pid _AND
     int pid _AND
     int sig)
     int sig)
{
{
  int ret;
  int ret;
 
 
  errno = 0;
  errno = 0;
  if ((ret = _kill (pid, sig)) == -1 && errno != 0)
  if ((ret = _kill (pid, sig)) == -1 && errno != 0)
    ptr->_errno = errno;
    ptr->_errno = errno;
  return ret;
  return ret;
}
}
 
 
/*
/*
FUNCTION
FUNCTION
        <<_getpid_r>>---Reentrant version of getpid
        <<_getpid_r>>---Reentrant version of getpid
 
 
INDEX
INDEX
        _getpid_r
        _getpid_r
 
 
ANSI_SYNOPSIS
ANSI_SYNOPSIS
        #include <reent.h>
        #include <reent.h>
        int _getpid_r(struct _reent *<[ptr]>);
        int _getpid_r(struct _reent *<[ptr]>);
 
 
TRAD_SYNOPSIS
TRAD_SYNOPSIS
        #include <reent.h>
        #include <reent.h>
        int _getpid_r(<[ptr]>)
        int _getpid_r(<[ptr]>)
        struct _reent *<[ptr]>;
        struct _reent *<[ptr]>;
 
 
DESCRIPTION
DESCRIPTION
        This is a reentrant version of <<getpid>>.  It
        This is a reentrant version of <<getpid>>.  It
        takes a pointer to the global data block, which holds
        takes a pointer to the global data block, which holds
        <<errno>>.
        <<errno>>.
 
 
        We never need <<errno>>, of course, but for consistency we
        We never need <<errno>>, of course, but for consistency we
        still must have the reentrant pointer argument.
        still must have the reentrant pointer argument.
*/
*/
 
 
int
int
_DEFUN (_getpid_r, (ptr),
_DEFUN (_getpid_r, (ptr),
     struct _reent *ptr)
     struct _reent *ptr)
{
{
  int ret;
  int ret;
  ret = _getpid ();
  ret = _getpid ();
  return ret;
  return ret;
}
}
 
 
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
 
 

powered by: WebSVN 2.1.0

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