summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/cgo/linux_386.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/runtime/cgo/linux_386.c')
-rw-r--r--src/pkg/runtime/cgo/linux_386.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pkg/runtime/cgo/linux_386.c b/src/pkg/runtime/cgo/linux_386.c
index 00322d4b7..e9df5ffdc 100644
--- a/src/pkg/runtime/cgo/linux_386.c
+++ b/src/pkg/runtime/cgo/linux_386.c
@@ -21,6 +21,7 @@ libcgo_sys_thread_start(ThreadStart *ts)
pthread_attr_t attr;
pthread_t p;
size_t size;
+ int err;
// Not sure why the memset is necessary here,
// but without it, we get a bogus stack size
@@ -30,7 +31,11 @@ libcgo_sys_thread_start(ThreadStart *ts)
size = 0;
pthread_attr_getstacksize(&attr, &size);
ts->g->stackguard = size;
- pthread_create(&p, &attr, threadentry, ts);
+ err = pthread_create(&p, &attr, threadentry, ts);
+ if (err != 0) {
+ fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
+ abort();
+ }
}
static void*