mirror of
https://repo.or.cz/socat.git
synced 2025-07-10 14:12:58 +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
11
procan.c
11
procan.c
|
@ -13,6 +13,7 @@
|
|||
#include "error.h"
|
||||
#include "sycls.h"
|
||||
#include "sysutils.h"
|
||||
#include "sched.h"
|
||||
#include "filan.h"
|
||||
|
||||
#include <sys/resource.h>
|
||||
|
@ -163,6 +164,16 @@ int procan(FILE *outfile) {
|
|||
#endif
|
||||
}
|
||||
|
||||
/* Name spaces */
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
char link[PATH_MAX];
|
||||
snprintf(path, sizeof(path)-1, "/proc/"F_pid"/ns/net", getpid());
|
||||
if (readlink(path, link, sizeof(link)-1) >= 0) {
|
||||
fprintf(outfile, "Network namespace: %s", link);
|
||||
}
|
||||
}
|
||||
|
||||
/* file descriptors */
|
||||
|
||||
/* what was this for?? */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue