VMS Help  —  CRTL  ftrylockfile
    Acquires ownership of a stdio (FILE*) object.

    This function is supported on OpenVMS Integrity servers and
    Alpha only.

    Format

      #include  <stdio.h>

      int ftrylockfile  (FILE *file_ptr);

1  –  Argument

 file_ptr

    A file pointer.

2  –  Description

    The ftrylockfile function is used by a thread to acquire
    ownership of a stdio (FILE*) object, if the object is available.
    The ftrylockfile function is a non-blocking version of flockfile.

    The ftrylockfile function returns zero for success and nonzero to
    indicate that the lock cannot be acquired.

    See also flockfile and funlockfile.

3  –  Return Values

    0                  Indicates success.
    nonzero            Indicates the lock cannot be acquired.
Close Help