1explain_flock_or_die(3)    Library Functions Manual    explain_flock_or_die(3)
2
3
4

NAME

6       explain_flock_or_die  -  control  advisory lock on open file and report
7       errors
8

SYNOPSIS

10       #include <libexplain/flock.h>
11       void explain_flock_or_die(int fildes, int command);
12       int explain_flock_on_error(int fildes, int command))
13

DESCRIPTION

15       The explain_flock_or_die function is used to call the  flock(2)  system
16       call.  On  failure  an  explanation will be printed to stderr, obtained
17       from the explain_flock(3) function, and then the process terminates  by
18       calling exit(EXIT_FAILURE).
19
20       The explain_flock_on_error function is used to call the flock(2) system
21       call. On failure an explanation will be  printed  to  stderr,  obtained
22       from the explain_flock(3) function, but still returns to the caller.
23
24       fildes  The  fildes,  exactly  as  to  be passed to the flock(2) system
25               call.
26
27       command The command, exactly as to be passed  to  the  flock(2)  system
28               call.
29

RETURN VALUE

31       The explain_flock_or_die function only returns on success, see flock(2)
32       for more information. On failure, prints an explanation and  exits,  it
33       does not return.
34
35       The  explain_flock_on_error function always returns the value return by
36       the wrapped flock(2) system call.
37

EXAMPLE

39       The explain_flock_or_die function is intended to be used in  a  fashion
40       similar to the following example:
41              explain_flock_or_die(fildes, command);
42

SEE ALSO

44       flock(2)
45               apply or remove an advisory lock on an open file
46
47       explain_flock(3)
48               explain flock(2) errors
49
50       exit(2) terminate the calling process
51
53       libexplain version 1.4
54       Copyright (C) 2009 Peter Miller
55
56
57
58                                                       explain_flock_or_die(3)
Impressum