Kernel: Convert Process-related const member functions to static

Process::get_syscall_path_argument() and
ProcFSExposedComponent::modified_time() both are independent of this.
This commit is contained in:
Andrew Kaster 2021-10-31 16:47:20 -06:00 committed by Andreas Kling
parent bc29c7f04f
commit eb1181b898
Notes: sideshowbarker 2024-07-18 01:06:49 +09:00
3 changed files with 5 additions and 5 deletions

View file

@ -526,7 +526,7 @@ Custody& Process::current_directory()
return *m_cwd; return *m_cwd;
} }
ErrorOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Userspace<char const*> user_path, size_t path_length) const ErrorOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Userspace<char const*> user_path, size_t path_length)
{ {
if (path_length == 0) if (path_length == 0)
return EINVAL; return EINVAL;
@ -535,7 +535,7 @@ ErrorOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Userspace<cha
return try_copy_kstring_from_user(user_path, path_length); return try_copy_kstring_from_user(user_path, path_length);
} }
ErrorOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Syscall::StringArgument const& path) const ErrorOr<NonnullOwnPtr<KString>> Process::get_syscall_path_argument(Syscall::StringArgument const& path)
{ {
Userspace<char const*> path_characters((FlatPtr)path.characters); Userspace<char const*> path_characters((FlatPtr)path.characters);
return get_syscall_path_argument(path_characters, path.length); return get_syscall_path_argument(path_characters, path.length);

View file

@ -546,8 +546,8 @@ private:
ErrorOr<siginfo_t> do_waitid(Variant<Empty, NonnullRefPtr<Process>, NonnullRefPtr<ProcessGroup>> waitee, int options); ErrorOr<siginfo_t> do_waitid(Variant<Empty, NonnullRefPtr<Process>, NonnullRefPtr<ProcessGroup>> waitee, int options);
ErrorOr<NonnullOwnPtr<KString>> get_syscall_path_argument(Userspace<const char*> user_path, size_t path_length) const; static ErrorOr<NonnullOwnPtr<KString>> get_syscall_path_argument(Userspace<const char*> user_path, size_t path_length);
ErrorOr<NonnullOwnPtr<KString>> get_syscall_path_argument(const Syscall::StringArgument&) const; static ErrorOr<NonnullOwnPtr<KString>> get_syscall_path_argument(const Syscall::StringArgument&);
bool has_tracee_thread(ProcessID tracer_pid); bool has_tracee_thread(ProcessID tracer_pid);

View file

@ -76,7 +76,7 @@ public:
virtual mode_t required_mode() const { return 0444; } virtual mode_t required_mode() const { return 0444; }
virtual UserID owner_user() const { return 0; } virtual UserID owner_user() const { return 0; }
virtual GroupID owner_group() const { return 0; } virtual GroupID owner_group() const { return 0; }
time_t modified_time() const { return TimeManagement::now().to_timeval().tv_sec; } static time_t modified_time() { return TimeManagement::now().to_timeval().tv_sec; }
virtual void prepare_for_deletion() { } virtual void prepare_for_deletion() { }
virtual ErrorOr<void> refresh_data(OpenFileDescription&) const virtual ErrorOr<void> refresh_data(OpenFileDescription&) const