MCPcopy Create free account
hub / github.com/devkitPro/libctru / srvGetPort

Function srvGetPort

libctru/source/srv.c:187–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187Result srvGetPort(Handle* out, const char* name)
188{
189 Result rc = 0;
190 u32* cmdbuf = getThreadCommandBuffer();
191
192 cmdbuf[0] = IPC_MakeHeader(0x8,4,0); // 0x80100
193 strncpy((char*) &cmdbuf[1], name,8);
194 cmdbuf[3] = strnlen(name, 8);
195 cmdbuf[4] = 0x0;
196
197 rc = svcSendSyncRequest(srvHandle);
198 rc = R_SUCCEEDED(rc) ? cmdbuf[1] : rc;
199 if(out) *out = R_SUCCEEDED(rc) ? cmdbuf[3] : 0;
200
201 return rc;
202}
203
204Result srvWaitForPortRegistered(const char* name)
205{

Callers 1

srvIsPortRegisteredFunction · 0.85

Calls 2

getThreadCommandBufferFunction · 0.85
IPC_MakeHeaderFunction · 0.85

Tested by

no test coverage detected