mirror of
https://github.com/Ascend/ascend-docker-runtime.git
synced 2025-10-13 04:43:50 +08:00
Match-id-b08926bead0de9d389a4ccbc630730c47db50300
This commit is contained in:
@@ -1,26 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) Huawei Technologies Co., Ltd. 2020-2020. All rights reserved.
|
||||
* Description: ascend-docker-cli工具实用函数模块头文件
|
||||
*/
|
||||
#ifndef _UTILS_H
|
||||
#define _UTILS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include "basic.h"
|
||||
|
||||
// For cgroup setup
|
||||
int StrHasPrefix(const char *str, const char *prefix);
|
||||
typedef char *(*ParseFileLine)(char *, const char *);
|
||||
int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath);
|
||||
bool CheckRootDir(char **pLine);
|
||||
bool CheckFsType(char **pLine);
|
||||
bool CheckSubStr(char **pLine, const char *subsys);
|
||||
bool CheckRootDir(char **pLine);
|
||||
typedef char *(*ParseFileLine)(char *, const char *);
|
||||
int CatFileContent(char* buffer, int bufferSize, ParseFileLine fn, const char* filepath);
|
||||
|
||||
// For mount setup
|
||||
int MkDir(const char *dir, int mode);
|
||||
int MakeParentDir(const char *path, mode_t mode);
|
||||
int VerifyPathInfo(const struct PathInfo* pathInfo);
|
||||
int CheckDirExists(const char *dir);
|
||||
int GetParentPathStr(const char *path, char *parent, size_t bufSize);
|
||||
int MakeParentDir(const char *path, mode_t mode);
|
||||
int CreateFile(const char *path, mode_t mode);
|
||||
int VerfifyPathInfo(const struct PathInfo* pathInfo);
|
||||
int Mount(const char *src, const char *dst);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user