blob: 566204fb6f0681e9613b1f25f51fe100fb4f677f [file] [log] [blame]
yaberauneyaef772532009-10-09 17:55:43 +00001dnl
2dnl Copyright (c) Cisco Systems, Inc, 2008
3dnl
4dnl This program is free software; you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 2 of the License, or
7dnl (at your option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
12dnl the GNU General Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License
15dnl along with this program; if not, write to the Free Software
Wanlong Gao4548c6c2012-10-19 18:03:36 +080016dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
yaberauneyaef772532009-10-09 17:55:43 +000017dnl
18
19dnl
20dnl LTP_CHECK_SYSCALL_QUOTACTL
21dnl ----------------------------
22dnl
Garrett Cooperba9c59b2010-11-24 00:44:59 -080023AC_DEFUN([LTP_CHECK_SYSCALL_QUOTACTL],[dnl
24 AC_LINK_IFELSE([AC_LANG_SOURCE([
Chris Dearman37550cf2012-10-17 19:54:01 -070025#define _LINUX_QUOTA_VERSION 2
yaberauneyaef772532009-10-09 17:55:43 +000026#include <sys/types.h>
yaberauneya88fe99f2010-01-10 21:10:56 +000027#include <sys/quota.h>
Garrett Cooperc23c3512010-11-16 09:07:08 -080028#include <unistd.h>
29int main(void) {
yaberauneya88fe99f2010-01-10 21:10:56 +000030 struct dqblk dq;
yaberauneya7ed9a6c2010-01-20 11:31:39 +000031 return quotactl(QCMD(Q_GETINFO, USRQUOTA), (const char *) "/dev/null",
32 geteuid(), (caddr_t) &dq);
Garrett Cooperba9c59b2010-11-24 00:44:59 -080033}])],[has_quotav2="yes"])
34
35if test "x$has_quotav2" = xyes; then
36 AC_DEFINE(HAVE_QUOTAV2,1,[Define to 1 if you have quota v2])
37else
38
39 # got quota v1?
40 AC_LINK_IFELSE([AC_LANG_SOURCE([
yaberauneya7ed9a6c2010-01-20 11:31:39 +000041#define _LINUX_QUOTA_VERSION 1
42#include <sys/types.h>
43#include <sys/quota.h>
Garrett Cooperc23c3512010-11-16 09:07:08 -080044#include <unistd.h>
45int main(void) {
yaberauneya7ed9a6c2010-01-20 11:31:39 +000046 struct dqblk dq;
47 return quotactl(QCMD(Q_GETQUOTA, USRQUOTA), (const char *) "/dev/null",
48 geteuid(), (caddr_t) &dq);
Garrett Cooperba9c59b2010-11-24 00:44:59 -080049}])],[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-list@lists.sourceforge.net))
55 fi
56
yaberauneyaef772532009-10-09 17:55:43 +000057fi
Garrett Cooperba9c59b2010-11-24 00:44:59 -080058])