1 dnl 2 dnl Copyright (c) Cisco Systems, Inc, 2008 3 dnl 4 dnl This program is free software; you can redistribute it and/or modify 5 dnl it under the terms of the GNU General Public License as published by 6 dnl the Free Software Foundation; either version 2 of the License, or 7 dnl (at your option) any later version. 8 dnl 9 dnl This program is distributed in the hope that it will be useful, 10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of 11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 12 dnl the GNU General Public License for more details. 13 dnl 14 dnl You should have received a copy of the GNU General Public License 15 dnl along with this program; if not, write to the Free Software 16 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 dnl 18 19 dnl 20 dnl LTP_CHECK_SYSCALL_QUOTACTL 21 dnl ---------------------------- 22 dnl 23 AC_DEFUN([LTP_CHECK_SYSCALL_QUOTACTL],[dnl 24 AC_LINK_IFELSE([AC_LANG_SOURCE([ 25 #define _LINUX_QUOTA_VERSION 2 26 #include <sys/types.h> 27 #include <sys/quota.h> 28 #include <unistd.h> 29 int main(void) { 30 struct dqblk dq; 31 return quotactl(QCMD(Q_GETINFO, USRQUOTA), (const char *) "/dev/null", 32 geteuid(), (caddr_t) &dq); 33 }])],[has_quotav2="yes"]) 34 35 if test "x$has_quotav2" = xyes; then 36 AC_DEFINE(HAVE_QUOTAV2,1,[Define to 1 if you have quota v2]) 37 else 38 39 # got quota v1? 40 AC_LINK_IFELSE([AC_LANG_SOURCE([ 41 #define _LINUX_QUOTA_VERSION 1 42 #include <sys/types.h> 43 #include <sys/quota.h> 44 #include <unistd.h> 45 int main(void) { 46 struct dqblk dq; 47 return quotactl(QCMD(Q_GETQUOTA, USRQUOTA), (const char *) "/dev/null", 48 geteuid(), (caddr_t) &dq); 49 }])],[has_quotav1="yes"]) 50 51 if test "x$has_quotav1" = xyes; then 52 AC_DEFINE(HAVE_QUOTAV1,1,[Define to 1 if you have quota v1]) 53 else 54 AC_MSG_WARN(Couldn't determine quota version (please submit config.log and manpage to ltp (a] lists.linux.it)) 55 fi 56 57 fi 58 ]) 59