Daniel K wrote:

Hi,

The getpid() call on my Redhat9 linux box is causing
some trouble for SQLite. It's reasonably complicated,
but SQLite currently assumes that on linux the
getpid() function returns a different value in different threads. Not so for my setup!


The attachment is a program to test this. If a few
kind people with linux boxes could compile, run and send me the results of it that would help me out.


To compile do:

$ gcc -pthread tst_getpid.c -o tst_getpid

It will take a few seconds to print out 5 lines of
the form "pid is XXX". I need to know whether or not
all 5 XXX numbers are the same or distinct.


Please include the output of command 'uname -a' and
your distro if you can do this.

Thanks enormously,

Dan.



================
Linux 2.6.4-54.5-default #1 Fri May 7 21:43:10 UTC 2004 i686 i686 i386 GNU/Linux
pid is 5779
pid is 5779
pid is 5779
pid is 5779
pid is 5779
================


================
Linux 2.6.5-gentoo-r1 #3 Wed May 26 01:51:52 UTC 2004 i686 AMD Duron(tm) processor AuthenticAMD GNU/Linux
pid is 17985
pid is 17986
pid is 17987
pid is 17988
pid is 17989
================


Different results!

regards

Marcel

http://www.xmlBlaster.org




__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/


------------------------------------------------------------------------

#include <stdio.h>
#include <unistd.h>
#include <pthread.h>

void *thread_main(void *pArg){
 printf("pid is %d\n", getpid());
 sleep(10);
}

int main(int argc, char **argv){
 pthread_t thread;
 int i;

 for( i = 0; i < 5 ; i++ ){
   pthread_create(&thread, 0, thread_main, 0);
   sleep(1);
 }

 return 0;
}




------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to