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

Function SysGrantPTY

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

Source from the content-addressed store, hash-verified

898}
899
900long SysGrantPTY(regs64_t* r){
901 if(!SC_ARG0(r)) return 1;
902
903 PTY* pty = GrantPTY(Scheduler::GetCurrentProcess()->pid);
904
905 process_t* currentProcess = Scheduler::GetCurrentProcess();
906
907 *((int*)SC_ARG0(r)) = currentProcess->fileDescriptors.get_length();
908
909 currentProcess->fileDescriptors[0] = fs::Open(&pty->slaveFile); // Stdin
910 currentProcess->fileDescriptors[1] = fs::Open(&pty->slaveFile); // Stdout
911 currentProcess->fileDescriptors[2] = fs::Open(&pty->slaveFile); // Stderr
912
913 currentProcess->fileDescriptors.add_back(fs::Open(&pty->masterFile));
914
915 return 0;
916}
917
918long SysGetCWD(regs64_t* r){
919 char* buf = (char*)SC_ARG0(r);

Callers

nothing calls this directly

Calls 5

GrantPTYFunction · 0.85
GetCurrentProcessFunction · 0.85
OpenFunction · 0.50
get_lengthMethod · 0.45
add_backMethod · 0.45

Tested by

no test coverage detected