libexplain
1.4.D001
|
00001 /* 00002 * libexplain - Explain errno values returned by libc functions 00003 * Copyright (C) 2009, 2011, 2013 Peter Miller 00004 * 00005 * This program is free software; you can redistribute it and/or modify it 00006 * under the terms of the GNU Lesser General Public License as published by 00007 * the Free Software Foundation; either version 3 of the License, or (at 00008 * your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful,but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty 00012 * ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNULesser 00013 * General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #ifndef LIBEXPLAIN_USTAT_H 00020 #define LIBEXPLAIN_USTAT_H 00021 00030 #include <libexplain/gcc_attributes.h> 00031 #include <libexplain/large_file_support.h> 00032 00033 /* 00034 * Note: including <ustat.h> or <sys/ustat.h> here is most unwise, 00035 * because there is a bug on older versions of linux where it also 00036 * defines struct ustat in <linux/types.h> making it horribly difficult 00037 * to use a naked 00038 * 00039 * #include <ustat.h> 00040 * 00041 * at this point in this source file. If the pid_t arguments are a 00042 * problem, we may have to consider makeing them int in future. 00043 */ 00044 00045 #ifdef __cplusplus 00046 extern "C" { 00047 #endif 00048 00049 struct ustat; /* forward */ 00050 00075 void explain_ustat_or_die(dev_t dev, struct ustat *data); 00076 00102 int explain_ustat_on_error(dev_t dev, struct ustat *data); 00103 00144 const char *explain_ustat(dev_t dev, struct ustat *data) 00145 LIBEXPLAIN_WARN_UNUSED_RESULT; 00146 00192 const char *explain_errno_ustat(int errnum, dev_t dev, struct ustat *data) 00193 LIBEXPLAIN_WARN_UNUSED_RESULT; 00194 00234 void explain_message_ustat(char *message, int message_size, dev_t dev, struct 00235 ustat *data); 00236 00280 void explain_message_errno_ustat(char *message, int message_size, int errnum, 00281 dev_t dev, struct ustat *data); 00282 00283 #ifdef __cplusplus 00284 } 00285 #endif 00286 00287 /* vim: set ts=8 sw=4 et : */ 00288 #endif /* LIBEXPLAIN_USTAT_H */