Set setns system call

This commit is contained in:
Ulrich Drepper 2011-05-28 00:53:13 -04:00
parent a8509ca540
commit ce67228d57
5 changed files with 18 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2011-05-28 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/syscalls.list: Add setns entry.
* sysdeps/unix/sysv/linux/bits/sched.h: Declare setns.
* sysdeps/unix/sysv/linux/Versions [GLIBC_2.14]: Add setns.
2011-05-27 Ulrich Drepper <drepper@gmail.com> 2011-05-27 Ulrich Drepper <drepper@gmail.com>
[BZ #12813] [BZ #12813]

2
NEWS
View File

@ -30,7 +30,7 @@ Version 2.14
Implemented by Ulrich Drepper. Implemented by Ulrich Drepper.
* New Linux interfaces: clock_adjtime, name_to_handle_at, open_by_handle_at, * New Linux interfaces: clock_adjtime, name_to_handle_at, open_by_handle_at,
syncfs syncfs, setns
* New locales: os_RU, bem_ZA, en_ZA, ff_SN, sw_KE, sw_TZ, lb_LU, wae_CH, * New locales: os_RU, bem_ZA, en_ZA, ff_SN, sw_KE, sw_TZ, lb_LU, wae_CH,
yue_HK, lij_IT, mhr_RU yue_HK, lij_IT, mhr_RU

View File

@ -158,6 +158,8 @@ libc {
clock_adjtime; clock_adjtime;
name_to_handle_at; open_by_handle_at; name_to_handle_at; open_by_handle_at;
setns;
} }
GLIBC_PRIVATE { GLIBC_PRIVATE {
# functions used in other libraries # functions used in other libraries

View File

@ -1,6 +1,6 @@
/* Definitions of constants and data structure for POSIX 1003.1b-1993 /* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface. scheduling interface.
Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009 Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008,2009,2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
@ -37,7 +37,7 @@
# define SCHED_RESET_ON_FORK 0x40000000 # define SCHED_RESET_ON_FORK 0x40000000
#endif #endif
#ifdef __USE_MISC #ifdef __USE_GNU
/* Cloning flags. */ /* Cloning flags. */
# define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */ # define CSIGNAL 0x000000ff /* Signal mask to be sent at exit. */
# define CLONE_VM 0x00000100 /* Set if VM shared between processes. */ # define CLONE_VM 0x00000100 /* Set if VM shared between processes. */
@ -78,7 +78,7 @@ struct sched_param
__BEGIN_DECLS __BEGIN_DECLS
#ifdef __USE_MISC #ifdef __USE_GNU
/* Clone current process. */ /* Clone current process. */
extern int clone (int (*__fn) (void *__arg), void *__child_stack, extern int clone (int (*__fn) (void *__arg), void *__child_stack,
int __flags, void *__arg, ...) __THROW; int __flags, void *__arg, ...) __THROW;
@ -88,8 +88,12 @@ extern int unshare (int __flags) __THROW;
/* Get index of currently used CPU. */ /* Get index of currently used CPU. */
extern int sched_getcpu (void) __THROW; extern int sched_getcpu (void) __THROW;
/* Switch process to namespace of type NSTYPE indicated by FD. */
extern int setns (int __fd, int __nstype) __THROW;
#endif #endif
__END_DECLS __END_DECLS
#endif /* need schedparam */ #endif /* need schedparam */

View File

@ -107,3 +107,5 @@ fanotify_init EXTRA fanotify_init i:ii fanotify_init
name_to_handle_at EXTRA name_to_handle_at i:isppi name_to_handle_at name_to_handle_at EXTRA name_to_handle_at i:isppi name_to_handle_at
open_by_handle_at EXTRA open_by_handle_at Ci:ipi open_by_handle_at open_by_handle_at EXTRA open_by_handle_at Ci:ipi open_by_handle_at
setns EXTRA setns i:ii setns