Hi,

Does the linux-user mode in QEMU support running multithreaded code?
I am most interested in running SPARC binaries, but I tested with
x86_64 and it seems like some system calls needed for pthreads are not
included.  I've attached a very simple program that uses pthreads.
When I run it normally there is an error that says:

qemu: Unsupported syscall: 202

When I run it with the -strace parameter there is additonal information:

6958 
futex(0x00000040009fe06c,FUTEX_PRIVATE_FLAG|FUTEX_WAKE,1,0x00000000006895a0,0x0000000000691860,6887520)qemu:
Unsupported syscall: 202
 = -1 errno=38 (Function not implemented)
6958 rt_sigaction(32,274888384256,0,8,274888384432,0) = 0
6958 rt_sigaction(33,274888384256,0,8,274888384432,0) = -1 errno=22
(Invalid argument)
6958 rt_sigprocmask(1,274888384440,0,8,274888384432,0) = 0


What I'm wondering is if the x86_64-linux-user binary is expected to
be able to execute multithreaded programs, or if it is only single
threaded.  Also depending on what the status is I"d be interested to
know if there are any plans to change this in the future.

Thanks,

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

void *foo() {
  printf("called foo\n");
}

int main() {
  pthread_t t;
  int rc = 0;
  rc = pthread_create(&t,0,&foo,0);
  usleep(5000);
  printf("return code is:%d\n",rc);
}

Reply via email to