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 your 00008 * option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful,but WITHOUT 00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License 00013 * 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 #include <libexplain/ac/sys/ioctl.h> 00020 #include <libexplain/ac/errno.h> 00021 #include <libexplain/ac/linux/ext2_fs.h> 00022 00023 #include <libexplain/buffer/does_not_have_inode_modify_permission.h> 00024 #include <libexplain/iocontrol/generic.h> 00025 #include <libexplain/iocontrol/ext2_ioc_setrsvsz.h> 00026 00027 #ifdef EXT2_IOC_SETRSVSZ 00028 00029 00030 static void 00031 print_explanation(const explain_iocontrol_t *p, explain_string_buffer_t *sb, int 00032 errnum, int fildes, int request, const void *data) 00033 { 00034 switch (errnum) 00035 { 00036 case EFAULT: 00037 goto generic; 00038 00039 case EACCES: 00040 explain_buffer_does_not_have_inode_modify_permission_fd 00041 ( 00042 sb, 00043 fildes, 00044 "fildes" 00045 ); 00046 break; 00047 00048 case ENOTTY: 00049 goto generic; 00050 00051 default: 00052 generic: 00053 explain_iocontrol_generic_print_explanation 00054 ( 00055 p, 00056 sb, 00057 errnum, 00058 fildes, 00059 request, 00060 data 00061 ); 00062 break; 00063 } 00064 } 00065 00066 00067 const explain_iocontrol_t explain_iocontrol_ext2_ioc_setrsvsz = 00068 { 00069 "EXT2_IOC_SETRSVSZ", /* name */ 00070 EXT2_IOC_SETRSVSZ, /* value */ 00071 0, /* disambiguate */ 00072 0, /* print_name */ 00073 explain_iocontrol_generic_print_data_int_star, /* print_data */ 00074 print_explanation, 00075 0, /* print_data_returned */ 00076 sizeof(int), /* data_size */ 00077 "int *", /* data_type */ 00078 IOCONTROL_FLAG_SIZE_DOES_NOT_AGREE, /* flags */ 00079 __FILE__, 00080 __LINE__, 00081 }; 00082 00083 #else /* ndef EXT2_IOC_SETRSVSZ */ 00084 00085 const explain_iocontrol_t explain_iocontrol_ext2_ioc_setrsvsz = 00086 { 00087 0, /* name */ 00088 0, /* value */ 00089 0, /* disambiguate */ 00090 0, /* print_name */ 00091 0, /* print_data */ 00092 0, /* print_explanation */ 00093 0, /* print_data_returned */ 00094 0, /* data_size */ 00095 0, /* data_type */ 00096 0, /* flags */ 00097 __FILE__, 00098 __LINE__, 00099 }; 00100 00101 #endif /* EXT2_IOC_SETRSVSZ */ 00102 00103 00104 /* vim: set ts=8 sw=4 et : */