All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android
@ 2019-04-23 22:12 Petr Vorel
  2019-04-24  0:01 ` Steve Muckle
  2019-04-24  8:17 ` Xiao Yang
  0 siblings, 2 replies; 5+ messages in thread
From: Petr Vorel @ 2019-04-23 22:12 UTC (permalink / raw)
  To: ltp

From: Petr Vorel <petr.vorel@gmail.com>

pwritev() declaration on in bionic C library is guarded with __USE_GNU,
therefore define _GNU_SOURCE.

This fixes link errors implicit declaration errors.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Hi,

this is IMHO better than adding -D_GNU_SOURCE into CFLAGS.

Kind regards,
Petr
---
 testcases/kernel/syscalls/preadv/preadv01.c   | 2 ++
 testcases/kernel/syscalls/preadv/preadv02.c   | 2 ++
 testcases/kernel/syscalls/pwritev/pwritev02.c | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/testcases/kernel/syscalls/preadv/preadv01.c b/testcases/kernel/syscalls/preadv/preadv01.c
index 0565a086b..2b4ad5e20 100644
--- a/testcases/kernel/syscalls/preadv/preadv01.c
+++ b/testcases/kernel/syscalls/preadv/preadv01.c
@@ -23,6 +23,8 @@
 * and after reading the file, the file offset is not changed.
 */
 
+#define _GNU_SOURCE
+
 #include <string.h>
 #include <sys/uio.h>
 
diff --git a/testcases/kernel/syscalls/preadv/preadv02.c b/testcases/kernel/syscalls/preadv/preadv02.c
index af1c3b0c4..9935e3835 100644
--- a/testcases/kernel/syscalls/preadv/preadv02.c
+++ b/testcases/kernel/syscalls/preadv/preadv02.c
@@ -38,6 +38,8 @@
 * 8) preadv(2) should return -1 and set errno to ESPIPE.
 */
 
+#define _GNU_SOURCE
+
 #include <sys/uio.h>
 #include <unistd.h>
 #include "tst_test.h"
diff --git a/testcases/kernel/syscalls/pwritev/pwritev02.c b/testcases/kernel/syscalls/pwritev/pwritev02.c
index 2e6dbab57..9d8ff8725 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev02.c
+++ b/testcases/kernel/syscalls/pwritev/pwritev02.c
@@ -36,6 +36,8 @@
 * 7) pwritev(2) should return -1 and set errno to ESPIPE.
 */
 
+#define _GNU_SOURCE
+
 #include <sys/uio.h>
 #include <unistd.h>
 #include "tst_test.h"
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android
  2019-04-23 22:12 [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android Petr Vorel
@ 2019-04-24  0:01 ` Steve Muckle
  2019-04-24  8:17 ` Xiao Yang
  1 sibling, 0 replies; 5+ messages in thread
From: Steve Muckle @ 2019-04-24  0:01 UTC (permalink / raw)
  To: ltp

Reviewed-by: Steve Muckle <smuckle@google.com>

On 4/23/19 3:12 PM, Petr Vorel wrote:
> From: Petr Vorel <petr.vorel@gmail.com>
> 
> pwritev() declaration on in bionic C library is guarded with __USE_GNU,
> therefore define _GNU_SOURCE.
> 
> This fixes link errors implicit declaration errors.
> 
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> ---
> Hi,
> 
> this is IMHO better than adding -D_GNU_SOURCE into CFLAGS.
> 
> Kind regards,
> Petr
> ---
>   testcases/kernel/syscalls/preadv/preadv01.c   | 2 ++
>   testcases/kernel/syscalls/preadv/preadv02.c   | 2 ++
>   testcases/kernel/syscalls/pwritev/pwritev02.c | 2 ++
>   3 files changed, 6 insertions(+)
> 
> diff --git a/testcases/kernel/syscalls/preadv/preadv01.c b/testcases/kernel/syscalls/preadv/preadv01.c
> index 0565a086b..2b4ad5e20 100644
> --- a/testcases/kernel/syscalls/preadv/preadv01.c
> +++ b/testcases/kernel/syscalls/preadv/preadv01.c
> @@ -23,6 +23,8 @@
>   * and after reading the file, the file offset is not changed.
>   */
>   
> +#define _GNU_SOURCE
> +
>   #include <string.h>
>   #include <sys/uio.h>
>   
> diff --git a/testcases/kernel/syscalls/preadv/preadv02.c b/testcases/kernel/syscalls/preadv/preadv02.c
> index af1c3b0c4..9935e3835 100644
> --- a/testcases/kernel/syscalls/preadv/preadv02.c
> +++ b/testcases/kernel/syscalls/preadv/preadv02.c
> @@ -38,6 +38,8 @@
>   * 8) preadv(2) should return -1 and set errno to ESPIPE.
>   */
>   
> +#define _GNU_SOURCE
> +
>   #include <sys/uio.h>
>   #include <unistd.h>
>   #include "tst_test.h"
> diff --git a/testcases/kernel/syscalls/pwritev/pwritev02.c b/testcases/kernel/syscalls/pwritev/pwritev02.c
> index 2e6dbab57..9d8ff8725 100644
> --- a/testcases/kernel/syscalls/pwritev/pwritev02.c
> +++ b/testcases/kernel/syscalls/pwritev/pwritev02.c
> @@ -36,6 +36,8 @@
>   * 7) pwritev(2) should return -1 and set errno to ESPIPE.
>   */
>   
> +#define _GNU_SOURCE
> +
>   #include <sys/uio.h>
>   #include <unistd.h>
>   #include "tst_test.h"
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android
  2019-04-23 22:12 [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android Petr Vorel
  2019-04-24  0:01 ` Steve Muckle
@ 2019-04-24  8:17 ` Xiao Yang
  2019-04-24  8:23   ` Petr Vorel
  1 sibling, 1 reply; 5+ messages in thread
From: Xiao Yang @ 2019-04-24  8:17 UTC (permalink / raw)
  To: ltp

Hi Petr,

LGTM.
Acked-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Best Regards,
Xiao Yang
On 2019/04/24 6:12, Petr Vorel wrote:
> From: Petr Vorel<petr.vorel@gmail.com>
>
> pwritev() declaration on in bionic C library is guarded with __USE_GNU,
> therefore define _GNU_SOURCE.
>
> This fixes link errors implicit declaration errors.
>
> Signed-off-by: Petr Vorel<petr.vorel@gmail.com>
> ---
> Hi,
>
> this is IMHO better than adding -D_GNU_SOURCE into CFLAGS.
>
> Kind regards,
> Petr
> ---
>   testcases/kernel/syscalls/preadv/preadv01.c   | 2 ++
>   testcases/kernel/syscalls/preadv/preadv02.c   | 2 ++
>   testcases/kernel/syscalls/pwritev/pwritev02.c | 2 ++
>   3 files changed, 6 insertions(+)
>
> diff --git a/testcases/kernel/syscalls/preadv/preadv01.c b/testcases/kernel/syscalls/preadv/preadv01.c
> index 0565a086b..2b4ad5e20 100644
> --- a/testcases/kernel/syscalls/preadv/preadv01.c
> +++ b/testcases/kernel/syscalls/preadv/preadv01.c
> @@ -23,6 +23,8 @@
>   * and after reading the file, the file offset is not changed.
>   */
>
> +#define _GNU_SOURCE
> +
>   #include<string.h>
>   #include<sys/uio.h>
>
> diff --git a/testcases/kernel/syscalls/preadv/preadv02.c b/testcases/kernel/syscalls/preadv/preadv02.c
> index af1c3b0c4..9935e3835 100644
> --- a/testcases/kernel/syscalls/preadv/preadv02.c
> +++ b/testcases/kernel/syscalls/preadv/preadv02.c
> @@ -38,6 +38,8 @@
>   * 8) preadv(2) should return -1 and set errno to ESPIPE.
>   */
>
> +#define _GNU_SOURCE
> +
>   #include<sys/uio.h>
>   #include<unistd.h>
>   #include "tst_test.h"
> diff --git a/testcases/kernel/syscalls/pwritev/pwritev02.c b/testcases/kernel/syscalls/pwritev/pwritev02.c
> index 2e6dbab57..9d8ff8725 100644
> --- a/testcases/kernel/syscalls/pwritev/pwritev02.c
> +++ b/testcases/kernel/syscalls/pwritev/pwritev02.c
> @@ -36,6 +36,8 @@
>   * 7) pwritev(2) should return -1 and set errno to ESPIPE.
>   */
>
> +#define _GNU_SOURCE
> +
>   #include<sys/uio.h>
>   #include<unistd.h>
>   #include "tst_test.h"




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android
  2019-04-24  8:17 ` Xiao Yang
@ 2019-04-24  8:23   ` Petr Vorel
  2019-04-24  8:28     ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2019-04-24  8:23 UTC (permalink / raw)
  To: ltp

Hi Steve, Xiao,

> Hi Petr,

> LGTM.
> Acked-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

Thanks for your review, pushed.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android
  2019-04-24  8:23   ` Petr Vorel
@ 2019-04-24  8:28     ` =?unknown-8bit?b?6Ziu5q2j5pe6?=
  0 siblings, 0 replies; 5+ messages in thread
From: =?unknown-8bit?b?6Ziu5q2j5pe6?= @ 2019-04-24  8:28 UTC (permalink / raw)
  To: ltp

Hi Petr,


-------- Original Message --------
From: Petr Vorel
Sent: Wed, 24 Apr 2019 10:23:36 +0200
To: Xiao Yang
Cc: Ltp
Subject: Re: [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev 
link errors on android
> Hi Steve, Xiao,
>
>> Hi Petr,
>> LGTM.
>> Acked-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> Thanks for your review, pushed.

This is cool! I also suffered from this issue. :-)

Regards,
Zhengwang

> Kind regards,
> Petr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190424/f184d543/attachment.html>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-24  8:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-23 22:12 [LTP] [PATCH 1/1] preadv, pwritev: Fix preadv and pwritev link errors on android Petr Vorel
2019-04-24  0:01 ` Steve Muckle
2019-04-24  8:17 ` Xiao Yang
2019-04-24  8:23   ` Petr Vorel
2019-04-24  8:28     ` =?unknown-8bit?b?6Ziu5q2j5pe6?=

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.