diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-10 22:41:30 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-10 22:41:30 +0000 |
commit | 43ef9c6b3f3623c3328cc510d60e50ddd94cdb1d (patch) | |
tree | ba98bab62db9999d35ab3273d327ae4f5a69334c /libpthread | |
parent | 3d6648de144081c92358b36d88b25efc6e0cef5a (diff) |
*: remove some __libc_XXX functions:
__libc_accept __libc_close __libc_connect __libc_creat __libc_creat64
__libc_fsync __libc_lseek __libc_lseek64 __libc_msync __libc_nanosleep
__libc_open __libc_open64 __libc_pause __libc_read __libc_readv
__libc_recv __libc_recvfrom __libc_recvmsg
__libc_send __libc_sendmsg __libc_sendto
__libc_tcdrain __libc_wait __libc_waitpid __libc_write __libc_writev
They were removed from glibc 1 May 2004:
http://sources.redhat.com/ml/libc-hacker/2004-05/msg00001.html
Diffstat (limited to 'libpthread')
-rw-r--r-- | libpthread/linuxthreads.old/internals.h | 8 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/join.c | 6 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/manager.c | 14 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/pthread.c | 20 | ||||
-rw-r--r-- | libpthread/linuxthreads.old/semaphore.c | 2 | ||||
-rw-r--r-- | libpthread/linuxthreads/internals.h | 5 | ||||
-rw-r--r-- | libpthread/linuxthreads/pthread.c | 4 |
7 files changed, 23 insertions, 36 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; diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h index ecb7b03dd..eb0a51984 100644 --- a/libpthread/linuxthreads/internals.h +++ b/libpthread/linuxthreads/internals.h @@ -416,11 +416,6 @@ extern void (*__pthread_restart)(pthread_descr); extern void (*__pthread_suspend)(pthread_descr); extern int (*__pthread_timedsuspend)(pthread_descr, const struct timespec *); -/* Prototypes for the function without cancelation support when the - normal version has it. */ -extern int __libc_close (int fd); -extern int __libc_nanosleep (const struct timespec *requested_time, - struct timespec *remaining); /* Prototypes for some of the new semaphore functions. */ extern int sem_post (sem_t * sem); extern int sem_init (sem_t *__sem, int __pshared, unsigned int __value); diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c index 2d0f49ee9..91333f2d1 100644 --- a/libpthread/linuxthreads/pthread.c +++ b/libpthread/linuxthreads/pthread.c @@ -1245,7 +1245,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; } @@ -1332,7 +1332,7 @@ __pthread_timedsuspend_new(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; } |