[PATCH V2 8/8] MIPS: Fix more *_NONBLOCK definitions
Khem Raj
raj.khem at gmail.com
Sat Apr 7 21:09:52 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 04/07/2012 01:31 PM, Kevin Cernekee wrote:
> MIPS defines O_NONBLOCK differently from most other architectures.
> The common definitions use 04000 / 0x800, but MIPS uses 0200 / 0x80
> instead.
>
> After seeing a problem report involving one of the O_NONBLOCK
> "derivatives," I looked through the tree to see what else might be
> affected. Here is what I found:
We already have this kind of patch in future branch IIRC
>
> O_NONBLOCK: correct SOCK_NONBLOCK: correct (tst-sock-nonblock
> passes) EPOLL_NONBLOCK: correct SFD_NONBLOCK: correct (fixed in
> commit f87898ca; tst-signalfd passes) TFD_NONBLOCK: incorrect
> (tst-timerfd fails) IN_NONBLOCK: incorrect (tst-inotify fails)
>
> The proposed change is to add #ifdef clauses for __mips__, similar
> to what was done for SFD_NONBLOCK in include/sys/signalfd.h . This
> fixes the two failing test cases.
>
> Signed-off-by: Kevin Cernekee <cernekee at gmail.com> ---
> libc/sysdeps/linux/common/sys/inotify.h | 11 +++++++++++
> libc/sysdeps/linux/common/sys/timerfd.h | 11 +++++++++++ 2 files
> changed, 22 insertions(+), 0 deletions(-)
>
> diff --git a/libc/sysdeps/linux/common/sys/inotify.h
> b/libc/sysdeps/linux/common/sys/inotify.h index dc4e19d..4a10d6b
> 100644 --- a/libc/sysdeps/linux/common/sys/inotify.h +++
> b/libc/sysdeps/linux/common/sys/inotify.h @@ -23,6 +23,16 @@
>
>
> /* Flags for the parameter of inotify_init1. */ +#if defined
> __mips__ +enum + { + IN_CLOEXEC = 02000000, +#define IN_CLOEXEC
> IN_CLOEXEC + IN_NONBLOCK = 0200 +#define IN_NONBLOCK
> IN_NONBLOCK + }; + +#else enum { IN_CLOEXEC = 02000000, @@ -30,6
> +40,7 @@ enum IN_NONBLOCK = 04000 #define IN_NONBLOCK IN_NONBLOCK
> }; +#endif
>
>
> /* Structure describing an inotify event. */ diff --git
> a/libc/sysdeps/linux/common/sys/timerfd.h
> b/libc/sysdeps/linux/common/sys/timerfd.h index c1bb06f..141338e
> 100644 --- a/libc/sysdeps/linux/common/sys/timerfd.h +++
> b/libc/sysdeps/linux/common/sys/timerfd.h @@ -23,6 +23,16 @@
>
>
> /* Bits to be set in the FLAGS parameter of `timerfd_create'. */
> +#if defined __mips__ +enum + { + TFD_CLOEXEC = 02000000,
> +#define TFD_CLOEXEC TFD_CLOEXEC + TFD_NONBLOCK = 0200 +#define
> TFD_NONBLOCK TFD_NONBLOCK + }; + +#else enum { TFD_CLOEXEC =
> 02000000, @@ -30,6 +40,7 @@ enum TFD_NONBLOCK = 04000 #define
> TFD_NONBLOCK TFD_NONBLOCK }; +#endif
>
>
> /* Bits to be set in the FLAGS parameter of `timerfd_settime'. */
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk+ArSAACgkQuwUzVZGdMxQe4QCfayl21bSKN+i/tmV215Y9sBNU
iGwAn3Jst/+F2YEiowvsgPU9lq/ushGY
=9yaC
-----END PGP SIGNATURE-----
More information about the uClibc
mailing list