1 /* Conky, a system monitor, based on torsmo
3 * Any original torsmo code is licensed under the BSD license
5 * All code written since the fork of torsmo is licensed under the GPL
7 * Please see COPYING for details
9 * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
11 * All rights reserved.
13 * This program is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27 /* doesn't work, feel free to finish this */
32 static kstat_ctl_t *kstat;
33 static int kstat_updated;
35 static void update_kstat()
40 ERR("can't open kstat: %s", strerror(errno));
44 if (kstat_chain_update(kstat) == -1) {
45 perror("kstat_chain_update");
61 ksp = kstat_lookup(kstat, "unix", -1, "system_misc");
63 if (kstat_read(kstat, ksp, NULL) >= 0) {
66 knp = (kstat_named_t *) kstat_data_lookup(ksp, "boot_time");
68 return get_time() - (double) knp->value.ui32;
79 int check_mount(char *s)