mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 09:49:15 +03:00
Kernel: Allow changing thread names with the "stdio" promise
It's useful for programs to change their thread names to say something interesting about what they are working on. Let's not require "thread" for this since single-threaded programs may want to do it without pledging "thread".
This commit is contained in:
parent
ded78fc074
commit
4d777a9bf4
Notes:
sideshowbarker
2024-07-18 22:42:59 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4d777a9bf48
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -150,7 +150,7 @@ int Process::sys$join_thread(pid_t tid, Userspace<void**> exit_value)
|
|||||||
|
|
||||||
int Process::sys$set_thread_name(pid_t tid, Userspace<const char*> user_name, size_t user_name_length)
|
int Process::sys$set_thread_name(pid_t tid, Userspace<const char*> user_name, size_t user_name_length)
|
||||||
{
|
{
|
||||||
REQUIRE_PROMISE(thread);
|
REQUIRE_PROMISE(stdio);
|
||||||
auto name = copy_string_from_user(user_name, user_name_length);
|
auto name = copy_string_from_user(user_name, user_name_length);
|
||||||
if (name.is_null())
|
if (name.is_null())
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
Loading…
Reference in New Issue
Block a user