diff --git a/c/src/exec/libcsupport/src/link.c b/c/src/exec/libcsupport/src/link.c index 1cee54d0bf..c6a9f606e0 100644 --- a/c/src/exec/libcsupport/src/link.c +++ b/c/src/exec/libcsupport/src/link.c @@ -58,3 +58,24 @@ int link( return (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); } + +/* + * _link_r + * + * This is the Newlib dependent reentrant version of link(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +int _link_r( + struct _reent *ptr, + const char *existing, + const char *new +) +{ + return link( existing, new ); +} +#endif + diff --git a/c/src/exec/libcsupport/src/unlink.c b/c/src/exec/libcsupport/src/unlink.c index d4a5520bcb..f3d6606bc9 100644 --- a/c/src/exec/libcsupport/src/unlink.c +++ b/c/src/exec/libcsupport/src/unlink.c @@ -42,3 +42,23 @@ int unlink( return (*loc.ops->unlink)( &loc ); } + +/* + * _unlink_r + * + * This is the Newlib dependent reentrant version of unlink(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +int _unlink_r( + struct _reent *ptr, + const char *path +) +{ + return unlink( path ); +} +#endif + diff --git a/c/src/lib/libc/link.c b/c/src/lib/libc/link.c index 1cee54d0bf..c6a9f606e0 100644 --- a/c/src/lib/libc/link.c +++ b/c/src/lib/libc/link.c @@ -58,3 +58,24 @@ int link( return (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); } + +/* + * _link_r + * + * This is the Newlib dependent reentrant version of link(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +int _link_r( + struct _reent *ptr, + const char *existing, + const char *new +) +{ + return link( existing, new ); +} +#endif + diff --git a/c/src/lib/libc/unlink.c b/c/src/lib/libc/unlink.c index d4a5520bcb..f3d6606bc9 100644 --- a/c/src/lib/libc/unlink.c +++ b/c/src/lib/libc/unlink.c @@ -42,3 +42,23 @@ int unlink( return (*loc.ops->unlink)( &loc ); } + +/* + * _unlink_r + * + * This is the Newlib dependent reentrant version of unlink(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +int _unlink_r( + struct _reent *ptr, + const char *path +) +{ + return unlink( path ); +} +#endif + diff --git a/cpukit/libcsupport/src/link.c b/cpukit/libcsupport/src/link.c index 1cee54d0bf..c6a9f606e0 100644 --- a/cpukit/libcsupport/src/link.c +++ b/cpukit/libcsupport/src/link.c @@ -58,3 +58,24 @@ int link( return (*parent_loc.ops->link)( &existing_loc, &parent_loc, name_start ); } + +/* + * _link_r + * + * This is the Newlib dependent reentrant version of link(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +int _link_r( + struct _reent *ptr, + const char *existing, + const char *new +) +{ + return link( existing, new ); +} +#endif + diff --git a/cpukit/libcsupport/src/unlink.c b/cpukit/libcsupport/src/unlink.c index d4a5520bcb..f3d6606bc9 100644 --- a/cpukit/libcsupport/src/unlink.c +++ b/cpukit/libcsupport/src/unlink.c @@ -42,3 +42,23 @@ int unlink( return (*loc.ops->unlink)( &loc ); } + +/* + * _unlink_r + * + * This is the Newlib dependent reentrant version of unlink(). + */ + +#if defined(RTEMS_NEWLIB) + +#include + +int _unlink_r( + struct _reent *ptr, + const char *path +) +{ + return unlink( path ); +} +#endif +