[pgpool-hackers: 135] Re: pgpool build fails on Solaris
Tatsuo Ishii
ishii at postgresql.org
Fri Sep 28 16:10:44 JST 2012
Thanks. I have tested on a Linux box and it seems runs well. I'm going
to commit and push to master and 3.2-stable tree.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp
> Hi,
>
> Solaris build was failing due to missing flock function. In Solaris
> there is another equivalent function named lockf. Looking at the man
> pages of flock and lockf, they are implemented somewhat differently on
> Linux.
>
> The lockf() only works if the file descriptor was opened for write access.
> The call to lockf( ) should work from within pool_add_table_oid_map( )
> because in that case, the file is opened with O_RDWR. But the call from
> pool_invalidate_query_cache() will fail because that file is opened with
> O_RDONLY.
>
> In my opinion we should use fcntl function instead of lockf and flock.
> I have attached a patch please review.
>
>
> --ibrar
>
>
>>* I have the same problem on Solaris 10 x86, it seems to be a global problem with pgpool 3.2 on Solaris platforms, because there is no flock functions on Solaris, but only in "BSD Compatibility Library Functions" (/usr/ucblib/libucb.a)*
>
>>* *>* According to the manual of flock:*>* "Use of these interfaces should be restricted to only appli-*>* cations written on BSD platforms. Use of these interfaces*>* with any of the system libraries or in multi-thread applica-*>* tions is unsupported."*>* *>* Afaik the right solutions of file locking in Solaris is to use lockf(3C) function http://www.s-gms.ms.edus.si/cgi-bin/man-cgi?lockf+3C*
>> Anybody volunteers to write a patch using lockf() for Solaris?
More information about the pgpool-hackers
mailing list