libsmbclient threadsafeness

Michael B Allen mba2000 at
Thu Oct 21 03:37:17 GMT 2004

Igor Belyi said:
> Well.. I was refering to 'errno' which is used as an error reason in
> convert_string_allocate and as an error indicator in smb_iconv(). Global
> variables are not very friendly in multithreaded environment.

No, errno is a per-thread variable. Technically I believe _REENTRANT must
be defined but virtually a C library implementations implement errno as a
macro for a function that retrieves errno from a per-thread location. IOW
errno is thread safe.


More information about the samba-technical mailing list