-
Notifications
You must be signed in to change notification settings - Fork 5
feat(kernel): added unix domain socket subsystem with socketpair, bind/listen/accept/connect, and fcntl #60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0f82b11
feat(kernel): added unix domain socket subsystem with socketpair, bin…
FlareCoding 11b0604
fix: address bugbot findings in handle table and socket demo
cursoragent 5aae77b
fix: honor O_NONBLOCK in accept handler
cursoragent b38c7ea
refactor: deduplicate memset by delegating string::memset to extern C…
cursoragent c43b1b5
fix: add store barrier in connect and fix nonblock accept on closed l…
cursoragent 399e4b6
fix: return correct errno for non-unbound states in connect
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #include "fs/socket_node.h" | ||
| #include "fs/fs.h" | ||
| #include "socket/listener.h" | ||
|
|
||
| namespace fs { | ||
|
|
||
| socket_node::socket_node(instance* fs, const char* name) | ||
| : node(node_type::socket, fs, name) {} | ||
|
|
||
| int32_t socket_node::getattr(vattr* attr) { | ||
| if (!attr) { | ||
| return fs::ERR_INVAL; | ||
| } | ||
| attr->type = node_type::socket; | ||
| attr->size = 0; | ||
| return fs::OK; | ||
| } | ||
|
|
||
| void socket_node::set_listener(rc::strong_ref<socket::listener_state> ls) { | ||
| m_listener = static_cast<rc::strong_ref<socket::listener_state>&&>(ls); | ||
| } | ||
|
|
||
| } // namespace fs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #ifndef STELLUX_FS_SOCKET_NODE_H | ||
| #define STELLUX_FS_SOCKET_NODE_H | ||
|
|
||
| #include "fs/node.h" | ||
| #include "rc/strong_ref.h" | ||
|
|
||
| namespace socket { struct listener_state; } | ||
|
|
||
| namespace fs { | ||
|
|
||
| class socket_node : public node { | ||
| public: | ||
| socket_node(instance* fs, const char* name); | ||
|
|
||
| int32_t getattr(vattr* attr) override; | ||
|
|
||
| socket::listener_state* get_listener() const { return m_listener.ptr(); } | ||
| void set_listener(rc::strong_ref<socket::listener_state> ls); | ||
|
|
||
| private: | ||
| rc::strong_ref<socket::listener_state> m_listener; | ||
| }; | ||
|
|
||
| } // namespace fs | ||
|
|
||
| #endif // STELLUX_FS_SOCKET_NODE_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.