in reply to Lightweight Solution To "Only 1 Process Running" On AIX

fcntl on EBADF:

The argument cmd is F_SETLK or F_SETLKW, the type of lock (l_type) is an exclusive lock (F_WRLCK), and fd is not a valid file descriptor open for writing.

Open the file for write access.

- tye        

  • Comment on Re: Lightweight Solution To "Only 1 Process Running" On AIX (access)

Replies are listed 'Best First'.
Re^2: Lightweight Solution To "Only 1 Process Running" On AIX (access)
by Limbic~Region (Chancellor) on May 01, 2009 at 16:59 UTC
    tye,
    Thanks but opening $0 for write access seems like a bad idea :-)

    almut provided the /dev/null solution to do the same thing though.

    Cheers - L~R

      Actually, the /dev/null solution I initially suggested is a bad idea :)  because you could only ever have one such program per system...

      Based on your response, I'm guessing that you are thinking of ">", which is "write access and create/truncate". There are lots of other ways to get write access to a file.

      - tye