samba shares access issue in Solaris from a MT program

David Collier-Brown davec-b at rogers.com
Thu Sep 30 23:45:47 GMT 2004


Richard Sharpe wrote:
> On Tue, 28 Sep 2004, Sean McGrath - Sun Microsystems Ireland wrote:
> 
> 
>> Really needs the change in configure/autoconf, something like:
>>
>>$ diff -u configure configure.new
>>--- configure   Wed Sep 22 16:29:40 2004
>>+++ configure.new       Tue Sep 28 17:35:10 2004
>>@@ -3553,7 +3553,8 @@
>>                                rm -fr conftest.c
>>                                case "$ac_cv_gcc_compiler_version_number" in
>>                                        *"gcc version 2.6"*|*"gcc version 2.7"*)
>>-                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
>>+                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE -D_REENTRANT"
>>+                                               LDFLAGS="$LDFLAGS -lthread"
>>
>> cat >>confdefs.h <<\_ACEOF
>> #define _LARGEFILE64_SOURCE 1
>>@@ -3561,7 +3562,8 @@
>>
>>                                                ;;
>>                                        *)
>>-                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
>>+                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT"
>>+                                               LDFLAGS="$LDFLAGS -lthread"
>>
>> cat >>confdefs.h <<\_ACEOF
>> #define _LARGEFILE64_SOURCE 1
>>@@ -3575,7 +3577,8 @@
>>                                                ;;
>>                                esac
>>                        else
>>-                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
>>+                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT"
>>+                               LDFLAGS="$LDFLAGS -lthread"
>>
>> cat >>confdefs.h <<\_ACEOF
>> #define _LARGEFILE64_SOURCE 1
>>
>>
>>Perhaps.  Though as Dave suggests, the configure guru can correct this :)
> 
> 
> OK, I believe I know where to fix this in configure.in, but, remind me
> again why we need to do this?
> 
> In particular, why would we restrict this to Solaris?

	This applies to Solaris because of the different thread model
	it uses, quite different from Linux.  The thread-safe errno
	is turned on by -D_REENTRANT, allowing the library to be
	used (given appropriate locking) with Gnome. In principle,
	this applies to any samba library which is properly protected
	by locks in the caller, as is the case in Gnome.

--dave
-- 
David Collier-Brown,         | Always do right. This will gratify
Software Engineer and Author | some people and astonish the rest
davecb at spamcop.net           |                      -- Mark Twain



More information about the samba-technical mailing list