OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
4.0 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../uclibc/uClibc-0.9.32.1-unshare.patch
  5. # Copyright (C) 2012 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Backport of unshare() syscall.
  17. From uClibc git 19dd090a0f68765db87990ef8eda9bf77bb29581
  18. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  19. ---
  20. diff -Nura uClibc-0.9.32.orig/libc/sysdeps/linux/common/bits/sched.h uClibc-0.9.32/libc/sysdeps/linux/common/bits/sched.h
  21. --- uClibc-0.9.32.orig/libc/sysdeps/linux/common/bits/sched.h 2011-12-02 23:54:30.571841170 -0300
  22. +++ uClibc-0.9.32/libc/sysdeps/linux/common/bits/sched.h 2011-12-02 23:57:45.874205079 -0300
  23. @@ -58,7 +58,13 @@
  24. force CLONE_PTRACE on this clone. */
  25. # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in
  26. the child. */
  27. -# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
  28. +# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */
  29. +# define CLONE_NEWUTS 0x04000000 /* New utsname group. */
  30. +# define CLONE_NEWIPC 0x08000000 /* New ipcs. */
  31. +# define CLONE_NEWUSER 0x10000000 /* New user namespace. */
  32. +# define CLONE_NEWPID 0x20000000 /* New pid namespace. */
  33. +# define CLONE_NEWNET 0x40000000 /* New network namespace. */
  34. +# define CLONE_IO 0x80000000 /* Clone I/O context. */
  35. #endif
  36. /* The official definition. */
  37. @@ -74,11 +80,9 @@
  38. extern int clone (int (*__fn) (void *__arg), void *__child_stack,
  39. int __flags, void *__arg, ...) __THROW;
  40. -#if 0
  41. /* Unshare the specified resources. */
  42. extern int unshare (int __flags) __THROW;
  43. #endif
  44. -#endif
  45. __END_DECLS
  46. diff -Nura uClibc-0.9.32.orig/libc/sysdeps/linux/common/Makefile.in uClibc-0.9.32/libc/sysdeps/linux/common/Makefile.in
  47. --- uClibc-0.9.32.orig/libc/sysdeps/linux/common/Makefile.in 2011-12-02 23:54:30.577841215 -0300
  48. +++ uClibc-0.9.32/libc/sysdeps/linux/common/Makefile.in 2011-12-02 23:56:08.801527166 -0300
  49. @@ -24,7 +24,8 @@
  50. remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \
  51. sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \
  52. splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \
  53. - sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c
  54. + sync_file_range.c sysctl.c sysinfo.c timerfd.c unshare.c uselib.c \
  55. + vhangup.c
  56. # NPTL needs these internally: madvise.c
  57. CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c
  58. ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
  59. diff -Nura uClibc-0.9.32.orig/libc/sysdeps/linux/common/stubs.c uClibc-0.9.32/libc/sysdeps/linux/common/stubs.c
  60. --- uClibc-0.9.32.orig/libc/sysdeps/linux/common/stubs.c 2011-12-02 23:54:30.577841215 -0300
  61. +++ uClibc-0.9.32/libc/sysdeps/linux/common/stubs.c 2011-12-02 23:58:18.803435042 -0300
  62. @@ -278,6 +278,10 @@
  63. make_stub(umount2)
  64. #endif
  65. +#if !defined __NR_unshare && defined __UCLIBC_LINUX_SPECIFIC__
  66. +make_stub(unshare)
  67. +#endif
  68. +
  69. #ifndef __NR_utimensat
  70. make_stub(futimens)
  71. make_stub(utimensat)
  72. diff -Nura uClibc-0.9.32.orig/libc/sysdeps/linux/common/unshare.c uClibc-0.9.32/libc/sysdeps/linux/common/unshare.c
  73. --- uClibc-0.9.32.orig/libc/sysdeps/linux/common/unshare.c 1969-12-31 21:00:00.000000000 -0300
  74. +++ uClibc-0.9.32/libc/sysdeps/linux/common/unshare.c 2011-12-02 23:58:42.693601880 -0300
  75. @@ -0,0 +1,15 @@
  76. +/* vi: set sw=4 ts=4: */
  77. +/*
  78. + * unshare() for uClibc
  79. + *
  80. + * Copyright (C) 2011 Henning Heinold <heinold@inf.fu-berlin.de>
  81. + *
  82. + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  83. + */
  84. +
  85. +#include <sys/syscall.h>
  86. +#include <sched.h>
  87. +
  88. +#if defined __NR_unshare
  89. +_syscall1(int, unshare, int, flags)
  90. +#endif