This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from igor725/posixfix
Fix POSIX_CALL return value + Library fix
- Loading branch information
Showing
10 changed files
with
100 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
enum class FileType { | ||
File, | ||
Device, | ||
Library, | ||
}; | ||
|
||
enum class SceWhence : int { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include "type_lib.h" | ||
|
||
#include "logging.h" | ||
|
||
LOG_DEFINE_MODULE(IODevice_LIB); | ||
|
||
class TypeLib: public IFile { | ||
std::unique_ptr<Program>& m_prog; | ||
|
||
public: | ||
TypeLib(std::unique_ptr<Program>& prog): IFile(FileType::Library), m_prog(prog) {} | ||
|
||
~TypeLib() {} | ||
|
||
// ### Interface | ||
size_t read(void* buf, size_t nbytes) final; | ||
size_t write(void* buf, size_t nbytes) final; | ||
void sync() final; | ||
int ioctl(int request, SceVariadicList argp) final; | ||
int fcntl(int cmd, SceVariadicList argp) final; | ||
int64_t lseek(int64_t offset, SceWhence whence) final; | ||
|
||
void* getNative() final { return nullptr; } | ||
}; | ||
|
||
std::unique_ptr<IFile> createType_lib(std::unique_ptr<Program>& prog) { | ||
return std::make_unique<TypeLib>(prog); | ||
} | ||
|
||
size_t TypeLib::read(void* buf, size_t nbytes) { | ||
LOG_USE_MODULE(IODevice_LIB); | ||
LOG_CRIT(L"Program(%p)->read(%p, %llu)", m_prog.get(), buf, nbytes); | ||
return 0; | ||
} | ||
|
||
size_t TypeLib::write(void* buf, size_t nbytes) { | ||
LOG_USE_MODULE(IODevice_LIB); | ||
LOG_CRIT(L"Program(%p)->write(%p, %llu)", m_prog.get(), buf, nbytes); | ||
return 0; | ||
} | ||
|
||
void TypeLib::sync() {} | ||
|
||
int TypeLib::ioctl(int request, SceVariadicList argp) { | ||
return 0; | ||
} | ||
|
||
int TypeLib::fcntl(int cmd, SceVariadicList argp) { | ||
return 0; | ||
} | ||
|
||
int64_t TypeLib::lseek(int64_t offset, SceWhence whence) { | ||
return -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#pragma once | ||
|
||
#include "../ifile.h" | ||
#include "core/runtime/program.h" | ||
|
||
std::unique_ptr<IFile> createType_lib(std::unique_ptr<Program>& prog); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.