]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/generic/dl-fileid.h
a7e2fcdfb7d77670e0e66ff4c0f3bc1a15663212
[thirdparty/glibc.git] / sysdeps / generic / dl-fileid.h
1 /* File identity for the dynamic linker. Stub version.
2 Copyright (C) 2015-2018 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
18
19 #include <stdbool.h>
20
21 /* This type stores whatever information is fetched by _dl_get_file_id
22 and compared by _dl_file_id_match_p. */
23 struct r_file_id
24 {
25 /* In the stub version, we don't record anything at all. */
26 };
27
28 /* Sample FD to fill in *ID. Returns true on success.
29 On error, returns false, with errno set. */
30 static inline bool
31 _dl_get_file_id (int fd __attribute__ ((unused)),
32 struct r_file_id *id __attribute__ ((unused)))
33 {
34 return true;
35 }
36
37 /* Compare two results from _dl_get_file_id for equality.
38 It's crucial that this never return false-positive matches.
39 It's ideal that it never return false-negative mismatches either,
40 but lack of matches is survivable. */
41 static inline bool
42 _dl_file_id_match_p (const struct r_file_id *a __attribute__ ((unused)),
43 const struct r_file_id *b __attribute__ ((unused)))
44 {
45 return false;
46 }