//////////////////////// \brief SysGetFileStatusFlags(fd) Get a file handle's mode/status flags \param fd (int) file descriptor \return flags on success, negative error code on failure ////////////////////////
| 2040 | /// \return flags on success, negative error code on failure |
| 2041 | ///////////////////////////// |
| 2042 | long SysGetFileStatusFlags(regs64_t* r){ |
| 2043 | int fd = static_cast<int>(SC_ARG0(r)); |
| 2044 | fs_fd_t* handle; |
| 2045 | |
| 2046 | process_t* currentProcess = Scheduler::GetCurrentProcess(); |
| 2047 | if(static_cast<unsigned>(fd) > currentProcess->fileDescriptors.get_length() || !(handle = currentProcess->fileDescriptors[fd])){ |
| 2048 | return -EBADF; |
| 2049 | } |
| 2050 | |
| 2051 | return handle->mode; |
| 2052 | } |
| 2053 | |
| 2054 | ///////////////////////////// |
| 2055 | /// \brief SysSetFileStatusFlags(fd, flags) Set a file handle's mode/status flags |
nothing calls this directly
no test coverage detected