yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 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 |
Wanlong Gao | 4548c6c | 2012-10-19 18:03:36 +0800 | [diff] [blame] | 16 | dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 17 | dnl |
| 18 | |
| 19 | dnl |
| 20 | dnl LTP_CHECK_SYSCALL_QUOTACTL |
| 21 | dnl ---------------------------- |
| 22 | dnl |
Garrett Cooper | ba9c59b | 2010-11-24 00:44:59 -0800 | [diff] [blame] | 23 | AC_DEFUN([LTP_CHECK_SYSCALL_QUOTACTL],[dnl |
| 24 | AC_LINK_IFELSE([AC_LANG_SOURCE([ |
Chris Dearman | 37550cf | 2012-10-17 19:54:01 -0700 | [diff] [blame] | 25 | #define _LINUX_QUOTA_VERSION 2 |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 26 | #include <sys/types.h> |
yaberauneya | 88fe99f | 2010-01-10 21:10:56 +0000 | [diff] [blame] | 27 | #include <sys/quota.h> |
Garrett Cooper | c23c351 | 2010-11-16 09:07:08 -0800 | [diff] [blame] | 28 | #include <unistd.h> |
| 29 | int main(void) { |
yaberauneya | 88fe99f | 2010-01-10 21:10:56 +0000 | [diff] [blame] | 30 | struct dqblk dq; |
yaberauneya | 7ed9a6c | 2010-01-20 11:31:39 +0000 | [diff] [blame] | 31 | return quotactl(QCMD(Q_GETINFO, USRQUOTA), (const char *) "/dev/null", |
| 32 | geteuid(), (caddr_t) &dq); |
Garrett Cooper | ba9c59b | 2010-11-24 00:44:59 -0800 | [diff] [blame] | 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([ |
yaberauneya | 7ed9a6c | 2010-01-20 11:31:39 +0000 | [diff] [blame] | 41 | #define _LINUX_QUOTA_VERSION 1 |
| 42 | #include <sys/types.h> |
| 43 | #include <sys/quota.h> |
Garrett Cooper | c23c351 | 2010-11-16 09:07:08 -0800 | [diff] [blame] | 44 | #include <unistd.h> |
| 45 | int main(void) { |
yaberauneya | 7ed9a6c | 2010-01-20 11:31:39 +0000 | [diff] [blame] | 46 | struct dqblk dq; |
| 47 | return quotactl(QCMD(Q_GETQUOTA, USRQUOTA), (const char *) "/dev/null", |
| 48 | geteuid(), (caddr_t) &dq); |
Garrett Cooper | ba9c59b | 2010-11-24 00:44:59 -0800 | [diff] [blame] | 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-list@lists.sourceforge.net)) |
| 55 | fi |
| 56 | |
yaberauneya | ef77253 | 2009-10-09 17:55:43 +0000 | [diff] [blame] | 57 | fi |
Garrett Cooper | ba9c59b | 2010-11-24 00:44:59 -0800 | [diff] [blame] | 58 | ]) |