feat: 支持mnt容器及增强能力

BREAKING CHANGE:
支持mnt容器及增强对外变更:
1.clone 支持CLONE_NEWNS
2.增加”/proc/[pid]/container/mnt" 用于查询容器信息
3.新增chroot接口

Close #I6APW2

Signed-off-by: zhushengle <zhushengle@huawei.com>
Change-Id: I5e8843a0f59bb5b0e6a66a6810dc552e8184a03e
This commit is contained in:
zhushengle
2023-01-16 15:28:40 +08:00
parent d4794ebc38
commit e2d903b663
32 changed files with 1402 additions and 17 deletions

View File

@@ -47,7 +47,7 @@ static void WriteContainer(const char *filepath, int value)
{
PrintTest("writeproc %d >> %s\n", value, filepath);
int fd = open(filepath, O_WRONLY);
ASSERT_EQ(fd, -1);
ASSERT_NE(fd, -1);
char buf[configLen];
size_t twd = sprintf_s(buf, configLen, "%d", value);
ASSERT_GT(twd, 0);
@@ -78,7 +78,7 @@ static void ReadContainer(std::string strFile, int value)
static void ErrWriteContainer0(const char *filepath)
{
int fd = open(filepath, O_WRONLY);
ASSERT_EQ(fd, -1);
ASSERT_NE(fd, -1);
char buf[configLen];
int invalidNum = 0;
size_t twd1 = sprintf_s(buf, configLen, "%d", invalidNum);
@@ -92,7 +92,7 @@ static void ErrWriteContainer0(const char *filepath)
static void ErrWriteContainer65(const char *filepath)
{
int fd = open(filepath, O_WRONLY);
ASSERT_EQ(fd, -1);
ASSERT_NE(fd, -1);
char buf[configLen];
int invalidNum = 65;
size_t twd2 = sprintf_s(buf, configLen, "%d", invalidNum);