Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 30418 Details for
Bug 47067
mono-debugger-0.6 does not finish to compile
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Test case
conftest.c (text/plain), 1.07 KB, created by
Ed Catmur
on 2004-04-30 17:36:40 UTC
(
hide
)
Description:
Test case
Filename:
MIME Type:
Creator:
Ed Catmur
Created:
2004-04-30 17:36:40 UTC
Size:
1.07 KB
patch
obsolete
>#include <stdio.h> >#include <errno.h> >#include <wait.h> >#include <semaphore.h> >#include <pthread.h> >#include <sys/ptrace.h> > >static pid_t child_pid; >static sem_t start_sem; >static sem_t finished_sem; >static int ok = 0; > >static int >thread_func (void *data) >{ > int ret, status; > > // Wait until main thread forked. > sem_wait (&start_sem); > > ret = waitpid (-1, &status, WUNTRACED | __WALL); > > if (ret == child_pid) { > fprintf (stderr, "OK\n"); > ok = 1; > } else { > fprintf (stderr, "Result: %d - %x - %s\n", ret, status, strerror (errno)); > ok = 0; > } > > sem_post (&finished_sem); > exit (!ok); >} > >int >main (void) >{ > pthread_t thread; > > sem_init (&start_sem, 1, 0); > sem_init (&finished_sem, 1, 0); > > // First, we create a thread. > pthread_create (&thread, NULL, thread_func, NULL); > > // Now let's fork a child and trace it. > child_pid = fork (); > if (!child_pid) { > ptrace (PTRACE_TRACEME, 0, NULL, NULL); > asm ("int $03"); > } > > // Ok, child created. Now let our sibling thread wait for it. > sem_post (&start_sem); > > sem_wait (&finished_sem); > fprintf (stderr, "OK: %d\n", ok); > > exit (!ok); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 47067
: 30418 |
30419