summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_dup.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc_r/uthread/uthread_dup.c')
-rw-r--r--lib/libc_r/uthread/uthread_dup.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc_r/uthread/uthread_dup.c b/lib/libc_r/uthread/uthread_dup.c
index 30af80b..ed1699d 100644
--- a/lib/libc_r/uthread/uthread_dup.c
+++ b/lib/libc_r/uthread/uthread_dup.c
@@ -32,10 +32,11 @@
* $FreeBSD$
*/
#include <unistd.h>
-#ifdef _THREAD_SAFE
#include <pthread.h>
#include "pthread_private.h"
+#pragma weak dup=_dup
+
int
_dup(int fd)
{
@@ -44,12 +45,12 @@ _dup(int fd)
/* Lock the file descriptor: */
if ((ret = _FD_LOCK(fd, FD_RDWR, NULL)) == 0) {
/* Perform the 'dup' syscall: */
- if ((ret = _thread_sys_dup(fd)) < 0) {
+ if ((ret = __sys_dup(fd)) < 0) {
}
/* Initialise the file descriptor table entry: */
else if (_thread_fd_table_init(ret) != 0) {
/* Quietly close the file: */
- _thread_sys_close(ret);
+ __sys_close(ret);
/* Reset the file descriptor: */
ret = -1;
@@ -67,6 +68,3 @@ _dup(int fd)
/* Return the completion status: */
return (ret);
}
-
-__strong_reference(_dup, dup);
-#endif
OpenPOWER on IntegriCloud