File locks on ReliantUnix 5.45b

All topics related to Software & Operating systems
raj123

File locks on ReliantUnix 5.45b

Postby raj123 » Tue Oct 16, 2001 14:25

Hi,<BR>I created a remote server which accepts and receives messages. I use a configuration file which is referred by this server each time you start the server. This remote server comprises of severel POSIX threads.In my program I am trying to use "flockfile" and "funlockfile" over the configuration file. I compiled my program with "-K pthread" option. The program control successfully locks the file but when it tries to unlock the file, it gives the following error:<BR> internal error in pthread_mutex_unlock.<BR> Invalid argument.<P>Just to confirm this error, I wrote the following test program.<P>#include<iostream.h><BR>#include<stdio.h><BR>int main()<BR>{<BR> FILE *fp=NULL;<BR> fp=fopen("test.cpp","r+");<BR> cout<<"Locking the file ..."<<endl;<BR> ftrylockfile(fp);<BR> cout<<"Unlocking the file ..."<<endl;<BR> funlockfile(fp);<BR> return(0);<BR>}<P>When I compile this program without any thread option, it locks and unlocks the file successfully. But, when I try to compile with the "-K pthread" option, it gives the same error message.<P>Anyone have seen this problem before? please <BR>help me out. <BR>

Return to “Software & Operating systems (archive)”

Who is online

Users browsing this forum: No registered users and 3 guests