* libc/reent/Makefile.am (lib_a_SOURCES): Added unlinkr.c.
(CHEWOUT_FILES): Added unlinkr.def. * libc/reent/Makefile.in: Rebuilt. * libc/sys.tex: Include unlinkr.def. * libc/reent/linkr.c (_unlink_r): Moved to... * libc/reent/unlinkr.c: ... new file.
This commit is contained in:
parent
85dd2e5b73
commit
f205ea7a03
|
@ -1,3 +1,12 @@
|
||||||
|
Wed Mar 8 00:46:41 2000 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
|
||||||
|
|
||||||
|
* libc/reent/Makefile.am (lib_a_SOURCES): Added unlinkr.c.
|
||||||
|
(CHEWOUT_FILES): Added unlinkr.def.
|
||||||
|
* libc/reent/Makefile.in: Rebuilt.
|
||||||
|
* libc/sys.tex: Include unlinkr.def.
|
||||||
|
* libc/reent/linkr.c (_unlink_r): Moved to...
|
||||||
|
* libc/reent/unlinkr.c: ... new file.
|
||||||
|
|
||||||
Wed Mar 8 00:43:07 2000 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
|
Wed Mar 8 00:43:07 2000 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
|
||||||
|
|
||||||
* libc/string/Makefile.am (lib_a_SOURCES): Added swab.c.
|
* libc/string/Makefile.am (lib_a_SOURCES): Added swab.c.
|
||||||
|
|
|
@ -20,6 +20,7 @@ lib_a_SOURCES = \
|
||||||
sbrkr.c \
|
sbrkr.c \
|
||||||
statr.c \
|
statr.c \
|
||||||
timer.c \
|
timer.c \
|
||||||
|
unlinkr.c \
|
||||||
writer.c
|
writer.c
|
||||||
|
|
||||||
CHEWOUT_FILES = \
|
CHEWOUT_FILES = \
|
||||||
|
@ -35,6 +36,7 @@ CHEWOUT_FILES = \
|
||||||
sbrkr.def \
|
sbrkr.def \
|
||||||
statr.def \
|
statr.def \
|
||||||
timer.def \
|
timer.def \
|
||||||
|
unlinkr.def \
|
||||||
writer.def
|
writer.def
|
||||||
|
|
||||||
SUFFIXES = .def .h
|
SUFFIXES = .def .h
|
||||||
|
|
|
@ -102,6 +102,7 @@ lib_a_SOURCES = \
|
||||||
sbrkr.c \
|
sbrkr.c \
|
||||||
statr.c \
|
statr.c \
|
||||||
timer.c \
|
timer.c \
|
||||||
|
unlinkr.c \
|
||||||
writer.c
|
writer.c
|
||||||
|
|
||||||
|
|
||||||
|
@ -118,6 +119,7 @@ CHEWOUT_FILES = \
|
||||||
sbrkr.def \
|
sbrkr.def \
|
||||||
statr.def \
|
statr.def \
|
||||||
timer.def \
|
timer.def \
|
||||||
|
unlinkr.def \
|
||||||
writer.def
|
writer.def
|
||||||
|
|
||||||
|
|
||||||
|
@ -139,7 +141,7 @@ LDFLAGS = @LDFLAGS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
lib_a_LIBADD =
|
lib_a_LIBADD =
|
||||||
lib_a_OBJECTS = closer.o reent.o impure.o execr.o fstatr.o linkr.o \
|
lib_a_OBJECTS = closer.o reent.o impure.o execr.o fstatr.o linkr.o \
|
||||||
lseekr.o openr.o readr.o signalr.o sbrkr.o statr.o timer.o writer.o
|
lseekr.o openr.o readr.o signalr.o sbrkr.o statr.o timer.o unlinkr.o writer.o
|
||||||
CFLAGS = @CFLAGS@
|
CFLAGS = @CFLAGS@
|
||||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||||
CCLD = $(CC)
|
CCLD = $(CC)
|
||||||
|
|
|
@ -63,40 +63,4 @@ _link_r (ptr, old, new)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
FUNCTION
|
|
||||||
<<_unlink_r>>---Reentrant version of unlink
|
|
||||||
|
|
||||||
INDEX
|
|
||||||
_unlink_r
|
|
||||||
|
|
||||||
ANSI_SYNOPSIS
|
|
||||||
#include <reent.h>
|
|
||||||
int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>);
|
|
||||||
|
|
||||||
TRAD_SYNOPSIS
|
|
||||||
#include <reent.h>
|
|
||||||
int _unlink_r(<[ptr]>, <[file]>)
|
|
||||||
struct _reent *<[ptr]>;
|
|
||||||
char *<[file]>;
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
This is a reentrant version of <<unlink>>. It
|
|
||||||
takes a pointer to the global data block, which holds
|
|
||||||
<<errno>>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
int
|
|
||||||
_unlink_r (ptr, file)
|
|
||||||
struct _reent *ptr;
|
|
||||||
_CONST char *file;
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
errno = 0;
|
|
||||||
if ((ret = _unlink (file)) == -1 && errno != 0)
|
|
||||||
ptr->_errno = errno;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
|
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
/* Reentrant versions of file system calls. These implementations
|
||||||
|
just call the usual system calls. */
|
||||||
|
|
||||||
|
#include <reent.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <_syslist.h>
|
||||||
|
|
||||||
|
/* Some targets provides their own versions of these functions. Those
|
||||||
|
targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
|
||||||
|
|
||||||
|
#ifdef _REENT_ONLY
|
||||||
|
#ifndef REENTRANT_SYSCALLS_PROVIDED
|
||||||
|
#define REENTRANT_SYSCALLS_PROVIDED
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef REENTRANT_SYSCALLS_PROVIDED
|
||||||
|
|
||||||
|
/* We use the errno variable used by the system dependent layer. */
|
||||||
|
#undef errno
|
||||||
|
extern int errno;
|
||||||
|
|
||||||
|
/*
|
||||||
|
FUNCTION
|
||||||
|
<<_unlink_r>>---Reentrant version of unlink
|
||||||
|
|
||||||
|
INDEX
|
||||||
|
_unlink_r
|
||||||
|
|
||||||
|
ANSI_SYNOPSIS
|
||||||
|
#include <reent.h>
|
||||||
|
int _unlink_r(struct _reent *<[ptr]>, const char *<[file]>);
|
||||||
|
|
||||||
|
TRAD_SYNOPSIS
|
||||||
|
#include <reent.h>
|
||||||
|
int _unlink_r(<[ptr]>, <[file]>)
|
||||||
|
struct _reent *<[ptr]>;
|
||||||
|
char *<[file]>;
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
This is a reentrant version of <<unlink>>. It
|
||||||
|
takes a pointer to the global data block, which holds
|
||||||
|
<<errno>>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int
|
||||||
|
_unlink_r (ptr, file)
|
||||||
|
struct _reent *ptr;
|
||||||
|
_CONST char *file;
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
|
if ((ret = _unlink (file)) == -1 && errno != 0)
|
||||||
|
ptr->_errno = errno;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */
|
|
@ -326,6 +326,7 @@ library, and achieve reentrancy by using a reserved global data block
|
||||||
@include reent/statr.def
|
@include reent/statr.def
|
||||||
@include reent/fstatr.def
|
@include reent/fstatr.def
|
||||||
@include reent/linkr.def
|
@include reent/linkr.def
|
||||||
|
@include reent/unlinkr.def
|
||||||
@include reent/sbrkr.def
|
@include reent/sbrkr.def
|
||||||
@up
|
@up
|
||||||
@end ignore
|
@end ignore
|
||||||
|
|
Loading…
Reference in New Issue