Skip to contentSkip to conversation

Declare lio_async_callback_handler() for linux too

PATCH New Khem Raj 2 participants 6 messages Jan 7, 2016 Library code

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 Declare lio_async_callback_handler() for linux too

sigval_t is glibc only construct, we use a union of sigval which pretty much is same effect as sigval_t

---
 lib/tlibio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/tlibio.c +2 -2
index 6b6103f..b7d9faa 100644
@@ -130,7 +130,7 @@
 #endif
 
 static void lio_async_signal_handler();
-#ifdef sgi
+#if defined(sgi) || (defined(__linux__) && !defined(__UCLIBC__))
 static void lio_async_callback_handler();
 #endif
 
@@ -441,7 +441,7 @@ static void lio_async_signal_handler(int sig)
  * If the handler is called, it will increment the Received_callback
  * global variable.
  ***********************************************************************/
-static void lio_async_callback_handler(sigval_t sigval)
+static void lio_async_callback_handler(union sigval sigval)
 {
 	if (Debug_level)
 		printf
Signature · 1 line
2.7.0
#1 lore raw

PATCH 1/1 Declare lio_async_callback_handler() for linux too

----- Original Message -----

Quoted 4 lines

From: "Khem Raj" <[email protected]>
To: [email protected]
Sent: Thursday, 7 January, 2016 8:37:07 AM
Subject: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi,

Quoted 14 lines

sigval_t is glibc only construct, we use a union of sigval which pretty much is same effect as sigval_t

---
 lib/tlibio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/tlibio.c +0 -0
index 6b6103f..b7d9faa 100644

lib/tlibio.c line 133

Quoted 5 lines
lib/tlibio.c +1 -1
@@ -130,7 +130,7 @@
 #endif
 
 static void lio_async_signal_handler();
-#ifdef sgi
+#if defined(sgi) || (defined(__linux__) && !defined(__UCLIBC__))

What difference does this make? Isn't this just a forward declaration, that's not that useful anyway?

Regards,
Jan

Quoted 19 lines
lib/tlibio.c +1 -2
 static void lio_async_callback_handler();
 #endif
 
@@ -441,7 +441,7 @@ static void lio_async_signal_handler(int sig)
  * If the handler is called, it will increment the Received_callback
  * global variable.
  ***********************************************************************/
-static void lio_async_callback_handler(sigval_t sigval)
+static void lio_async_callback_handler(union sigval sigval)
 {
 	if (Debug_level)
 		printf
--

2.7.0

--
Mailing list info: http://lists.linux.it/listinfo/ltp

author
#2 lore raw

PATCH 1/1 Declare lio_async_callback_handler() for linux too

Hi Jan

Quoted 28 lines · Jan Stancek

----- Original Message -----

Quoted 4 lines

From: "Khem Raj" <[email protected]>
To: [email protected]
Sent: Thursday, 7 January, 2016 8:37:07 AM
Subject: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi,

Quoted 16 lines

sigval_t is glibc only construct, we use a union of sigval which pretty much is same effect as sigval_t

---
lib/tlibio.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
lib/tlibio.c +0 -0
index 6b6103f..b7d9faa 100644
@@ -130,7 +130,7 @@
 #endif
 
Quoted 6 lines

lib/tlibio.c line 133

Quoted 3 lines
lib/tlibio.c +1 -1
 static void lio_async_signal_handler();
-#ifdef sgi
+#if defined(sgi) || (defined(__linux__) && !defined(__UCLIBC__))

What difference does this make? Isn't this just a forward declaration, that's not that useful anyway?

I am getting undeclared errors e.g.

| tlibio.c:1274:7: error: 'lio_async_callback_handler' undeclared (first use in this function)
|        lio_async_callback_handler;
|        ^

moreover it makes it consistent with rest of the file.

Quoted 20 lines

Regards,
Jan

Quoted 16 lines
lib/tlibio.c +1 -2
 static void lio_async_callback_handler();
 #endif
 
@@ -441,7 +441,7 @@ static void lio_async_signal_handler(int sig)
 * If the handler is called, it will increment the Received_callback
 * global variable.
 ***********************************************************************/
-static void lio_async_callback_handler(sigval_t sigval)
+static void lio_async_callback_handler(union sigval sigval)
 {
 	if (Debug_level)
 		printf
--

2.7.0

Quoted 3 lines
Quoted 3 lines

--
Mailing list info: http://lists.linux.it/listinfo/ltp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160107/1f3d9fa7/attachment.sig>

#3 lore raw

PATCH 1/1 Declare lio_async_callback_handler() for linux too

----- Original Message -----

Quoted 43 lines

From: "Khem Raj" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: [email protected]
Sent: Thursday, 7 January, 2016 10:58:19 AM
Subject: Re: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi Jan

Quoted 28 lines · Jan Stancek

----- Original Message -----

Quoted 4 lines

From: "Khem Raj" <[email protected]>
To: [email protected]
Sent: Thursday, 7 January, 2016 8:37:07 AM
Subject: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi,

Quoted 16 lines

sigval_t is glibc only construct, we use a union of sigval which pretty much is same effect as sigval_t

---
lib/tlibio.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
lib/tlibio.c +0 -0
index 6b6103f..b7d9faa 100644
@@ -130,7 +130,7 @@
 #endif
 
Quoted 6 lines

lib/tlibio.c line 133

Quoted 3 lines
lib/tlibio.c +1 -1
 static void lio_async_signal_handler();
-#ifdef sgi
+#if defined(sgi) || (defined(__linux__) && !defined(__UCLIBC__))

What difference does this make? Isn't this just a forward declaration, that's not that useful anyway?

Quoted 7 lines

I am getting undeclared errors e.g.

| tlibio.c:1274:7: error: 'lio_async_callback_handler' undeclared (first use
| in this function)
|        lio_async_callback_handler;
|        ^

Definition of that function, with same exact ifdef around it, is way before that, on line 444. Am I missing something?

I can remove both fwd declarations and it still compiles fine. (I went as far back as gcc version 4.1.2 / rhel5.6)

What distro/arch/compiler/c_library are you using?

Quoted 28 lines

moreover it makes it consistent with rest of the file.

Quoted 23 lines

Regards,
Jan

Quoted 19 lines
lib/tlibio.c +1 -2
 static void lio_async_callback_handler();
 #endif
 
@@ -441,7 +441,7 @@ static void lio_async_signal_handler(int sig)
 * If the handler is called, it will increment the Received_callback
 * global variable.
 ***********************************************************************/
-static void lio_async_callback_handler(sigval_t sigval)
+static void lio_async_callback_handler(union sigval sigval)
 {
 	if (Debug_level)
 		printf
--

2.7.0

--
Mailing list info: http://lists.linux.it/listinfo/ltp

author
#4 lore raw

PATCH 1/1 Declare lio_async_callback_handler() for linux too

Quoted 54 lines · Jan Stancek

----- Original Message -----

Quoted 43 lines

From: "Khem Raj" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: [email protected]
Sent: Thursday, 7 January, 2016 10:58:19 AM
Subject: Re: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi Jan

Quoted 28 lines · Jan Stancek

----- Original Message -----

Quoted 4 lines

From: "Khem Raj" <[email protected]>
To: [email protected]
Sent: Thursday, 7 January, 2016 8:37:07 AM
Subject: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi,

Quoted 16 lines

sigval_t is glibc only construct, we use a union of sigval which pretty much is same effect as sigval_t

---
lib/tlibio.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
lib/tlibio.c +0 -0
index 6b6103f..b7d9faa 100644
@@ -130,7 +130,7 @@
 #endif
 
Quoted 6 lines

lib/tlibio.c line 133

Quoted 3 lines
lib/tlibio.c +1 -1
 static void lio_async_signal_handler();
-#ifdef sgi
+#if defined(sgi) || (defined(__linux__) && !defined(__UCLIBC__))

What difference does this make? Isn't this just a forward declaration, that's not that useful anyway?

Quoted 7 lines

I am getting undeclared errors e.g.

| tlibio.c:1274:7: error: 'lio_async_callback_handler' undeclared (first use
| in this function)
|        lio_async_callback_handler;
|        ^
Quoted 7 lines

Definition of that function, with same exact ifdef around it, is way before that, on line 444. Am I missing something?

I can remove both fwd declarations and it still compiles fine. (I went as far back as gcc version 4.1.2 / rhel5.6)

What distro/arch/compiler/c_library are you using?

I am using gcc 5.3 on Yocto/OE using musl C library.

Quoted 29 lines
Quoted 29 lines

moreover it makes it consistent with rest of the file.

Quoted 23 lines

Regards,
Jan

Quoted 19 lines
lib/tlibio.c +1 -2
 static void lio_async_callback_handler();
 #endif
 
@@ -441,7 +441,7 @@ static void lio_async_signal_handler(int sig)
 * If the handler is called, it will increment the Received_callback
 * global variable.
 ***********************************************************************/
-static void lio_async_callback_handler(sigval_t sigval)
+static void lio_async_callback_handler(union sigval sigval)
 {
   if (Debug_level)
           printf
--

2.7.0

--
Mailing list info: http://lists.linux.it/listinfo/ltp

author
#5 lore raw

PATCH 1/1 Declare lio_async_callback_handler() for linux too

In reply to Jan Stancek
Quoted 57 lines · Jan Stancek

----- Original Message -----

Quoted 43 lines

From: "Khem Raj" <[email protected]>
To: "Jan Stancek" <[email protected]>
Cc: [email protected]
Sent: Thursday, 7 January, 2016 10:58:19 AM
Subject: Re: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi Jan

Quoted 28 lines · Jan Stancek

----- Original Message -----

Quoted 4 lines

From: "Khem Raj" <[email protected]>
To: [email protected]
Sent: Thursday, 7 January, 2016 8:37:07 AM
Subject: [LTP] [PATCH] Declare lio_async_callback_handler() for linux too

Hi,

Quoted 16 lines

sigval_t is glibc only construct, we use a union of sigval which pretty much is same effect as sigval_t

---
lib/tlibio.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
lib/tlibio.c +0 -0
index 6b6103f..b7d9faa 100644
@@ -130,7 +130,7 @@
 #endif
 
Quoted 6 lines

lib/tlibio.c line 133

Quoted 3 lines
lib/tlibio.c +1 -1
 static void lio_async_signal_handler();
-#ifdef sgi
+#if defined(sgi) || (defined(__linux__) && !defined(__UCLIBC__))

What difference does this make? Isn't this just a forward declaration, that's not that useful anyway?

Quoted 7 lines

I am getting undeclared errors e.g.

| tlibio.c:1274:7: error: 'lio_async_callback_handler' undeclared (first use
| in this function)
|        lio_async_callback_handler;
|        ^
Quoted 7 lines

Definition of that function, with same exact ifdef around it, is way before that, on line 444. Am I missing something?

I can remove both fwd declarations and it still compiles fine. (I went as far back as gcc version 4.1.2 / rhel5.6)

What distro/arch/compiler/c_library are you using?

I think the first hunk of that patch is not needed. Infact that forward declaration can be removed. My errors were due to signal_t not being available on
musl once that got covered by changing to 'union signal? thats all was needed to fix the issue with musl I am sending a v2

Quoted 24 lines
Quoted 24 lines

moreover it makes it consistent with rest of the file.

Quoted 20 lines

Regards,
Jan

Quoted 16 lines
lib/tlibio.c +1 -2
 static void lio_async_callback_handler();
 #endif
 
@@ -441,7 +441,7 @@ static void lio_async_signal_handler(int sig)
 * If the handler is called, it will increment the Received_callback
 * global variable.
 ***********************************************************************/
-static void lio_async_callback_handler(sigval_t sigval)
+static void lio_async_callback_handler(union sigval sigval)
 {
 	if (Debug_level)
 		printf
--

2.7.0

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

--
Mailing list info: http://lists.linux.it/listinfo/ltp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.linux.it/pipermail/ltp/attachments/20160107/848ded1d/attachment.sig>