Skip to contentSkip to conversation

preadv, pwritev: Fix preadv and pwritev link errors on android

PATCH New Petr Vorel 4 participants 5 messages Apr 23, 2019 – Apr 24, 2019

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 preadv, pwritev: Fix preadv and pwritev link errors on android

From: Petr Vorel <[email protected]>

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

This fixes link errors implicit declaration errors.

---
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(+)
testcases/kernel/syscalls/preadv/preadv01.c +2 -0
index 0565a086b..2b4ad5e20 100644
@@ -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>
 
testcases/kernel/syscalls/preadv/preadv02.c +2 -0
index af1c3b0c4..9935e3835 100644
@@ -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"
testcases/kernel/syscalls/pwritev/pwritev02.c +2 -0
index 2e6dbab57..9d8ff8725 100644
@@ -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"
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 preadv, pwritev: Fix preadv and pwritev link errors on android

Quoted 61 lines · Petr Vorel

From: Petr Vorel <[email protected]>

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

This fixes link errors implicit declaration errors.

---
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(+)
testcases/kernel/syscalls/preadv/preadv01.c +2 -0
index 0565a086b..2b4ad5e20 100644
@@ -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>
 
testcases/kernel/syscalls/preadv/preadv02.c +2 -0
index af1c3b0c4..9935e3835 100644
@@ -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"
testcases/kernel/syscalls/pwritev/pwritev02.c +2 -0
index 2e6dbab57..9d8ff8725 100644
@@ -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 lore raw

PATCH 1/1 preadv, pwritev: Fix preadv and pwritev link errors on android

In reply to Petr Vorel

Hi Petr,

LGTM.

Best Regards,
Xiao Yang

Quoted 60 lines · Petr Vorel

From: Petr Vorel<[email protected]>

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

This fixes link errors implicit declaration errors.

---
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(+)
testcases/kernel/syscalls/preadv/preadv01.c +2 -0
index 0565a086b..2b4ad5e20 100644
@@ -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>
 
testcases/kernel/syscalls/preadv/preadv02.c +2 -0
index af1c3b0c4..9935e3835 100644
@@ -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"
testcases/kernel/syscalls/pwritev/pwritev02.c +2 -0
index 2e6dbab57..9d8ff8725 100644
@@ -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"
author
#3 lore raw

PATCH 1/1 preadv, pwritev: Fix preadv and pwritev link errors on android

Hi Steve, Xiao,

Quoted 4 lines

Hi Petr,

LGTM.

Thanks for your review, pushed.

Kind regards,
Petr

#4 lore raw

PATCH 1/1 preadv, pwritev: Fix preadv and pwritev link errors on android

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

Quoted 6 lines

Hi Steve, Xiao,

Quoted 3 lines

Hi Petr,
LGTM.

Thanks for your review, pushed.

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

Regards,
Zhengwang

Quoted 3 lines

Kind regards,
Petr

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