libctru/libctru/source/services/soc/soc_gethostid.c
2015-01-24 14:14:06 -06:00

23 lines
316 B
C

#include "soc_common.h"
#include <errno.h>
long gethostid(void)
{
int ret = 0;
u32 *cmdbuf = getThreadCommandBuffer();
cmdbuf[0] = 0x00160000;
ret = svcSendSyncRequest(SOCU_handle);
if(ret != 0) {
errno = SYNC_ERROR;
return -1;
}
ret = (int)cmdbuf[1];
if(ret == 0)
ret = cmdbuf[2];
return ret;
}