mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
Kernel: Implement getsockopt(SO_TYPE)
This is easy to implement, and is required by some applications like python's ssl module.
This commit is contained in:
parent
bc49ce72c1
commit
d16131b100
Notes:
sideshowbarker
2024-07-18 03:17:49 +09:00
Author: https://github.com/rtobar
Commit: d16131b100
Pull-request: https://github.com/SerenityOS/serenity/pull/10270
1 changed files with 6 additions and 0 deletions
|
@ -187,6 +187,12 @@ KResult Socket::getsockopt(OpenFileDescription&, int level, int option, Userspac
|
|||
TRY(copy_to_user(static_ptr_cast<int*>(value), &m_timestamp));
|
||||
size = sizeof(int);
|
||||
return copy_to_user(value_size, &size);
|
||||
case SO_TYPE:
|
||||
if (size < sizeof(int))
|
||||
return EINVAL;
|
||||
TRY(copy_to_user(static_ptr_cast<int*>(value), &m_type));
|
||||
size = sizeof(int);
|
||||
return copy_to_user(value_size, &size);
|
||||
default:
|
||||
dbgln("setsockopt({}) at SOL_SOCKET not implemented.", option);
|
||||
return ENOPROTOOPT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue