svn commit: branches/uClibc-nptl/libpthread/linuxthreads.old

carmelo at uclibc.org carmelo at uclibc.org
Thu Dec 11 14:58:32 UTC 2008


Author: carmelo
Date: 2008-12-11 06:58:31 -0800 (Thu, 11 Dec 2008)
New Revision: 24381

Log:
Synch with trunk @ 24379
Step 21: merge linuxthreads.old directory


Modified:
   branches/uClibc-nptl/libpthread/linuxthreads.old/internals.h
   branches/uClibc-nptl/libpthread/linuxthreads.old/join.c
   branches/uClibc-nptl/libpthread/linuxthreads.old/manager.c
   branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c
   branches/uClibc-nptl/libpthread/linuxthreads.old/semaphore.c
   branches/uClibc-nptl/libpthread/linuxthreads.old/wrapsyscall.c


Changeset:
Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/internals.h
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/internals.h	2008-12-11 14:57:59 UTC (rev 24380)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/internals.h	2008-12-11 14:58:31 UTC (rev 24381)
@@ -497,14 +497,6 @@
 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;

Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/join.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/join.c	2008-12-11 14:57:59 UTC (rev 24380)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/join.c	2008-12-11 14:58:31 UTC (rev 24381)
@@ -87,7 +87,7 @@
   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 @@
     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 @@
     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;

Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/manager.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/manager.c	2008-12-11 14:57:59 UTC (rev 24380)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/manager.c	2008-12-11 14:58:31 UTC (rev 24381)
@@ -146,7 +146,7 @@
   /* 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 @@
 #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 @@
   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 @@
   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 @@
 	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)));
     }
 }

Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c	2008-12-11 14:57:59 UTC (rev 24380)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/pthread.c	2008-12-11 14:58:31 UTC (rev 24381)
@@ -610,8 +610,8 @@
   }
   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 @@
   /* 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 @@
   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 @@
 	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 @@
     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 @@
 
 	/* 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 @@
 
 	    /* 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 @@
   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

Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/semaphore.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/semaphore.c	2008-12-11 14:57:59 UTC (rev 24380)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/semaphore.c	2008-12-11 14:58:31 UTC (rev 24381)
@@ -172,7 +172,7 @@
     }
     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;

Modified: branches/uClibc-nptl/libpthread/linuxthreads.old/wrapsyscall.c
===================================================================
--- branches/uClibc-nptl/libpthread/linuxthreads.old/wrapsyscall.c	2008-12-11 14:57:59 UTC (rev 24380)
+++ branches/uClibc-nptl/libpthread/linuxthreads.old/wrapsyscall.c	2008-12-11 14:58:31 UTC (rev 24381)
@@ -41,35 +41,35 @@
 #endif
 
 
-#define CANCELABLE_SYSCALL(res_type, name, param_list, params) \
-res_type __libc_##name param_list;					      \
-res_type								      \
-__attribute__ ((weak))							      \
-name param_list								      \
-{									      \
-  res_type result;							      \
-  int oldtype;								      \
-  pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);	      \
-  result = __libc_##name params;					      \
-  pthread_setcanceltype (oldtype, NULL);				      \
-  return result;							      \
+#define CANCELABLE_SYSCALL(res_type, name, param_list, params)			\
+res_type name param_list;							\
+res_type									\
+__attribute__ ((weak))								\
+name param_list									\
+{										\
+  res_type result;								\
+  int oldtype;									\
+  pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);		\
+  result = name params;								\
+  pthread_setcanceltype (oldtype, NULL);					\
+  return result;								\
 }
 
-#define CANCELABLE_SYSCALL_VA(res_type, name, param_list, params, last_arg) \
-res_type __libc_##name param_list;					      \
-res_type								      \
-__attribute__ ((weak))							      \
-name param_list								      \
-{									      \
-  res_type result;							      \
-  int oldtype;								      \
-  va_list ap;								      \
-  pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);	      \
-  va_start (ap, last_arg);						      \
-  result = __libc_##name params;					      \
-  va_end (ap);								      \
-  pthread_setcanceltype (oldtype, NULL);				      \
-  return result;							      \
+#define CANCELABLE_SYSCALL_VA(res_type, name, param_list, params, last_arg)	\
+res_type ##name param_list;							\
+res_type									\
+__attribute__ ((weak))								\
+name param_list									\
+{										\
+  res_type result;								\
+  int oldtype;									\
+  va_list ap;									\
+  pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype);		\
+  va_start (ap, last_arg);							\
+  result = name params;								\
+  va_end (ap);									\
+  pthread_setcanceltype (oldtype, NULL);					\
+  return result;								\
 }
 
 




More information about the uClibc-cvs mailing list