github.com/hugh712/snapd@v0.0.0-20200910133618-1a99902bd583/cmd/system-shutdown/system-shutdown-utils.h (about) 1 /* 2 * Copyright (C) 2016 Canonical Ltd 3 * 4 * This program is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License version 3 as 6 * published by the Free Software Foundation. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * GNU General Public License for more details. 12 * 13 * You should have received a copy of the GNU General Public License 14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * 16 */ 17 18 #ifndef SYSTEM_SHUTDOWN_UTILS_H 19 #define SYSTEM_SHUTDOWN_UTILS_H 20 21 #include <stdbool.h> 22 #include <stddef.h> // size_t 23 24 // tries to umount all (well, most) things. Returns whether in the last pass it 25 // no longer found writable. 26 bool umount_all(void); 27 28 __attribute__((format(printf, 1, 2))) 29 void kmsg(const char *fmt, ...); 30 31 // Reads a possible argument for reboot syscall in /run/systemd/reboot-param, 32 // which is the place where systemd stores it. 33 int sc_read_reboot_arg(char *arg, size_t max_size); 34 35 #endif