ftrylockfile()

Acquire ownership of a file, without blocking

Synopsis:

#include <stdio.h>

int ftrylockfile( FILE* file );

Since:

BlackBerry 10.0.0

Arguments:

file
A pointer to the FILE object for the file you want to lock.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The ftrylockfile() function is used by a thread to acquire ownership of a FILE if the object is available; ftrylockfile() is a nonblocking version of flockfile(). To unlock the file, call funlockfile().

Returns:

0
Success.
Nonzero
The lock can't be acquired.

Classification:

POSIX 1003.1 TSF

Safety:  
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

Last modified: 2014-06-24



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus