add param client initialize interface

Signed-off-by: cheng_jinsong <chengjinsong2@huawei.com>
Change-Id: I395f284fd7034ae0e516516017a29d2f5ab202c3
This commit is contained in:
cheng_jinsong 2022-08-25 01:07:14 -07:00
parent 263aafccd8
commit fd750f0c64
2 changed files with 17 additions and 0 deletions

View File

@ -29,6 +29,9 @@ typedef struct {
int (*setfilecon)(const char *name, const char *content);
} PARAM_WORKSPACE_OPS;
/**
* parameter service初始化接口 init调用
*/
int InitParamWorkSpace(int onlyRead, const PARAM_WORKSPACE_OPS *ops);
/**
@ -38,6 +41,10 @@ int InitParamWorkSpace(int onlyRead, const PARAM_WORKSPACE_OPS *ops);
*/
int SystemReadParam(const char *name, char *value, uint32_t *len);
/**
* parameter client初始化接口
*/
void InitParameterClient(void);
#ifdef __cplusplus
#if __cplusplus
}

View File

@ -236,3 +236,13 @@ int SystemReadParam(const char *name, char *value, uint32_t *len)
}
return ReadParamValue(handle, value, len);
}
void InitParameterClient(void)
{
if (getpid() == 1) {
return;
}
PARAM_WORKSPACE_OPS ops = {0};
ops.updaterMode = 0;
InitParamWorkSpace(1, &ops);
}