mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2024-12-29 11:06:07 +00:00
fixed (?) _write function
This commit is contained in:
parent
a21722a1db
commit
03b3194c44
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
// Generated By moduleGenerator
|
// Generated By moduleGenerator
|
||||||
#include <common/assert.h>
|
#include <common/assert.h>
|
||||||
|
#include <string.h>
|
||||||
#include "common/logging/log.h"
|
#include "common/logging/log.h"
|
||||||
#include "error_codes.h"
|
#include "error_codes.h"
|
||||||
#include "libkernel.h"
|
#include "libkernel.h"
|
||||||
|
@ -462,7 +463,11 @@ int PS4_SYSV_ABI _wait4() {
|
||||||
*/
|
*/
|
||||||
s64 PS4_SYSV_ABI ps4__write(int d, const void* buf, std::size_t nbytes) {
|
s64 PS4_SYSV_ABI ps4__write(int d, const void* buf, std::size_t nbytes) {
|
||||||
if (d <= 2) { // stdin,stdout,stderr
|
if (d <= 2) { // stdin,stdout,stderr
|
||||||
LOG_INFO(Kernel, "{}", (const char*)buf);
|
char* str = strdup((const char*)buf);
|
||||||
|
if (str[nbytes - 1] == '\n')
|
||||||
|
str[nbytes - 1] = 0;
|
||||||
|
LOG_INFO(Kernel, "{}", str);
|
||||||
|
free(str);
|
||||||
return nbytes;
|
return nbytes;
|
||||||
}
|
}
|
||||||
LOG_ERROR(Kernel, "(STUBBED) called d = {} nbytes = {} ", d, nbytes);
|
LOG_ERROR(Kernel, "(STUBBED) called d = {} nbytes = {} ", d, nbytes);
|
||||||
|
|
Loading…
Reference in a new issue