[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] GLIBC 2.0 create and attr_init



> Your patch is wrong, because you are suddenly accessing random data
> past the end of the structure.
Oops, right.
I incorrectly assumed that libpthread allocated the memory itself,
which is of course completely wrong.

The programs work only because they pass a NULL pthread_attr_t to
pthread_create.

Here is the corrected patch:

--- nptl/pthread_create.c~	2002-11-01 19:53:49.000000000 +0100
+++ nptl/pthread_create.c	2002-11-01 19:55:17.000000000 +0100
@@ -387,7 +387,10 @@ __pthread_create_2_0 (newthread, attr, s
      void *(*start_routine) (void *);
      void *arg;
 {
-  return ENOSYS;
+	if(attr)
+		return ENOSYS;
+	else
+		return __pthread_create_2_1(newthread, NULL, start_routine, arg);
 }
 compat_symbol (libpthread, __pthread_create_2_0, pthread_create,
 	       GLIBC_2_0);

Attachment: pgp00032.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]