MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / SysGetCWD

Function SysGetCWD

Kernel/src/arch/x86_64/syscalls.cpp:918–931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

916}
917
918long SysGetCWD(regs64_t* r){
919 char* buf = (char*)SC_ARG0(r);
920 size_t sz = SC_ARG1(r);
921
922 char* workingDir = Scheduler::GetCurrentProcess()->workingDir;
923 if(strlen(workingDir) > sz) {
924 return 1;
925 } else {
926 strcpy(buf, workingDir);
927 return 0;
928 }
929
930 return 0;
931}
932
933long SysWaitPID(regs64_t* r){
934 uint64_t pid = SC_ARG0(r);

Callers

nothing calls this directly

Calls 3

GetCurrentProcessFunction · 0.85
strlenFunction · 0.85
strcpyFunction · 0.85

Tested by

no test coverage detected