* [PATCH] Some systems have a dynamic PAGE_SIZE value and do not add a definition for PAGE_SIZE. This value will have to be retrieved using getpagesize() or sysconf().
@ 2014-08-06 11:34 Thierry FAUCK - IBM LTC
2014-08-06 20:06 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Thierry FAUCK - IBM LTC @ 2014-08-06 11:34 UTC (permalink / raw)
To: avagin; +Cc: paulmck, akpm, linux-kernel, Thierry Fauck
From: Thierry Fauck <thierry@linux.vnet.ibm.com>
Signed-off-by: Thierry Fauck <thierry@linux.vnet.ibm.com>
---
tools/testing/selftests/ptrace/peeksiginfo.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/testing/selftests/ptrace/peeksiginfo.c b/tools/testing/selftests/ptrace/peeksiginfo.c
index d46558b..c34cd8a 100644
--- a/tools/testing/selftests/ptrace/peeksiginfo.c
+++ b/tools/testing/selftests/ptrace/peeksiginfo.c
@@ -31,6 +31,10 @@ static int sys_ptrace(int request, pid_t pid, void *addr, void *data)
#define TEST_SICODE_PRIV -1
#define TEST_SICODE_SHARE -2
+#ifndef PAGE_SIZE
+#define PAGE_SIZE sysconf(_SC_PAGESIZE)
+#endif
+
#define err(fmt, ...) \
fprintf(stderr, \
"Error (%s:%d): " fmt, \
--
2.0.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Some systems have a dynamic PAGE_SIZE value and do not add a definition for PAGE_SIZE. This value will have to be retrieved using getpagesize() or sysconf().
2014-08-06 11:34 [PATCH] Some systems have a dynamic PAGE_SIZE value and do not add a definition for PAGE_SIZE. This value will have to be retrieved using getpagesize() or sysconf() Thierry FAUCK - IBM LTC
@ 2014-08-06 20:06 ` Andrew Morton
2014-08-07 15:37 ` Thierry Fauck@linux.vnet.ibm.com
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2014-08-06 20:06 UTC (permalink / raw)
To: Thierry FAUCK - IBM LTC; +Cc: avagin, paulmck, linux-kernel
On Wed, 6 Aug 2014 13:34:26 +0200 Thierry FAUCK - IBM LTC <thierry@linux.vnet.ibm.com> wrote:
> --- a/tools/testing/selftests/ptrace/peeksiginfo.c
> +++ b/tools/testing/selftests/ptrace/peeksiginfo.c
> @@ -31,6 +31,10 @@ static int sys_ptrace(int request, pid_t pid, void *addr, void *data)
> #define TEST_SICODE_PRIV -1
> #define TEST_SICODE_SHARE -2
>
> +#ifndef PAGE_SIZE
> +#define PAGE_SIZE sysconf(_SC_PAGESIZE)
> +#endif
> +
> #define err(fmt, ...) \
> fprintf(stderr, \
> "Error (%s:%d): " fmt, \
More details, please. What are "some systems"?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Some systems have a dynamic PAGE_SIZE value and do not add a definition for PAGE_SIZE. This value will have to be retrieved using getpagesize() or sysconf().
2014-08-06 20:06 ` Andrew Morton
@ 2014-08-07 15:37 ` Thierry Fauck@linux.vnet.ibm.com
0 siblings, 0 replies; 3+ messages in thread
From: Thierry Fauck@linux.vnet.ibm.com @ 2014-08-07 15:37 UTC (permalink / raw)
To: Andrew Morton; +Cc: avagin, paulmck, linux-kernel
On 08/06/2014 10:06 PM, Andrew Morton wrote:
> On Wed, 6 Aug 2014 13:34:26 +0200 Thierry FAUCK - IBM LTC <thierry@linux.vnet.ibm.com> wrote:
>
>> --- a/tools/testing/selftests/ptrace/peeksiginfo.c
>> +++ b/tools/testing/selftests/ptrace/peeksiginfo.c
>> @@ -31,6 +31,10 @@ static int sys_ptrace(int request, pid_t pid, void *addr, void *data)
>> #define TEST_SICODE_PRIV -1
>> #define TEST_SICODE_SHARE -2
>>
>> +#ifndef PAGE_SIZE
>> +#define PAGE_SIZE sysconf(_SC_PAGESIZE)
>> +#endif
>> +
>> #define err(fmt, ...) \
>> fprintf(stderr, \
>> "Error (%s:%d): " fmt, \
> More details, please. What are "some systems"?
>
Sorry, about that "common description".
A more appropriate one could be : On IBM powerpc where multiple page
size value are supported, current ppc64 and ppc64el distro don't define
the PAGE_SIZE variable in /usr/include as this is a dynamic value
retrieved by the getpagesize() or sysconf() defined in unistd.h. The
PAGE_SIZE variable sounds defined when only one value is supported by
the kernel.
As such, when the PAGE_SIZE definition doesn't exist system should
retrieve the dynamic value.
Is that a better explanation ?
--
Thierry Fauck @ linux.vnet.ibm
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-07 15:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-06 11:34 [PATCH] Some systems have a dynamic PAGE_SIZE value and do not add a definition for PAGE_SIZE. This value will have to be retrieved using getpagesize() or sysconf() Thierry FAUCK - IBM LTC
2014-08-06 20:06 ` Andrew Morton
2014-08-07 15:37 ` Thierry Fauck@linux.vnet.ibm.com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox