提交 c020949a 编写于 作者: L liubb_0516

Add L0 write/read remote object

Signed-off-by: Nliubb_0516 <liubeibei8@huawei.com>
上级 fe8c6177
...@@ -15,9 +15,11 @@ ...@@ -15,9 +15,11 @@
#include "rpc_os_adapter.h" #include "rpc_os_adapter.h"
#include <pthread.h>
int32_t RpcGetPid(void) int32_t RpcGetPid(void)
{ {
return 0; return (int32_t)pthread_self();
} }
int32_t RpcGetUid(void) int32_t RpcGetUid(void)
......
...@@ -247,9 +247,11 @@ int32_t ReadFileDescriptor(IpcIo *io) ...@@ -247,9 +247,11 @@ int32_t ReadFileDescriptor(IpcIo *io)
#else #else
bool WriteRemoteObject(IpcIo *io, const SvcIdentity *svc) bool WriteRemoteObject(IpcIo *io, const SvcIdentity *svc)
{ {
(void)io; if (io == NULL || svc == NULL) {
(void)svc; RPC_LOG_ERROR("push io or svc is NULL ...");
return false; return false;
}
return WriteBuffer(io, svc, sizeof(SvcIdentity));
} }
bool WriteFileDescriptor(IpcIo *io, uint32_t fd) bool WriteFileDescriptor(IpcIo *io, uint32_t fd)
...@@ -261,11 +263,17 @@ bool WriteFileDescriptor(IpcIo *io, uint32_t fd) ...@@ -261,11 +263,17 @@ bool WriteFileDescriptor(IpcIo *io, uint32_t fd)
bool ReadRemoteObject(IpcIo *io, SvcIdentity *svc) bool ReadRemoteObject(IpcIo *io, SvcIdentity *svc)
{ {
(void)io; if (io == NULL || svc == NULL) {
if (svc == NULL) { return false;
}
SvcIdentity *svcId = ReadBuffer(io, sizeof(SvcIdentity));
if (svcId == NULL) {
return false; return false;
} }
OnFirstStrongRef(svc->handle); svc->handle = svcId->handle;
svc->token = svcId->token;
svc->cookie = svcId->cookie;
WaitForProxyInit(svcId->handle);
return true; return true;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册