mirror of
https://repo.or.cz/socat.git
synced 2025-07-10 22:13:00 +00:00
New option netns for network namespace setting
This commit is contained in:
parent
c82e3df210
commit
f152c55584
26 changed files with 686 additions and 119 deletions
21
sycls.c
21
sycls.c
|
@ -1744,6 +1744,27 @@ void Unsetenv(const char *name) {
|
|||
#endif
|
||||
|
||||
|
||||
#if WITH_NAMESPACES
|
||||
int Setns(
|
||||
int fd,
|
||||
int nstype)
|
||||
{
|
||||
int _errno;
|
||||
int result;
|
||||
Debug2("setns(%d, 0x%x)", fd, nstype);
|
||||
result = setns(fd, nstype);
|
||||
if (result < 0) {
|
||||
_errno = errno;
|
||||
Debug2("setns() -> %d (errno=%d)", result, errno);
|
||||
errno = _errno;
|
||||
return result;
|
||||
}
|
||||
Debug1("setns() -> %d", result);
|
||||
return result;
|
||||
}
|
||||
#endif /* WITH_NAMESPACES */
|
||||
|
||||
|
||||
#if WITH_READLINE
|
||||
|
||||
char *Readline(const char *prompt) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue