1 /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
2 * vim: ts=4 sw=4 noet ai cindent syntax=c
4 * Conky, a system monitor, based on torsmo
6 * Any original torsmo code is licensed under the BSD license
8 * All code written since the fork of torsmo is licensed under the GPL
10 * Please see COPYING for details
12 * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
14 * All rights reserved.
16 * This program is free software: you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation, either version 3 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
30 /* doesn't work, feel free to finish this */
35 static kstat_ctl_t *kstat;
36 static int kstat_updated;
38 static void update_kstat()
43 NORM_ERR("can't open kstat: %s", strerror(errno));
47 if (kstat_chain_update(kstat) == -1) {
48 perror("kstat_chain_update");
64 ksp = kstat_lookup(kstat, "unix", -1, "system_misc");
66 if (kstat_read(kstat, ksp, NULL) >= 0) {
69 knp = (kstat_named_t *) kstat_data_lookup(ksp, "boot_time");
71 return get_time() - (double) knp->value.ui32;
82 int check_mount(char *s)