X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=libgc%2Fsolaris_threads.c;h=e6e0ea259c17cdb842657cb8c0927ae8adc4a078;hb=831403d104705c81d2fdb98473855da2e3076311;hp=20c76003c0688934e7ddf39412473379158bca29;hpb=ffb845b352dadf2a085b2b58aa3cb6c5d5ae4464;p=mono.git diff --git a/libgc/solaris_threads.c b/libgc/solaris_threads.c index 20c76003c06..e6e0ea259c1 100644 --- a/libgc/solaris_threads.c +++ b/libgc/solaris_threads.c @@ -16,9 +16,16 @@ */ /* Boehm, September 14, 1994 4:44 pm PDT */ +# include "private/gc_priv.h" + # if defined(GC_SOLARIS_THREADS) || defined(GC_SOLARIS_PTHREADS) -# include "private/gc_priv.h" +/* Avoid #error"Cannot use procfs in the large file compilation environment" */ +#if defined(_ILP32) && (_FILE_OFFSET_BITS != 32) +#undef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 32 +#endif + # include "private/solaris_threads.h" # include # include @@ -248,8 +255,8 @@ static void stop_all_lwps() for (i = 0; i < max_lwps; i++) last_ids[i] = 0; for (;;) { - if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0) - ABORT("Main PIOCSTATUS failed"); + if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCSTATUS, &status) < 0) + ABORT("Main PIOCSTATUS failed"); if (status.pr_nlwp < 1) ABORT("Invalid number of lwps returned by PIOCSTATUS"); if (status.pr_nlwp >= max_lwps) { @@ -262,7 +269,7 @@ static void stop_all_lwps() for (i = 0; i < max_lwps; i++) last_ids[i] = 0; continue; - } + } if (syscall(SYS_ioctl, GC_main_proc_fd, PIOCLWPIDS, GC_current_ids) < 0) ABORT("PIOCLWPIDS failed"); changed = FALSE; @@ -803,6 +810,7 @@ void GC_thr_init(void) { GC_thread t; thread_t tid; + int ret; if (GC_thr_initialized) return; @@ -820,9 +828,11 @@ void GC_thr_init(void) t = GC_new_thread(thr_self()); t -> stack_size = 0; t -> flags = DETACHED | CLIENT_OWNS_STACK; - if (thr_create(0 /* stack */, 0 /* stack_size */, GC_thr_daemon, - 0 /* arg */, THR_DETACHED | THR_DAEMON, - &tid /* thread_id */) != 0) { + ret = thr_create(0 /* stack */, 0 /* stack_size */, GC_thr_daemon, + 0 /* arg */, THR_DETACHED | THR_DAEMON, + &tid /* thread_id */); + if (ret != 0) { + GC_err_printf1("Thr_create returned %ld\n", ret); ABORT("Cant fork daemon"); } thr_setprio(tid, 126);