mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-26 20:15:03 +00:00
special case for sceKernelWrite (stdin,stdout,stderr)
This commit is contained in:
parent
6ee92f9ab9
commit
57ca290c6e
@ -93,6 +93,14 @@ size_t PS4_SYSV_ABI sceKernelWrite(int d, void* buf, size_t nbytes) {
|
|||||||
if (buf == nullptr) {
|
if (buf == nullptr) {
|
||||||
return SCE_KERNEL_ERROR_EFAULT;
|
return SCE_KERNEL_ERROR_EFAULT;
|
||||||
}
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
|
auto* h = Common::Singleton<Core::FileSys::HandleTable>::Instance();
|
||||||
auto* file = h->GetFile(d);
|
auto* file = h->GetFile(d);
|
||||||
if (file == nullptr) {
|
if (file == nullptr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user