2 dnl Copyright (c) Cisco Systems, Inc, 2008
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.
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.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl LTP_CHECK_SYSCALL_QUOTACTL
21 dnl ----------------------------
23 AC_DEFUN([LTP_CHECK_SYSCALL_QUOTACTL],[AC_TRY_COMPILE([
24 #include <linux/quota.h>
26 #include <linux/dqblk_v1.h>
27 #include <linux/dqblk_v2.h>
28 #include <unistd.h>],[
30 return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL);
31 }],[has_rhel46_quotactl="yes"],[AC_TRY_COMPILE([
32 #include <sys/quota.h>
34 #include <linux/dqblk_v1.h>
35 #include <linux/dqblk_v2.h>
36 #include <unistd.h>],[
38 return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL);
39 }],[has_rhel48_quotactl="yes"],[AC_TRY_COMPILE([
40 #include <sys/types.h>
41 #include <sys/quota.h>
42 #include <unistd.h>],[
44 return quotactl(Q_GETINFO, (const char *)NULL, geteuid(), (caddr_t)NULL);
45 }],[has_new_minimal_quotactl="yes"],[AC_MSG_WARN([Couldn't find functional copy of quotactl])])])])
46 if test "x$has_rhel46_quotactl" = "xyes"; then
47 AC_DEFINE(HAS_RHEL46_QUOTACTL,1,[Define to 1 if you have the RHEL ~4.6 version of quotactl, e.g. require linux/quota.h instead of sys/quota.h])
48 elif test "x$has_rhel48_quotactl" = "xyes"; then
49 AC_DEFINE(HAS_RHEL48_QUOTACTL,1,[Define to 1 if you have the RHEL 4.8+ version of quotactl, e.g. require sys/quota.h instead of sys/quota.h])
50 elif test "x$has_new_minimal_quotactl" = "xyes"; then
51 AC_DEFINE(HAS_NEW_MINIMAL_QUOTACTL,1,[Define to 1 if you have the new implementation of quotactl that only requires sys/types.h and sys/quota.h])