1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

Kernel: Allow Socket subclasses to fail construction

For example, socket(AF_INET) should only succeed for valid SOCK_TYPEs.
This commit is contained in:
Andreas Kling 2020-01-23 18:11:14 +01:00
parent a93f35ac71
commit 03d73cbaae
5 changed files with 7 additions and 6 deletions

View file

@ -35,7 +35,7 @@ class FileDescription;
class LocalSocket final : public Socket, public InlineLinkedListNode<LocalSocket> {
friend class InlineLinkedListNode<LocalSocket>;
public:
static NonnullRefPtr<LocalSocket> create(int type);
static KResultOr<NonnullRefPtr<Socket>> create(int type);
virtual ~LocalSocket() override;
static void for_each(Function<void(LocalSocket&)>);