[pgpool-hackers: 134] pgpool build fails on Solaris

Ibrar Ahmed ibrar.ahmad at gmail.com
Mon Sep 24 23:17:11 JST 2012


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20120924/3b8ef8b4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgpool_lockf_ibrar_v3.patch
Type: application/octet-stream
Size: 1873 bytes
Desc: not available
URL: <http://www.sraoss.jp/pipermail/pgpool-hackers/attachments/20120924/3b8ef8b4/attachment.obj>


More information about the pgpool-hackers mailing list