Link to home
Start Free TrialLog in
Avatar of checkin
checkin

asked on

File Locking on Solaris

Hi !

I am trying to use file locking under Solaris 2.51 on a Sun Ultra machine.  I can not get it to compile, I have included all the required header files.  The only thing that I am not sure of is if I am suppose to put some linking in my Makefile

My call to flock is :-

  FILE fp;
  .....
  flock(fp,LOCK_EX);

flock is shown as an undefined symbol.

Please could anybody help.

Marvin.
Avatar of viktornet
viktornet
Flag of United States of America image

Do you have the source code for the flock() function? I didn't find it in my function listings...

-Viktor
--Ivanov
ASKER CERTIFIED SOLUTION
Avatar of mih
mih
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of checkin
checkin

ASKER

The compiler I use is gcc.  I tried linking the ucb file in, it compiled ad linked but just died when trying to run it but no core dump.
I'm a little confused by your program dying without a core-dump. What do you mean by dying? Did it hang? Did you get any error code at all?

Make sure you set your coredump size to be unlimited (use the following command):
limit coredumpsize unlimited

If you can give me a little more of your code, I might be able to help some more.
Have you got access to a debugger?