Debian Codegraph @

share/libc/sys/file.h

raw
1 /**************************************************************************/
2 /* */
3 /* This file is part of Frama-C. */
4 /* */
5 /* Copyright (C) 2007-2022 */
6 /* CEA (Commissariat à l'énergie atomique et aux énergies */
7 /* alternatives) */
8 /* */
9 /* you can redistribute it and/or modify it under the terms of the GNU */
10 /* Lesser General Public License as published by the Free Software */
11 /* Foundation, version 2.1. */
12 /* */
13 /* It is distributed in the hope that it will be useful, */
14 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
15 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
16 /* GNU Lesser General Public License for more details. */
17 /* */
18 /* See the GNU Lesser General Public License version 2.1 */
19 /* for more details (enclosed in the file licenses/LGPLv2.1). */
20 /* */
21 /**************************************************************************/
22
23 #ifndef __FC_SYS_FILE_H__
24 #define __FC_SYS_FILE_H__
25
26 #include "../features.h"
27 __PUSH_FC_STDLIB
28 __BEGIN_DECLS
29
30 // Note: this file is not C11 nor POSIX, but Linux-specific.
31 // The values for the constants below are based on the glibc.
32
33 #define L_SET 0
34 #define L_INCR 1
35 #define L_XTND 2
36
37 #define LOCK_SH 1
38 #define LOCK_EX 2
39 #define LOCK_UN 8
40
41 #define LOCK_NB 4
42
43 /*@ // missing: may assign errno to EBADF, EINTR, EINVAL, ENOLCK, EWOULDBLOCK
44 // missing: assigns \result, 'filesystem' \from 'filesystem'
45 assigns \result \from indirect:fd, indirect:operation;
46 ensures result_ok_or_error: \result == 0 || \result == -1;
47 */
48 extern int flock(int fd, int operation);
49
50 __END_DECLS
51 __POP_FC_STDLIB
52 #endif