* [LTP] [PATCH] futex/futex_wake04.c: add kernel version check
@ 2015-07-07 7:10 Guangwen Feng
2015-07-22 3:13 ` Guangwen Feng
2015-07-22 7:40 ` Li Wang
0 siblings, 2 replies; 4+ messages in thread
From: Guangwen Feng @ 2015-07-07 7:10 UTC (permalink / raw)
To: ltp-list
Compilation failed on RHEL5U11GA because the flag MAP_HUGETLB of
mmap(2) are only available on kernels that are 2.6.32 or higher,
therefore add kernel version check, as well as add mmap.h to
define the flag in order to avoid compilation error.
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
---
include/lapi/mmap.h | 26 ++++++++++++++++++++++++++
testcases/kernel/syscalls/futex/futex_wake04.c | 7 +++++++
2 files changed, 33 insertions(+)
create mode 100644 include/lapi/mmap.h
diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h
new file mode 100644
index 0000000..e8e5917
--- /dev/null
+++ b/include/lapi/mmap.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2015 Fujitsu Ltd.
+ * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.
+ */
+
+#ifndef __LAPI_MMAP_H__
+#define __LAPI_MMAP_H__
+
+#ifndef MAP_HUGETLB
+#define MAP_HUGETLB 0x40000
+#endif
+
+#endif /* __LAPI_MMAP_H__ */
diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c b/testcases/kernel/syscalls/futex/futex_wake04.c
index 955b05e..fa98636 100644
--- a/testcases/kernel/syscalls/futex/futex_wake04.c
+++ b/testcases/kernel/syscalls/futex/futex_wake04.c
@@ -46,6 +46,7 @@
#include "safe_macros.h"
#include "futextest.h"
#include "futex_utils.h"
+#include "lapi/mmap.h"
#define PATH_MEMINFO "/proc/meminfo"
#define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages"
@@ -62,6 +63,12 @@ static long orig_hugepages;
static void setup(void)
{
tst_require_root(NULL);
+
+ if ((tst_kvercmp(2, 6, 32)) < 0) {
+ tst_brkm(TCONF, NULL, "This test can only run on kernels "
+ "that are 2.6.32 or higher");
+ }
+
tst_tmpdir();
SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages);
--
1.8.4.2
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] futex/futex_wake04.c: add kernel version check
2015-07-07 7:10 [LTP] [PATCH] futex/futex_wake04.c: add kernel version check Guangwen Feng
@ 2015-07-22 3:13 ` Guangwen Feng
2015-07-22 7:40 ` Li Wang
1 sibling, 0 replies; 4+ messages in thread
From: Guangwen Feng @ 2015-07-22 3:13 UTC (permalink / raw)
To: ltp-list
Hello,
ping.
Regards,
Guangwen Feng
On 07/07/2015 03:10 PM, Guangwen Feng wrote::
> Compilation failed on RHEL5U11GA because the flag MAP_HUGETLB of
> mmap(2) are only available on kernels that are 2.6.32 or higher,
> therefore add kernel version check, as well as add mmap.h to
> define the flag in order to avoid compilation error.
>
> Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> ---
> include/lapi/mmap.h | 26 ++++++++++++++++++++++++++
> testcases/kernel/syscalls/futex/futex_wake04.c | 7 +++++++
> 2 files changed, 33 insertions(+)
> create mode 100644 include/lapi/mmap.h
>
> diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h
> new file mode 100644
> index 0000000..e8e5917
> --- /dev/null
> +++ b/include/lapi/mmap.h
> @@ -0,0 +1,26 @@
> +/*
> + * Copyright (c) 2015 Fujitsu Ltd.
> + * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it would be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.
> + */
> +
> +#ifndef __LAPI_MMAP_H__
> +#define __LAPI_MMAP_H__
> +
> +#ifndef MAP_HUGETLB
> +#define MAP_HUGETLB 0x40000
> +#endif
> +
> +#endif /* __LAPI_MMAP_H__ */
> diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c b/testcases/kernel/syscalls/futex/futex_wake04.c
> index 955b05e..fa98636 100644
> --- a/testcases/kernel/syscalls/futex/futex_wake04.c
> +++ b/testcases/kernel/syscalls/futex/futex_wake04.c
> @@ -46,6 +46,7 @@
> #include "safe_macros.h"
> #include "futextest.h"
> #include "futex_utils.h"
> +#include "lapi/mmap.h"
>
> #define PATH_MEMINFO "/proc/meminfo"
> #define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages"
> @@ -62,6 +63,12 @@ static long orig_hugepages;
> static void setup(void)
> {
> tst_require_root(NULL);
> +
> + if ((tst_kvercmp(2, 6, 32)) < 0) {
> + tst_brkm(TCONF, NULL, "This test can only run on kernels "
> + "that are 2.6.32 or higher");
> + }
> +
> tst_tmpdir();
>
> SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages);
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] futex/futex_wake04.c: add kernel version check
2015-07-07 7:10 [LTP] [PATCH] futex/futex_wake04.c: add kernel version check Guangwen Feng
2015-07-22 3:13 ` Guangwen Feng
@ 2015-07-22 7:40 ` Li Wang
2015-07-22 8:00 ` Jan Stancek
1 sibling, 1 reply; 4+ messages in thread
From: Li Wang @ 2015-07-22 7:40 UTC (permalink / raw)
To: Guangwen Feng; +Cc: ltp-list
Hi,
Thank you for the patch, it's works for me.
Test on kernel-2.6.18-398.el5 good!
--
Regards,
Li Wang
Email: liwang@redhat.com
----- Original Message -----
> Compilation failed on RHEL5U11GA because the flag MAP_HUGETLB of
> mmap(2) are only available on kernels that are 2.6.32 or higher,
> therefore add kernel version check, as well as add mmap.h to
> define the flag in order to avoid compilation error.
>
> Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> ---
> include/lapi/mmap.h | 26
> ++++++++++++++++++++++++++
> testcases/kernel/syscalls/futex/futex_wake04.c | 7 +++++++
> 2 files changed, 33 insertions(+)
> create mode 100644 include/lapi/mmap.h
>
> diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h
> new file mode 100644
> index 0000000..e8e5917
> --- /dev/null
> +++ b/include/lapi/mmap.h
> @@ -0,0 +1,26 @@
> +/*
> + * Copyright (c) 2015 Fujitsu Ltd.
> + * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it would be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.
> + */
> +
> +#ifndef __LAPI_MMAP_H__
> +#define __LAPI_MMAP_H__
> +
> +#ifndef MAP_HUGETLB
> +#define MAP_HUGETLB 0x40000
> +#endif
> +
> +#endif /* __LAPI_MMAP_H__ */
> diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c
> b/testcases/kernel/syscalls/futex/futex_wake04.c
> index 955b05e..fa98636 100644
> --- a/testcases/kernel/syscalls/futex/futex_wake04.c
> +++ b/testcases/kernel/syscalls/futex/futex_wake04.c
> @@ -46,6 +46,7 @@
> #include "safe_macros.h"
> #include "futextest.h"
> #include "futex_utils.h"
> +#include "lapi/mmap.h"
>
> #define PATH_MEMINFO "/proc/meminfo"
> #define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages"
> @@ -62,6 +63,12 @@ static long orig_hugepages;
> static void setup(void)
> {
> tst_require_root(NULL);
> +
> + if ((tst_kvercmp(2, 6, 32)) < 0) {
> + tst_brkm(TCONF, NULL, "This test can only run on kernels "
> + "that are 2.6.32 or higher");
> + }
> +
> tst_tmpdir();
>
> SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages);
> --
> 1.8.4.2
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [LTP] [PATCH] futex/futex_wake04.c: add kernel version check
2015-07-22 7:40 ` Li Wang
@ 2015-07-22 8:00 ` Jan Stancek
0 siblings, 0 replies; 4+ messages in thread
From: Jan Stancek @ 2015-07-22 8:00 UTC (permalink / raw)
To: Li Wang, Guangwen Feng; +Cc: ltp-list
----- Original Message -----
> From: "Li Wang" <liwang@redhat.com>
> To: "Guangwen Feng" <fenggw-fnst@cn.fujitsu.com>
> Cc: ltp-list@lists.sourceforge.net
> Sent: Wednesday, 22 July, 2015 9:40:34 AM
> Subject: Re: [LTP] [PATCH] futex/futex_wake04.c: add kernel version check
>
> Hi,
>
> Thank you for the patch, it's works for me.
>
> Test on kernel-2.6.18-398.el5 good!
Thanks for trying it out. Pushed.
Regards,
Jan
>
> --
> Regards,
> Li Wang
> Email: liwang@redhat.com
>
>
> ----- Original Message -----
> > Compilation failed on RHEL5U11GA because the flag MAP_HUGETLB of
> > mmap(2) are only available on kernels that are 2.6.32 or higher,
> > therefore add kernel version check, as well as add mmap.h to
> > define the flag in order to avoid compilation error.
> >
> > Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> > ---
> > include/lapi/mmap.h | 26
> > ++++++++++++++++++++++++++
> > testcases/kernel/syscalls/futex/futex_wake04.c | 7 +++++++
> > 2 files changed, 33 insertions(+)
> > create mode 100644 include/lapi/mmap.h
> >
> > diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h
> > new file mode 100644
> > index 0000000..e8e5917
> > --- /dev/null
> > +++ b/include/lapi/mmap.h
> > @@ -0,0 +1,26 @@
> > +/*
> > + * Copyright (c) 2015 Fujitsu Ltd.
> > + * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> > + *
> > + * This program is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of
> > + * the License, or (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it would be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program.
> > + */
> > +
> > +#ifndef __LAPI_MMAP_H__
> > +#define __LAPI_MMAP_H__
> > +
> > +#ifndef MAP_HUGETLB
> > +#define MAP_HUGETLB 0x40000
> > +#endif
> > +
> > +#endif /* __LAPI_MMAP_H__ */
> > diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c
> > b/testcases/kernel/syscalls/futex/futex_wake04.c
> > index 955b05e..fa98636 100644
> > --- a/testcases/kernel/syscalls/futex/futex_wake04.c
> > +++ b/testcases/kernel/syscalls/futex/futex_wake04.c
> > @@ -46,6 +46,7 @@
> > #include "safe_macros.h"
> > #include "futextest.h"
> > #include "futex_utils.h"
> > +#include "lapi/mmap.h"
> >
> > #define PATH_MEMINFO "/proc/meminfo"
> > #define PATH_NR_HUGEPAGES "/proc/sys/vm/nr_hugepages"
> > @@ -62,6 +63,12 @@ static long orig_hugepages;
> > static void setup(void)
> > {
> > tst_require_root(NULL);
> > +
> > + if ((tst_kvercmp(2, 6, 32)) < 0) {
> > + tst_brkm(TCONF, NULL, "This test can only run on kernels "
> > + "that are 2.6.32 or higher");
> > + }
> > +
> > tst_tmpdir();
> >
> > SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages);
> > --
> > 1.8.4.2
> >
> >
> > ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> > https://www.gigenetcloud.com/
> > _______________________________________________
> > Ltp-list mailing list
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list
> >
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-22 8:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 7:10 [LTP] [PATCH] futex/futex_wake04.c: add kernel version check Guangwen Feng
2015-07-22 3:13 ` Guangwen Feng
2015-07-22 7:40 ` Li Wang
2015-07-22 8:00 ` Jan Stancek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox