uClibc-0.9.33.2-dup3.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From: Jonas Bonn <jonas@southpole.se>
  2. Subject: [RFC PATCH 16/38] Add dup3 syscall
  3. Date: Tue, 6 Sep 2011 10:30:40 +0200
  4. Signed-off-by: Jonas Bonn <jonas@southpole.se>
  5. ---
  6. include/unistd.h | 4 ++++
  7. libc/sysdeps/linux/common/dup3.c | 15 +++++++++++++++
  8. 2 files changed, 19 insertions(+), 0 deletions(-)
  9. create mode 100644 libc/sysdeps/linux/common/dup3.c
  10. diff --git a/include/unistd.h b/include/unistd.h
  11. index 9568790..7c2fa4a 100644
  12. --- a/include/unistd.h
  13. +++ b/include/unistd.h
  14. @@ -513,6 +513,10 @@ extern int dup (int __fd) __THROW __wur;
  15. extern int dup2 (int __fd, int __fd2) __THROW;
  16. libc_hidden_proto(dup2)
  17. +/* Duplicate FD to FD2, closing FD2 and making it open on the same file. */
  18. +extern int dup3 (int __fd, int __fd2, int __flags) __THROW;
  19. +libc_hidden_proto(dup3)
  20. +
  21. /* NULL-terminated array of "NAME=VALUE" environment variables. */
  22. extern char **__environ;
  23. #ifdef __USE_GNU
  24. diff --git a/libc/sysdeps/linux/common/dup3.c b/libc/sysdeps/linux/common/dup3.c
  25. new file mode 100644
  26. index 0000000..5fdab2e
  27. --- /dev/null
  28. +++ b/libc/sysdeps/linux/common/dup3.c
  29. @@ -0,0 +1,15 @@
  30. +/* vi: set sw=4 ts=4: */
  31. +/*
  32. + * dup3() for uClibc
  33. + *
  34. + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  35. + *
  36. + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  37. + */
  38. +
  39. +#include <sys/syscall.h>
  40. +#include <unistd.h>
  41. +
  42. +
  43. +_syscall3(int, dup3, int, oldfd, int, newfd, int, flags)
  44. +libc_hidden_def(dup3)
  45. --
  46. 1.7.5.4
  47. _______________________________________________
  48. uClibc mailing list
  49. uClibc@uclibc.org
  50. http://lists.busybox.net/mailman/listinfo/uclibc