special case for sceKernelWrite (stdin,stdout,stderr)
This commit is contained in:
parent
23f11a3fda
commit
e576bc99ba
|
@ -90,6 +90,14 @@ int PS4_SYSV_ABI sceKernelClose(int d) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t PS4_SYSV_ABI sceKernelWrite(int d, void* buf, size_t nbytes) {
|
size_t PS4_SYSV_ABI sceKernelWrite(int d, void* buf, size_t nbytes) {
|
||||||
|
if (d <= 2) { // stdin,stdout,stderr
|
||||||
|
char* str = strdup((const char*)buf);
|
||||||
|
if (str[nbytes - 1] == '\n')
|
||||||
|
str[nbytes - 1] = 0;
|
||||||
|
LOG_INFO(Tty, "{}", str);
|
||||||
|
free(str);
|
||||||
|
return nbytes;
|
||||||
|
}
|
||||||
if (buf == nullptr) {
|
if (buf == nullptr) {
|
||||||
return SCE_KERNEL_ERROR_EFAULT;
|
return SCE_KERNEL_ERROR_EFAULT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue