summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads.old
diff options
context:
space:
mode:
Diffstat (limited to 'libpthread/linuxthreads.old')
-rw-r--r--libpthread/linuxthreads.old/internals.h8
-rw-r--r--libpthread/linuxthreads.old/join.c6
-rw-r--r--libpthread/linuxthreads.old/manager.c14
-rw-r--r--libpthread/linuxthreads.old/pthread.c20
-rw-r--r--libpthread/linuxthreads.old/semaphore.c2
5 files changed, 21 insertions, 29 deletions
diff --git a/libpthread/linuxthreads.old/internals.h b/libpthread/linuxthreads.old/internals.h
index 0cb97357c..a4da09910 100644
--- a/libpthread/linuxthreads.old/internals.h
+++ b/libpthread/linuxthreads.old/internals.h
@@ -497,14 +497,6 @@ extern void __pthread_wait_for_restart_signal(pthread_descr self);
extern void (*__pthread_restart)(pthread_descr);
extern void (*__pthread_suspend)(pthread_descr);
-/* Prototypes for the function without cancelation support when the
- normal version has it. */
-extern __typeof(close) __libc_close;
-extern __typeof(nanosleep) __libc_nanosleep;
-extern __typeof(read) __libc_read;
-extern __typeof(waitpid) __libc_waitpid;
-extern __typeof(write) __libc_write;
-
extern __typeof(pthread_mutex_init) __pthread_mutex_init attribute_hidden;
extern __typeof(pthread_mutex_destroy) __pthread_mutex_destroy attribute_hidden;
extern __typeof(pthread_mutex_lock) __pthread_mutex_lock attribute_hidden;
diff --git a/libpthread/linuxthreads.old/join.c b/libpthread/linuxthreads.old/join.c
index a46d0b68d..96db153bc 100644
--- a/libpthread/linuxthreads.old/join.c
+++ b/libpthread/linuxthreads.old/join.c
@@ -87,7 +87,7 @@ void __pthread_do_exit(void *retval, char *currentframe)
if (self == __pthread_main_thread && __pthread_manager_request >= 0) {
request.req_thread = self;
request.req_kind = REQ_MAIN_THREAD_EXIT;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *)&request, sizeof(request)));
suspend(self);
/* Main thread flushes stdio streams and runs atexit functions.
@@ -186,7 +186,7 @@ int pthread_join(pthread_t thread_id, void ** thread_return)
request.req_thread = self;
request.req_kind = REQ_FREE;
request.req_args.free.thread_id = thread_id;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
}
return 0;
@@ -224,7 +224,7 @@ int pthread_detach(pthread_t thread_id)
request.req_thread = thread_self();
request.req_kind = REQ_FREE;
request.req_args.free.thread_id = thread_id;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
}
return 0;
diff --git a/libpthread/linuxthreads.old/manager.c b/libpthread/linuxthreads.old/manager.c
index 2be474c53..19be92fdf 100644
--- a/libpthread/linuxthreads.old/manager.c
+++ b/libpthread/linuxthreads.old/manager.c
@@ -146,7 +146,7 @@ int attribute_noreturn __pthread_manager(void *arg)
/* Raise our priority to match that of main thread */
__pthread_manager_adjust_prio(__pthread_main_thread->p_priority);
/* Synchronize debugging of the thread manager */
- n = TEMP_FAILURE_RETRY(__libc_read(reqfd, (char *)&request,
+ n = TEMP_FAILURE_RETRY(read(reqfd, (char *)&request,
sizeof(request)));
#ifndef USE_SELECT
ufd.fd = reqfd;
@@ -183,9 +183,9 @@ int attribute_noreturn __pthread_manager(void *arg)
#endif
{
- PDEBUG("before __libc_read\n");
- n = __libc_read(reqfd, (char *)&request, sizeof(request));
- PDEBUG("after __libc_read, n=%d\n", n);
+ PDEBUG("before read\n");
+ n = read(reqfd, (char *)&request, sizeof(request));
+ PDEBUG("after read, n=%d\n", n);
switch(request.req_kind) {
case REQ_CREATE:
PDEBUG("got REQ_CREATE\n");
@@ -301,7 +301,7 @@ pthread_start_thread(void *arg)
if (__pthread_threads_debug && __pthread_sig_debug > 0) {
request.req_thread = self;
request.req_kind = REQ_DEBUG;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
suspend(self);
}
@@ -807,7 +807,7 @@ static void pthread_reap_children(void)
int status;
PDEBUG("\n");
- while ((pid = __libc_waitpid(-1, &status, WNOHANG | __WCLONE)) > 0) {
+ while ((pid = waitpid(-1, &status, WNOHANG | __WCLONE)) > 0) {
pthread_exited(pid);
if (WIFSIGNALED(status)) {
/* If a thread died due to a signal, send the same signal to
@@ -906,7 +906,7 @@ void __pthread_manager_sighandler(int sig attribute_unused)
struct pthread_request request;
request.req_thread = 0;
request.req_kind = REQ_KICK;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
}
}
diff --git a/libpthread/linuxthreads.old/pthread.c b/libpthread/linuxthreads.old/pthread.c
index 562aa433c..119c1cdda 100644
--- a/libpthread/linuxthreads.old/pthread.c
+++ b/libpthread/linuxthreads.old/pthread.c
@@ -610,8 +610,8 @@ int __pthread_initialize_manager(void)
}
if (pid == -1) {
free(__pthread_manager_thread_bos);
- __libc_close(manager_pipe[0]);
- __libc_close(manager_pipe[1]);
+ close(manager_pipe[0]);
+ close(manager_pipe[1]);
return -1;
}
__pthread_manager_request = manager_pipe[1]; /* writing end */
@@ -630,7 +630,7 @@ int __pthread_initialize_manager(void)
/* Synchronize debugging of the thread manager */
PDEBUG("send REQ_DEBUG to manager thread\n");
request.req_kind = REQ_DEBUG;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
return 0;
}
@@ -652,7 +652,7 @@ int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
request.req_args.create.arg = arg;
sigprocmask(SIG_SETMASK, NULL, &request.req_args.create.mask);
PDEBUG("write REQ_CREATE to manager thread\n");
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
PDEBUG("before suspend(self)\n");
suspend(self);
@@ -781,7 +781,7 @@ static void pthread_onexit_process(int retcode, void *arg attribute_unused)
request.req_thread = self;
request.req_kind = REQ_PROCESS_EXIT;
request.req_args.exit.code = retcode;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
suspend(self);
/* Main thread should accumulate times for thread manager and its
@@ -895,8 +895,8 @@ void __pthread_reset_main_thread(void)
free(__pthread_manager_thread_bos);
__pthread_manager_thread_bos = __pthread_manager_thread_tos = NULL;
/* Close the two ends of the pipe */
- __libc_close(__pthread_manager_request);
- __libc_close(__pthread_manager_reader);
+ close(__pthread_manager_request);
+ close(__pthread_manager_reader);
__pthread_manager_request = __pthread_manager_reader = -1;
}
@@ -1022,7 +1022,7 @@ __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime)
/* Sleep for the required duration. If woken by a signal,
resume waiting as required by Single Unix Specification. */
- if (reltime.tv_sec < 0 || __libc_nanosleep(&reltime, NULL) == 0)
+ if (reltime.tv_sec < 0 || nanosleep(&reltime, NULL) == 0)
break;
}
@@ -1107,7 +1107,7 @@ int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstim
/* Sleep for the required duration. If woken by a signal,
resume waiting as required by Single Unix Specification. */
- if (reltime.tv_sec < 0 || __libc_nanosleep(&reltime, NULL) == 0)
+ if (reltime.tv_sec < 0 || nanosleep(&reltime, NULL) == 0)
break;
}
@@ -1147,7 +1147,7 @@ void __pthread_message(char * fmt, ...)
va_start(args, fmt);
vsnprintf(buffer + 8, sizeof(buffer) - 8, fmt, args);
va_end(args);
- TEMP_FAILURE_RETRY(__libc_write(2, buffer, strlen(buffer)));
+ TEMP_FAILURE_RETRY(write(2, buffer, strlen(buffer)));
}
#endif
diff --git a/libpthread/linuxthreads.old/semaphore.c b/libpthread/linuxthreads.old/semaphore.c
index 7502b6e78..c892a601b 100644
--- a/libpthread/linuxthreads.old/semaphore.c
+++ b/libpthread/linuxthreads.old/semaphore.c
@@ -172,7 +172,7 @@ int __new_sem_post(sem_t * sem)
}
request.req_kind = REQ_POST;
request.req_args.post = sem;
- TEMP_FAILURE_RETRY(__libc_write(__pthread_manager_request,
+ TEMP_FAILURE_RETRY(write(__pthread_manager_request,
(char *) &request, sizeof(request)));
}
return 0;