Skip to contentSkip to conversation

fcntl: Add support for F_GETPIPE_SZ

PATCH Superseded Mike Crowe 2 participants 4 messages Aug 11, 2021 – Aug 13, 2021 1 message not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Mike Crowe

author
#0 lore raw

PATCH 1/1 fcntl: Add support for F_GETPIPE_SZ

When running the test suite on my Debian 11 box I see many occurrences of:

unknown fcntl argument 1032, assuming long argument.

(for example from test-execl.sh.)

It appears that this is F_GETPIPE_SZ and it takes no arguments. Let's add it to avoid the warning messages.

I could add F_SETPIPE_SZ too, but that apparently takes an int argument which would mean moving the va_arg call into the switch statement. :(

---
 ports/linux/guts/fcntl.c | 3 +++
 1 file changed, 3 insertions(+)
ports/linux/guts/fcntl.c +3 -0
index 434c7f3..e9c6140 100644
@@ -37,6 +37,9 @@
 	case F_GETOWN:
 	case F_GETSIG:
 	case F_GETLEASE:
+#if defined(F_GETPIPE_SZ)
+        case F_GETPIPE_SZ:
+#endif
 		rc = real_fcntl(fd, cmd);
 		break;
 	/* long argument */
Signature · 1 line
2.30.2
#1 lore raw
Quoted 29 lines · Mike Crowe via lists.openembedded.org

When running the test suite on my Debian 11 box I see many occurrences of:

 unknown fcntl argument 1032, assuming long argument.

(for example from test-execl.sh.)

It appears that this is F_GETPIPE_SZ and it takes no arguments. Let's add it to avoid the warning messages.

I could add F_SETPIPE_SZ too, but that apparently takes an int argument which would mean moving the va_arg call into the switch statement. :(

---
 ports/linux/guts/fcntl.c | 3 +++

 1 file changed, 3 insertions(+)
ports/linux/guts/fcntl.c +0 -0
index 434c7f3..e9c6140 100644
@@ -37,6 +37,9 @@

  case F_GETOWN:
  case F_GETSIG:
  case F_GETLEASE:

ports/linux/guts/fcntl.c +3 -0
+#if defined(F_GETPIPE_SZ)
+        case F_GETPIPE_SZ:
+#endif
Quoted 3 lines

  rc = real_fcntl(fd, cmd);
  break;
  /* long argument */

This goes make to making pseudo host specific which will break uninative/sstate. We'll probably have to add a define if it isn't defined to get the behaviour we need.

It is probably only a question of time before some program is using F_SETPIPE_SZ too :(

Cheers,

Richard

author
#2 lore raw
Quoted 29 lines · Richard Purdie
Quoted 28 lines · Mike Crowe via lists.openembedded.org

When running the test suite on my Debian 11 box I see many occurrences of:

 unknown fcntl argument 1032, assuming long argument.

(for example from test-execl.sh.)

It appears that this is F_GETPIPE_SZ and it takes no arguments. Let's add it to avoid the warning messages.

I could add F_SETPIPE_SZ too, but that apparently takes an int argument which would mean moving the va_arg call into the switch statement. :(

---
 ports/linux/guts/fcntl.c | 3 +++

 1 file changed, 3 insertions(+)
ports/linux/guts/fcntl.c +0 -0
index 434c7f3..e9c6140 100644
@@ -37,6 +37,9 @@

  case F_GETOWN:
  case F_GETSIG:
  case F_GETLEASE:

ports/linux/guts/fcntl.c +2 -0
+#if defined(F_GETPIPE_SZ)
+        case F_GETPIPE_SZ:
Quoted 8 lines
Quoted 4 lines

+#endif
  rc = real_fcntl(fd, cmd);
  break;
  /* long argument */

This goes make to making pseudo host specific which will break uninative/sstate. We'll probably have to add a define if it isn't defined to get the behaviour we need.

Good point. I should have realised that.

Quoted 2 lines

It is probably only a question of time before some program is using F_SETPIPE_SZ too :(

OK. I'll work on a new patch that supports F_GETPIPE_SZ and F_SETPIPE_SZ without relying on the constants being available.

Thanks!

Mike.

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 39 lines · Mike Crowe via lists.openembedded.org
Quoted 29 lines · Richard Purdie
Quoted 28 lines · Mike Crowe via lists.openembedded.org

When running the test suite on my Debian 11 box I see many occurrences of:

 unknown fcntl argument 1032, assuming long argument.

(for example from test-execl.sh.)

It appears that this is F_GETPIPE_SZ and it takes no arguments. Let's add it to avoid the warning messages.

I could add F_SETPIPE_SZ too, but that apparently takes an int argument which would mean moving the va_arg call into the switch statement. :(

---
 ports/linux/guts/fcntl.c | 3 +++

 1 file changed, 3 insertions(+)
ports/linux/guts/fcntl.c +0 -0
index 434c7f3..e9c6140 100644
@@ -37,6 +37,9 @@

  case F_GETOWN:
  case F_GETSIG:
  case F_GETLEASE:

ports/linux/guts/fcntl.c +2 -0
+#if defined(F_GETPIPE_SZ)
+        case F_GETPIPE_SZ:
Quoted 8 lines
Quoted 4 lines

+#endif
  rc = real_fcntl(fd, cmd);
  break;
  /* long argument */

This goes make to making pseudo host specific which will break uninative/sstate. We'll probably have to add a define if it isn't defined to get the behaviour we need.

Quoted 1 line

Good point. I should have realised that.

Having said that, why doesn't that concern apply to F_DUPFD_CLOEXEC too? Do we not care about systems that are so old that they don't have F_DUPFD_CLOEXEC? In which case, why other with the #ifdef at all?

Similarly for F_OFD_GETLK and friends.

Mike.