move hand-written checks to their own file
[jack_interposer.git] / manual.c
blob7f90d85bb9e9d7b64fcfe4a3419ab0992d3da295
1 /*
2 * This file, unlike checkers.c, is maintained manually because these
3 * checks for some reason cannot be done manually
4 */
5 int fprintf(FILE *stream, const char *format, ...)
7 va_list ap;
8 va_start(ap, format);
9 return vfprintf(stream, format, ap);
12 int printf(const char *format, ...)
14 va_list ap;
15 va_start(ap, format);
16 return vprintf(format, ap);
19 int pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex, const struct timespec* abstime)
21 static int (*func)(pthread_cond_t*, pthread_mutex_t*, const struct timespec* abstime);
23 if (in_rt)
25 printf("pthread_cond_timedwait() is called while in rt section\n");
26 #if ABORT_ON_VIOLATION
27 abort();
28 #endif
31 if(!func)
32 //func = (int (*)(pthread_cond_t*, pthread_mutex_t*)) dlsym(RTLD_NEXT, "pthread_cond_wait");
33 // see http://forums.novell.com/novell-product-support-forums/suse-linux-enterprise-server-sles/sles-configure-administer/385705-sles-10-2-java-hung-calling-pthread_cond_timedwait.html
34 func = (int (*)()) dlvsym(RTLD_NEXT, "pthread_cond_timedwait", "GLIBC_2.3.2");
35 if (func == NULL)
37 fprintf(stderr, "Error dlsym'ing\n");
38 abort();
40 return(func(cond, mutex, abstime));
44 int pthread_cond_wait(pthread_cond_t * cond, pthread_mutex_t * mutex)
46 static int (*func)(pthread_cond_t*, pthread_mutex_t*);
48 if (in_rt)
50 printf("pthread_cond_wait() is called while in rt section\n");
51 #if ABORT_ON_VIOLATION
52 abort();
53 #endif
56 if(!func)
57 //func = (int (*)(pthread_cond_t*, pthread_mutex_t*)) dlsym(RTLD_NEXT, "pthread_cond_wait");
58 // see http://forums.novell.com/novell-product-support-forums/suse-linux-enterprise-server-sles/sles-configure-administer/385705-sles-10-2-java-hung-calling-pthread_cond_timedwait.html
59 func = (int (*)(pthread_cond_t*, pthread_mutex_t*)) dlvsym(RTLD_NEXT, "pthread_cond_wait", "GLIBC_2.3.2");
60 if (func == NULL)
62 fprintf(stderr, "Error dlsym'ing\n");
63 abort();
65 return(func(cond, mutex));