1
0
Fork 0
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:
Gerhard Rieger 2023-07-21 07:10:38 +02:00
parent c82e3df210
commit f152c55584
26 changed files with 686 additions and 119 deletions

View file

@ -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?? */