]>
Commit | Line | Data |
---|---|---|
d0b48809 LP |
1 | /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ |
2 | ||
3 | #ifndef foosdreadaheadhfoo | |
4 | #define foosdreadaheadhfoo | |
5 | ||
6 | /*** | |
7 | Copyright 2010 Lennart Poettering | |
8 | ||
9 | Permission is hereby granted, free of charge, to any person | |
10 | obtaining a copy of this software and associated documentation files | |
11 | (the "Software"), to deal in the Software without restriction, | |
12 | including without limitation the rights to use, copy, modify, merge, | |
13 | publish, distribute, sublicense, and/or sell copies of the Software, | |
14 | and to permit persons to whom the Software is furnished to do so, | |
15 | subject to the following conditions: | |
16 | ||
17 | The above copyright notice and this permission notice shall be | |
18 | included in all copies or substantial portions of the Software. | |
19 | ||
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |
21 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |
23 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | |
24 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | |
25 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
26 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
27 | SOFTWARE. | |
28 | ***/ | |
29 | ||
30 | #ifdef __cplusplus | |
31 | extern "C" { | |
32 | #endif | |
33 | ||
34 | /* | |
35 | Reference implementation of a few boot readahead related | |
36 | interfaces. These interfaces are trivial to implement. To simplify | |
37 | porting we provide this reference implementation. Applications are | |
38 | welcome to reimplement the algorithms described here if they do not | |
39 | want to include these two source files. | |
40 | ||
41 | You may compile this with -DDISABLE_SYSTEMD to disable systemd | |
42 | support. This makes all calls NOPs. | |
43 | ||
44 | Since this is drop-in code we don't want any of our symbols to be | |
45 | exported in any case. Hence we declare hidden visibility for all of | |
46 | them. | |
47 | ||
48 | You may find an up-to-date version of these source files online: | |
49 | ||
50 | http://cgit.freedesktop.org/systemd/plain/src/sd-readahead.h | |
51 | http://cgit.freedesktop.org/systemd/plain/src/sd-readahead.c | |
52 | ||
53 | This should compile on non-Linux systems, too, but all functions | |
54 | will become NOPs. | |
55 | ||
56 | See sd-readahead(7) for more information. | |
57 | */ | |
58 | ||
59 | #ifndef _sd_hidden_ | |
60 | #if (__GNUC__ >= 4) && !defined(SD_EXPORT_SYMBOLS) | |
61 | #define _sd_hidden_ __attribute__ ((visibility("hidden"))) | |
62 | #else | |
63 | #define _sd_hidden_ | |
64 | #endif | |
65 | #endif | |
66 | ||
67 | /* | |
68 | Controls ongoing disk read-ahead operations during boot-up. The argument | |
69 | must be a string, and either "cancel", "done" or "noreplay". | |
70 | ||
71 | cancel = terminate read-ahead data collection, drop collected information | |
72 | done = terminate read-ahead data collection, keep collected information | |
73 | noreplay = terminate read-ahead replay | |
74 | */ | |
75 | int sd_readahead(const char *action) _sd_hidden_; | |
76 | ||
77 | #ifdef __cplusplus | |
78 | } | |
79 | #endif | |
80 | ||
81 | #endif |