From 6d72cb73262497cf55d41cee3cd4b0d27e219484 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 21 Jul 2010 09:59:39 -0700 Subject: [PATCH 1/2] Fix pthread stack size on 32-bit platforms For some reason which remains mysterious to me the shared library which calls pthread_create() must be linked with -pthread. If this is not done on 32-bit system the default ulimit stack size is used. Surprisingly, on a 64-bit system the stack limit specified by the pthread_attr is honored even when -pthread is not passed when linking the shared library. --- lib/libzpool/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am index 5e9d97b05d..744dbfce30 100644 --- a/lib/libzpool/Makefile.am +++ b/lib/libzpool/Makefile.am @@ -153,3 +153,5 @@ libzpool_la_SOURCES = \ ${top_srcdir}/module/zfs/include/sys/fm/protocol.h \ ${top_srcdir}/module/zfs/include/sys/fm/util.h \ ${top_srcdir}/module/zfs/include/sys/fm/fs/zfs.h + +libzpool_la_LDFLAGS = -pthread From 75d868af704b40a107106d00d52b958616766232 Mon Sep 17 00:00:00 2001 From: Ned Bass Date: Wed, 21 Jul 2010 09:58:54 -0700 Subject: [PATCH 2/2] Fixed typo that set thread STACK_SIZE to 24k instead of 8k __linux__ was mispelled as _linux_ so #ifdef was always selecting the Solaris STACK_SIZE value. Signed-off-by: Brian Behlendorf --- lib/libzpool/include/sys/zfs_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h index b0112e6ec4..f837440c06 100644 --- a/lib/libzpool/include/sys/zfs_context.h +++ b/lib/libzpool/include/sys/zfs_context.h @@ -199,7 +199,7 @@ _NOTE(CONSTCOND) } while (0) */ #define TS_MAGIC 0x72f158ab4261e538ull #define TS_RUN 0x00000002 -#ifdef _linux_ +#ifdef __linux__ #define STACK_SIZE 8192 /* Linux x86 and amd64 */ #else #define STACK_SIZE 24576 /* Solaris */