* [PATCH] [RFC] hppa: add fanotify_mark
@ 2013-08-21 16:03 Mike Frysinger
2013-08-21 16:30 ` Joseph S. Myers
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-08-21 16:03 UTC (permalink / raw)
To: libc-alpha, libc-ports; +Cc: carlos
Another example of all the 64bit arches getting the definition via a
common file, but the 32bit ones all adding it by themselves and hppa
was missed.
I'm not entirely sure about the usage of GLIBC_2.19 symbols here.
We'd like to backport this so people can use it, but it means we'd
be releasing a glibc-2.17/glibc-2.18 with a GLIBC_2.19 symbol in it.
But maybe it won't be a big deal since you'd only get that 2.19 ref
if you actually used the symbol ?
There hasn't been a glibc release where hppa worked w/out a bunch of
patches, so in reality there's only two distros that matter -- Gentoo
and Debian.
Reported-by: Jeroen Roovers <jer@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
Versions.def | 1 +
ports/sysdeps/unix/sysv/linux/hppa/Versions | 3 +++
ports/sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 +
3 files changed, 5 insertions(+)
diff --git a/Versions.def b/Versions.def
index 0854e6e..bca4ff4 100644
--- a/Versions.def
+++ b/Versions.def
@@ -35,6 +35,7 @@ libc {
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
+ GLIBC_2.19
HURD_CTHREADS_0.3
%ifdef EXPORT_UNWIND_FIND_FDE
GCC_3.0
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/Versions b/ports/sysdeps/unix/sysv/linux/hppa/Versions
index a62ef19..a392fee 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/Versions
+++ b/ports/sysdeps/unix/sysv/linux/hppa/Versions
@@ -32,6 +32,9 @@ libc {
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
prlimit64;
}
+ GLIBC_2.19 {
+ fanotify_mark;
+ }
}
librt {
GLIBC_2.3 {
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
index ae36d46..ae462ed 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -36,3 +36,4 @@ socketpair - socketpair i:iiif __socketpair socketpair
setrlimit - setrlimit i:ip __setrlimit setrlimit
getrlimit - getrlimit i:ip __getrlimit getrlimit
prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
+fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19
--
1.8.3.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] [RFC] hppa: add fanotify_mark
2013-08-21 16:03 [PATCH] [RFC] hppa: add fanotify_mark Mike Frysinger
@ 2013-08-21 16:30 ` Joseph S. Myers
2013-08-26 3:54 ` Mike Frysinger
2013-08-28 22:26 ` [PATCH v2] " Mike Frysinger
2013-09-03 3:20 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
2 siblings, 1 reply; 15+ messages in thread
From: Joseph S. Myers @ 2013-08-21 16:30 UTC (permalink / raw)
To: Mike Frysinger; +Cc: libc-alpha, libc-ports, carlos
On Wed, 21 Aug 2013, Mike Frysinger wrote:
> Another example of all the 64bit arches getting the definition via a
> common file, but the 32bit ones all adding it by themselves and hppa
> was missed.
How about adding an architecture-independent testcase (Linux-specific, of
course) for this function? I've no idea whether it can test any semantics
of fanotify_init / fanotify_mark, or only that calls to them link OK, but
in general when fixing bugs it's a good idea to add testcases that would
have detected them, and both functions are in my list of untested symbols
<http://sourceware.org/ml/libc-alpha/2013-07/msg00386.html>, which we need
to add test coverage for bit by bit.
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] [RFC] hppa: add fanotify_mark
2013-08-21 16:30 ` Joseph S. Myers
@ 2013-08-26 3:54 ` Mike Frysinger
0 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-08-26 3:54 UTC (permalink / raw)
To: Joseph S. Myers; +Cc: libc-alpha, libc-ports, carlos
[-- Attachment #1: Type: Text/Plain, Size: 1016 bytes --]
On Wednesday 21 August 2013 12:30:10 Joseph S. Myers wrote:
> On Wed, 21 Aug 2013, Mike Frysinger wrote:
> > Another example of all the 64bit arches getting the definition via a
> > common file, but the 32bit ones all adding it by themselves and hppa
> > was missed.
>
> How about adding an architecture-independent testcase (Linux-specific, of
> course) for this function? I've no idea whether it can test any semantics
> of fanotify_init / fanotify_mark, or only that calls to them link OK, but
> in general when fixing bugs it's a good idea to add testcases that would
> have detected them, and both functions are in my list of untested symbols
> <http://sourceware.org/ml/libc-alpha/2013-07/msg00386.html>, which we need
> to add test coverage for bit by bit.
the fatrace project [1] was used as a spot check. their is concern of running
the test on a kernel where fanotify support has been disabled, but hopefully
that should be easy to detect.
-mike
1: https://launchpad.net/fatrace
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2] hppa: add fanotify_mark
2013-08-21 16:03 [PATCH] [RFC] hppa: add fanotify_mark Mike Frysinger
2013-08-21 16:30 ` Joseph S. Myers
@ 2013-08-28 22:26 ` Mike Frysinger
2013-08-29 12:15 ` Joseph S. Myers
2013-08-30 17:49 ` Carlos O'Donell
2013-09-03 3:20 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
2 siblings, 2 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-08-28 22:26 UTC (permalink / raw)
To: libc-ports, libc-alpha
Another example of all the 64bit arches getting the definition via a
common file, but the 32bit ones all adding it by themselves and hppa
was missed.
I'm not entirely sure about the usage of GLIBC_2.19 symbols here.
We'd like to backport this so people can use it, but it means we'd
be releasing a glibc-2.17/glibc-2.18 with a GLIBC_2.19 symbol in it.
But maybe it won't be a big deal since you'd only get that 2.19 ref
if you actually used the symbol ?
There hasn't been a glibc release where hppa worked w/out a bunch of
patches, so in reality there's only two distros that matter -- Gentoo
and Debian.
Reported-by: Jeroen Roovers <jer@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v2
- add basic fanotify test
Versions.def | 1 +
ports/sysdeps/unix/sysv/linux/hppa/Versions | 3 ++
ports/sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 +
sysdeps/unix/sysv/linux/Makefile | 2 +-
sysdeps/unix/sysv/linux/tst-fanotify.c | 56 ++++++++++++++++++++++++
5 files changed, 62 insertions(+), 1 deletion(-)
create mode 100644 sysdeps/unix/sysv/linux/tst-fanotify.c
diff --git a/Versions.def b/Versions.def
index 0854e6e..bca4ff4 100644
--- a/Versions.def
+++ b/Versions.def
@@ -35,6 +35,7 @@ libc {
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
+ GLIBC_2.19
HURD_CTHREADS_0.3
%ifdef EXPORT_UNWIND_FIND_FDE
GCC_3.0
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/Versions b/ports/sysdeps/unix/sysv/linux/hppa/Versions
index a62ef19..a392fee 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/Versions
+++ b/ports/sysdeps/unix/sysv/linux/hppa/Versions
@@ -32,6 +32,9 @@ libc {
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
prlimit64;
}
+ GLIBC_2.19 {
+ fanotify_mark;
+ }
}
librt {
GLIBC_2.3 {
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
index ae36d46..ae462ed 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -36,3 +36,4 @@ socketpair - socketpair i:iiif __socketpair socketpair
setrlimit - setrlimit i:ip __setrlimit setrlimit
getrlimit - getrlimit i:ip __getrlimit getrlimit
prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
+fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 247cb9c..234d5a7 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -38,7 +38,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/socket_type.h bits/syscall.h bits/sysctl.h \
bits/mman-linux.h
-tests += tst-clone
+tests += tst-clone tst-fanotify
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
diff --git a/sysdeps/unix/sysv/linux/tst-fanotify.c b/sysdeps/unix/sysv/linux/tst-fanotify.c
new file mode 100644
index 0000000..1d6c855
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-fanotify.c
@@ -0,0 +1,56 @@
+/* Basic fanotify test.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/fanotify.h>
+
+static int
+do_test (void)
+{
+ int fd, ret;
+
+ fd = fanotify_init (0, 0);
+ if (fd < 0 && 0)
+ {
+ if (errno == ENOSYS)
+ {
+ puts ("SKIP: missing support for fanotify (check CONFIG_FANOTIFY=y)");
+ return 0;
+ }
+
+ perror ("fanotify_init (0, 0) failed");
+ return 1;
+ }
+
+ ret = fanotify_mark (fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_ACCESS
+ | FAN_MODIFY | FAN_OPEN | FAN_CLOSE | FAN_ONDIR
+ | FAN_EVENT_ON_CHILD, AT_FDCWD, ".");
+ if (ret)
+ {
+ perror ("fanotify_mark (...) failed");
+ return 1;
+ }
+
+ puts ("All OK");
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--
1.8.3.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-08-28 22:26 ` [PATCH v2] " Mike Frysinger
@ 2013-08-29 12:15 ` Joseph S. Myers
2013-08-30 0:32 ` Mike Frysinger
2013-08-30 17:49 ` Carlos O'Donell
1 sibling, 1 reply; 15+ messages in thread
From: Joseph S. Myers @ 2013-08-29 12:15 UTC (permalink / raw)
To: Mike Frysinger; +Cc: libc-ports, libc-alpha
On Wed, 28 Aug 2013, Mike Frysinger wrote:
> + if (fd < 0 && 0)
That && 0 seems suspicious....
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-08-29 12:15 ` Joseph S. Myers
@ 2013-08-30 0:32 ` Mike Frysinger
0 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-08-30 0:32 UTC (permalink / raw)
To: Joseph S. Myers; +Cc: libc-ports, libc-alpha
[-- Attachment #1: Type: Text/Plain, Size: 228 bytes --]
On Thursday 29 August 2013 08:15:29 Joseph S. Myers wrote:
> On Wed, 28 Aug 2013, Mike Frysinger wrote:
> > + if (fd < 0 && 0)
>
> That && 0 seems suspicious....
yeah, left over debug while testing another part
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-08-28 22:26 ` [PATCH v2] " Mike Frysinger
2013-08-29 12:15 ` Joseph S. Myers
@ 2013-08-30 17:49 ` Carlos O'Donell
2013-08-30 20:33 ` Joseph S. Myers
2013-09-03 3:22 ` Mike Frysinger
1 sibling, 2 replies; 15+ messages in thread
From: Carlos O'Donell @ 2013-08-30 17:49 UTC (permalink / raw)
To: Mike Frysinger; +Cc: libc-ports, libc-alpha
On 08/28/2013 06:26 PM, Mike Frysinger wrote:
> Another example of all the 64bit arches getting the definition via a
> common file, but the 32bit ones all adding it by themselves and hppa
> was missed.
>
> I'm not entirely sure about the usage of GLIBC_2.19 symbols here.
> We'd like to backport this so people can use it, but it means we'd
> be releasing a glibc-2.17/glibc-2.18 with a GLIBC_2.19 symbol in it.
> But maybe it won't be a big deal since you'd only get that 2.19 ref
> if you actually used the symbol ?
That's going to be very hard to do without some intense hacking to
get a 2.17 or 2.18 with a 2.19 symbol. The build system isn't designed
to allow you to do that?
If I had to do it I would just add the symbol *without* a version since
that should work to upgrade to 2.19 eventually which provides a default
symbol at @@2.19. You can test that quickly by building an application
with the glibc that has the symbol without version, and then running
it under the new ld.
> There hasn't been a glibc release where hppa worked w/out a bunch of
> patches, so in reality there's only two distros that matter -- Gentoo
> and Debian.
Yeah, that's my fault for not merging things :(
> Reported-by: Jeroen Roovers <jer@gentoo.org>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> v2
> - add basic fanotify test
>
> Versions.def | 1 +
> ports/sysdeps/unix/sysv/linux/hppa/Versions | 3 ++
> ports/sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 +
> sysdeps/unix/sysv/linux/Makefile | 2 +-
> sysdeps/unix/sysv/linux/tst-fanotify.c | 56 ++++++++++++++++++++++++
> 5 files changed, 62 insertions(+), 1 deletion(-)
> create mode 100644 sysdeps/unix/sysv/linux/tst-fanotify.c
>
> diff --git a/Versions.def b/Versions.def
> index 0854e6e..bca4ff4 100644
> --- a/Versions.def
> +++ b/Versions.def
> @@ -35,6 +35,7 @@ libc {
> GLIBC_2.16
> GLIBC_2.17
> GLIBC_2.18
> + GLIBC_2.19
OK.
> HURD_CTHREADS_0.3
> %ifdef EXPORT_UNWIND_FIND_FDE
> GCC_3.0
> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/Versions b/ports/sysdeps/unix/sysv/linux/hppa/Versions
> index a62ef19..a392fee 100644
> --- a/ports/sysdeps/unix/sysv/linux/hppa/Versions
> +++ b/ports/sysdeps/unix/sysv/linux/hppa/Versions
> @@ -32,6 +32,9 @@ libc {
> _sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
> prlimit64;
> }
> + GLIBC_2.19 {
> + fanotify_mark;
OK.
> + }
> }
> librt {
> GLIBC_2.3 {
> diff --git a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
> index ae36d46..ae462ed 100644
> --- a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
> +++ b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
> @@ -36,3 +36,4 @@ socketpair - socketpair i:iiif __socketpair socketpair
> setrlimit - setrlimit i:ip __setrlimit setrlimit
> getrlimit - getrlimit i:ip __getrlimit getrlimit
> prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
> +fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19
OK. I followed the discussion around 5i's.
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 247cb9c..234d5a7 100644
The rest should be a distinct commit adding the test in the event we need
to revert it or cherry pick just the test.
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -38,7 +38,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
> bits/socket_type.h bits/syscall.h bits/sysctl.h \
> bits/mman-linux.h
>
> -tests += tst-clone
> +tests += tst-clone tst-fanotify
OK.
> # Generate the list of SYS_* macros for the system calls (__NR_* macros).
>
> diff --git a/sysdeps/unix/sysv/linux/tst-fanotify.c b/sysdeps/unix/sysv/linux/tst-fanotify.c
> new file mode 100644
> index 0000000..1d6c855
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/tst-fanotify.c
> @@ -0,0 +1,56 @@
> +/* Basic fanotify test.
> + Copyright (C) 2013 Free Software Foundation, Inc.
> + This file is part of the GNU C Library.
> +
> + The GNU C Library is free software; you can redistribute it and/or
> + modify it under the terms of the GNU Lesser General Public
> + License as published by the Free Software Foundation; either
> + version 2.1 of the License, or (at your option) any later version.
> +
> + The GNU C Library is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + Lesser General Public License for more details.
> +
> + You should have received a copy of the GNU Lesser General Public
> + License along with the GNU C Library; if not, see
> + <http://www.gnu.org/licenses/>. */
OK good header.
> +
> +#include <errno.h>
> +#include <fcntl.h>
> +#include <stdio.h>
> +#include <sys/fanotify.h>
> +
> +static int
> +do_test (void)
> +{
> + int fd, ret;
> +
> + fd = fanotify_init (0, 0);
> + if (fd < 0 && 0)
We already talked about this bug.
> + {
> + if (errno == ENOSYS)
> + {
> + puts ("SKIP: missing support for fanotify (check CONFIG_FANOTIFY=y)");
> + return 0;
OK.
> + }
> +
> + perror ("fanotify_init (0, 0) failed");
> + return 1;
> + }
> +
> + ret = fanotify_mark (fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_ACCESS
> + | FAN_MODIFY | FAN_OPEN | FAN_CLOSE | FAN_ONDIR
> + | FAN_EVENT_ON_CHILD, AT_FDCWD, ".");
> + if (ret)
> + {
> + perror ("fanotify_mark (...) failed");
> + return 1;
> + }
> +
> + puts ("All OK");
> + return 0;
> +}
> +
> +#define TEST_FUNCTION do_test ()
> +#include "../test-skeleton.c"
Looks good to me.
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-08-30 17:49 ` Carlos O'Donell
@ 2013-08-30 20:33 ` Joseph S. Myers
2013-08-30 20:51 ` Roland McGrath
2013-09-03 3:22 ` Mike Frysinger
1 sibling, 1 reply; 15+ messages in thread
From: Joseph S. Myers @ 2013-08-30 20:33 UTC (permalink / raw)
To: Carlos O'Donell; +Cc: Mike Frysinger, libc-ports, libc-alpha
On Fri, 30 Aug 2013, Carlos O'Donell wrote:
> > I'm not entirely sure about the usage of GLIBC_2.19 symbols here.
> > We'd like to backport this so people can use it, but it means we'd
> > be releasing a glibc-2.17/glibc-2.18 with a GLIBC_2.19 symbol in it.
> > But maybe it won't be a big deal since you'd only get that 2.19 ref
> > if you actually used the symbol ?
>
> That's going to be very hard to do without some intense hacking to
> get a 2.17 or 2.18 with a 2.19 symbol. The build system isn't designed
> to allow you to do that?
Backporting a Versions.def addition is trivial.
(Of course if hppa had ABI test baselines, a backport to there would be
needed along with the rest of the changes, but (a) that's just as easy and
(b) that's still on my long list of areas hppa is out of sync with other
ports - such baselines will of course need comparing with past
distribution binaries when added, to detect any ABI bugs introduced over
time.)
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-08-30 20:33 ` Joseph S. Myers
@ 2013-08-30 20:51 ` Roland McGrath
2013-09-03 16:03 ` Carlos O'Donell
0 siblings, 1 reply; 15+ messages in thread
From: Roland McGrath @ 2013-08-30 20:51 UTC (permalink / raw)
To: Joseph S. Myers
Cc: Carlos O'Donell, Mike Frysinger, libc-ports, libc-alpha
It just seems fundamentally wrong to backport a new symbol.
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/2 v3] tst-fanotify: new simple test
2013-08-21 16:03 [PATCH] [RFC] hppa: add fanotify_mark Mike Frysinger
2013-08-21 16:30 ` Joseph S. Myers
2013-08-28 22:26 ` [PATCH v2] " Mike Frysinger
@ 2013-09-03 3:20 ` Mike Frysinger
2013-09-03 3:22 ` [PATCH 2/2 v3] hppa: add fanotify_mark Mike Frysinger
2013-09-03 3:23 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
2 siblings, 2 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-09-03 3:20 UTC (permalink / raw)
To: libc-ports, libc-alpha; +Cc: carlos
Basic test for the fanotify functions.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v3
- fixed left over debug code
- split into sep commit
ChangeLog | 5 +++
sysdeps/unix/sysv/linux/Makefile | 2 +-
sysdeps/unix/sysv/linux/tst-fanotify.c | 56 ++++++++++++++++++++++++++++++++++
3 files changed, 62 insertions(+), 1 deletion(-)
create mode 100644 sysdeps/unix/sysv/linux/tst-fanotify.c
diff --git a/ChangeLog b/ChangeLog
index 34f7c4a..2c300a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-02 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/tst-fanotify.c: New test.
+ * sysdeps/unix/sysv/linux/Makefile (tests): Add tst-fanotify.
+
2013-09-02 Joseph Myers <joseph@codesourcery.com>
[BZ #14155]
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 247cb9c..234d5a7 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -38,7 +38,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h \
bits/socket_type.h bits/syscall.h bits/sysctl.h \
bits/mman-linux.h
-tests += tst-clone
+tests += tst-clone tst-fanotify
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
diff --git a/sysdeps/unix/sysv/linux/tst-fanotify.c b/sysdeps/unix/sysv/linux/tst-fanotify.c
new file mode 100644
index 0000000..b88995d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-fanotify.c
@@ -0,0 +1,56 @@
+/* Basic fanotify test.
+ Copyright (C) 2013 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <sys/fanotify.h>
+
+static int
+do_test (void)
+{
+ int fd, ret;
+
+ fd = fanotify_init (0, 0);
+ if (fd < 0)
+ {
+ if (errno == ENOSYS)
+ {
+ puts ("SKIP: missing support for fanotify (check CONFIG_FANOTIFY=y)");
+ return 0;
+ }
+
+ perror ("fanotify_init (0, 0) failed");
+ return 1;
+ }
+
+ ret = fanotify_mark (fd, FAN_MARK_ADD | FAN_MARK_MOUNT, FAN_ACCESS
+ | FAN_MODIFY | FAN_OPEN | FAN_CLOSE | FAN_ONDIR
+ | FAN_EVENT_ON_CHILD, AT_FDCWD, ".");
+ if (ret)
+ {
+ perror ("fanotify_mark (...) failed");
+ return 1;
+ }
+
+ puts ("All OK");
+ return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
--
1.8.3.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-08-30 17:49 ` Carlos O'Donell
2013-08-30 20:33 ` Joseph S. Myers
@ 2013-09-03 3:22 ` Mike Frysinger
1 sibling, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-09-03 3:22 UTC (permalink / raw)
To: Carlos O'Donell; +Cc: libc-ports, libc-alpha
[-- Attachment #1: Type: Text/Plain, Size: 1787 bytes --]
On Friday 30 August 2013 13:49:50 Carlos O'Donell wrote:
> On 08/28/2013 06:26 PM, Mike Frysinger wrote:
> > Another example of all the 64bit arches getting the definition via a
> > common file, but the 32bit ones all adding it by themselves and hppa
> > was missed.
> >
> > I'm not entirely sure about the usage of GLIBC_2.19 symbols here.
> > We'd like to backport this so people can use it, but it means we'd
> > be releasing a glibc-2.17/glibc-2.18 with a GLIBC_2.19 symbol in it.
> > But maybe it won't be a big deal since you'd only get that 2.19 ref
> > if you actually used the symbol ?
>
> That's going to be very hard to do without some intense hacking to
> get a 2.17 or 2.18 with a 2.19 symbol. The build system isn't designed
> to allow you to do that?
>
> If I had to do it I would just add the symbol *without* a version since
> that should work to upgrade to 2.19 eventually which provides a default
> symbol at @@2.19. You can test that quickly by building an application
> with the glibc that has the symbol without version, and then running
> it under the new ld.
thanks, i'll give that a spin
> > There hasn't been a glibc release where hppa worked w/out a bunch of
> > patches, so in reality there's only two distros that matter -- Gentoo
> > and Debian.
>
> Yeah, that's my fault for not merging things :(
sorry, i didn't mean to make it sound like a slight. just providing reasoning
behind backporting a symbol (which i know is not something normally done).
> > diff --git a/sysdeps/unix/sysv/linux/Makefile
> > b/sysdeps/unix/sysv/linux/Makefile index 247cb9c..234d5a7 100644
>
> The rest should be a distinct commit adding the test in the event we need
> to revert it or cherry pick just the test.
done
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 2/2 v3] hppa: add fanotify_mark
2013-09-03 3:20 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
@ 2013-09-03 3:22 ` Mike Frysinger
2013-09-03 3:23 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
1 sibling, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-09-03 3:22 UTC (permalink / raw)
To: libc-ports, libc-alpha; +Cc: carlos
Another example of all the 64bit arches getting the definition via a
common file, but the 32bit ones all adding it by themselves and hppa
was missed.
I'm not entirely sure about the usage of GLIBC_2.19 symbols here.
We'd like to backport this so people can use it, but it means we'd
be releasing a glibc-2.17/glibc-2.18 with a GLIBC_2.19 symbol in it.
But maybe it won't be a big deal since you'd only get that 2.19 ref
if you actually used the symbol ?
There hasn't been a glibc release where hppa worked w/out a bunch of
patches, so in reality there's only two distros that matter -- Gentoo
and Debian.
Reported-by: Jeroen Roovers <jer@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v3
- split test out
ChangeLog | 4 ++++
Versions.def | 1 +
ports/ChangeLog | 7 +++++++
ports/sysdeps/unix/sysv/linux/hppa/Versions | 3 +++
ports/sysdeps/unix/sysv/linux/hppa/syscalls.list | 1 +
5 files changed, 16 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 2c300a5..2210a9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2013-09-02 Mike Frysinger <vapier@gentoo.org>
+ * Versions.def (libc): Add GLIBC_2.19.
+
+2013-09-02 Mike Frysinger <vapier@gentoo.org>
+
* sysdeps/unix/sysv/linux/tst-fanotify.c: New test.
* sysdeps/unix/sysv/linux/Makefile (tests): Add tst-fanotify.
diff --git a/Versions.def b/Versions.def
index 0854e6e..bca4ff4 100644
--- a/Versions.def
+++ b/Versions.def
@@ -35,6 +35,7 @@ libc {
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
+ GLIBC_2.19
HURD_CTHREADS_0.3
%ifdef EXPORT_UNWIND_FIND_FDE
GCC_3.0
diff --git a/ports/ChangeLog b/ports/ChangeLog
index fcb58cc..9b63801 100644
--- a/ports/ChangeLog
+++ b/ports/ChangeLog
@@ -1,3 +1,10 @@
+2013-09-02 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/unix/sysv/linux/hppa/syscalls.list (fanotify_mark): New
+ entry.
+ * sysdeps/unix/sysv/linux/hppa/Versions (libc): Add GLIBC_2.19 and
+ fanotify_mark.
+
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* README: Update copyright dates in example.
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/Versions b/ports/sysdeps/unix/sysv/linux/hppa/Versions
index a62ef19..a392fee 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/Versions
+++ b/ports/sysdeps/unix/sysv/linux/hppa/Versions
@@ -32,6 +32,9 @@ libc {
_sys_errlist; sys_errlist; _sys_nerr; sys_nerr;
prlimit64;
}
+ GLIBC_2.19 {
+ fanotify_mark;
+ }
}
librt {
GLIBC_2.3 {
diff --git a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
index ae36d46..ae462ed 100644
--- a/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
+++ b/ports/sysdeps/unix/sysv/linux/hppa/syscalls.list
@@ -36,3 +36,4 @@ socketpair - socketpair i:iiif __socketpair socketpair
setrlimit - setrlimit i:ip __setrlimit setrlimit
getrlimit - getrlimit i:ip __getrlimit getrlimit
prlimit64 EXTRA prlimit64 i:iipp __prlimit64 prlimit64@@GLIBC_2.17
+fanotify_mark EXTRA fanotify_mark i:iiiiis __fanotify_mark fanotify_mark@@GLIBC_2.19
--
1.8.3.2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/2 v3] tst-fanotify: new simple test
2013-09-03 3:20 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
2013-09-03 3:22 ` [PATCH 2/2 v3] hppa: add fanotify_mark Mike Frysinger
@ 2013-09-03 3:23 ` Mike Frysinger
1 sibling, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2013-09-03 3:23 UTC (permalink / raw)
To: libc-ports; +Cc: libc-alpha, carlos
[-- Attachment #1: Type: Text/Plain, Size: 139 bytes --]
On Monday 02 September 2013 23:20:36 Mike Frysinger wrote:
> Basic test for the fanotify functions.
i've pushed the v3 patchset now
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-08-30 20:51 ` Roland McGrath
@ 2013-09-03 16:03 ` Carlos O'Donell
2013-09-18 22:08 ` Roland McGrath
0 siblings, 1 reply; 15+ messages in thread
From: Carlos O'Donell @ 2013-09-03 16:03 UTC (permalink / raw)
To: Roland McGrath; +Cc: Joseph S. Myers, Mike Frysinger, libc-ports, libc-alpha
On 08/30/2013 04:51 PM, Roland McGrath wrote:
> It just seems fundamentally wrong to backport a new symbol.
It's nice to say that it's wrong, but what are the alternatives?
Upgrading the distribution to 2.19 carries with it significant risks.
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2] hppa: add fanotify_mark
2013-09-03 16:03 ` Carlos O'Donell
@ 2013-09-18 22:08 ` Roland McGrath
0 siblings, 0 replies; 15+ messages in thread
From: Roland McGrath @ 2013-09-18 22:08 UTC (permalink / raw)
To: Carlos O'Donell
Cc: Joseph S. Myers, Mike Frysinger, libc-ports, libc-alpha
> On 08/30/2013 04:51 PM, Roland McGrath wrote:
> > It just seems fundamentally wrong to backport a new symbol.
>
> It's nice to say that it's wrong, but what are the alternatives?
Obviously, you just live without the symbol until you upgrade to a libc new
enough to have it.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2013-09-18 22:08 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-21 16:03 [PATCH] [RFC] hppa: add fanotify_mark Mike Frysinger
2013-08-21 16:30 ` Joseph S. Myers
2013-08-26 3:54 ` Mike Frysinger
2013-08-28 22:26 ` [PATCH v2] " Mike Frysinger
2013-08-29 12:15 ` Joseph S. Myers
2013-08-30 0:32 ` Mike Frysinger
2013-08-30 17:49 ` Carlos O'Donell
2013-08-30 20:33 ` Joseph S. Myers
2013-08-30 20:51 ` Roland McGrath
2013-09-03 16:03 ` Carlos O'Donell
2013-09-18 22:08 ` Roland McGrath
2013-09-03 3:22 ` Mike Frysinger
2013-09-03 3:20 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
2013-09-03 3:22 ` [PATCH 2/2 v3] hppa: add fanotify_mark Mike Frysinger
2013-09-03 3:23 ` [PATCH 1/2 v3] tst-fanotify: new simple test Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).