Kernel: Process::working_directory() is now thread safe

I realized you cannot return a stirng view and it to be thread safe
This commit is contained in:
Bananymous
2023-03-24 01:43:53 +02:00
parent 814f0b215d
commit 1fade1aa9e
3 changed files with 10 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ namespace Kernel
BAN::ErrorOr<size_t> read(int, void*, size_t);
BAN::ErrorOr<void> creat(BAN::StringView, mode_t);
BAN::StringView working_directory() const { return m_working_directory; }
BAN::String working_directory() const;
BAN::ErrorOr<void> set_working_directory(BAN::StringView);
Inode& inode_for_fd(int);
@@ -63,7 +63,7 @@ namespace Kernel
mutable RecursiveSpinLock m_lock;
pid_t m_pid = 0;
const pid_t m_pid = 0;
BAN::String m_working_directory;
BAN::Vector<BAN::RefPtr<Thread>> m_threads;