uClibc-0.9.31.1-add-sock-cloexec.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 83333e9c873e4eca6b2c945f7770b1f5373b0427 Mon Sep 17 00:00:00 2001
  2. From: Vladimir Zapolskiy <vzapolskiy@gmail.com>
  3. Date: Tue, 1 Jun 2010 20:02:39 +0400
  4. Subject: [PATCH] bits/socket.h: add SOCK_CLOEXEC and SOCK_NONBLOCK support
  5. This patch adds support for SOCK_CLOEXEC and SOCK_NONBLOCK socket
  6. descriptor flags, which are introduced since Linux 2.6.27
  7. Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. libc/sysdeps/linux/common/bits/socket.h | 12 +++++++++++-
  11. 1 files changed, 11 insertions(+), 1 deletions(-)
  12. diff --git a/libc/sysdeps/linux/common/bits/socket.h b/libc/sysdeps/linux/common/bits/socket.h
  13. index ac5a433..11f6e97 100644
  14. --- a/libc/sysdeps/linux/common/bits/socket.h
  15. +++ b/libc/sysdeps/linux/common/bits/socket.h
  16. @@ -53,10 +53,20 @@ enum __socket_type
  17. SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
  18. datagrams of fixed maximum length. */
  19. #define SOCK_SEQPACKET SOCK_SEQPACKET
  20. - SOCK_PACKET = 10 /* Linux specific way of getting packets
  21. + SOCK_PACKET = 10, /* Linux specific way of getting packets
  22. at the dev level. For writing rarp and
  23. other similar things on the user level. */
  24. #define SOCK_PACKET SOCK_PACKET
  25. +
  26. + /* Flags to be ORed into the type parameter of socket and socketpair and
  27. + used for the flags parameter of paccept. */
  28. +
  29. + SOCK_CLOEXEC = 02000000, /* Atomically set close-on-exec flag for the
  30. + new descriptor(s). */
  31. +#define SOCK_CLOEXEC SOCK_CLOEXEC
  32. + SOCK_NONBLOCK = 04000 /* Atomically mark descriptor(s) as
  33. + non-blocking. */
  34. +#define SOCK_NONBLOCK SOCK_NONBLOCK
  35. };
  36. /* Protocol families. */
  37. --
  38. 1.7.3.4