Skip to content
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

System V shared memory APIs (2nd draft) #2314

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
096cb21
First try at implementing SystemV
IzawGithub Feb 13, 2024
072352c
Add permission struct
IzawGithub Feb 14, 2024
adeaaa2
Add crude semaphore support
IzawGithub Feb 14, 2024
135488e
Add documentation that was missing
IzawGithub Feb 14, 2024
ac357e2
Add PR changelog file
IzawGithub Feb 14, 2024
3f6a4c3
Move SystemV to it's own file
IzawGithub Feb 19, 2024
5047036
Fix not compiling on Musl because of missing struct
IzawGithub Feb 20, 2024
b428de0
Fix clippy unsafe ptr arg dereference lint
IzawGithub Feb 20, 2024
07a6f33
Formatting parse
IzawGithub Feb 20, 2024
ac33ca0
Add missing import that I forgot to commit
IzawGithub Feb 20, 2024
11aad71
Update doctest path that changed
IzawGithub Feb 20, 2024
d8db9fa
Add basic IPC test.
IzawGithub Feb 20, 2024
bd938e6
Fix using latest Rust feature that was unstable before
IzawGithub Feb 20, 2024
b9a5905
Forgot a formatting parse
IzawGithub Feb 20, 2024
50916a4
Enable SystemV only for linux, but not Android
IzawGithub Feb 20, 2024
f3e4771
Update conditional compilation for GNU extension
IzawGithub Feb 20, 2024
9c71d97
Fix macro not compiling for NetBSD
IzawGithub Feb 20, 2024
5d0d37c
Fix moving shmid_ds to GNU extension when it's not
IzawGithub Feb 20, 2024
315eb31
Fix mistake in conditional compilation that didn't disable SystemV fo…
IzawGithub Feb 20, 2024
9374dcf
Add back cfg that disable some flags for BSD
IzawGithub Feb 20, 2024
bb07d5b
Final (I hope) formatting pass
IzawGithub Feb 20, 2024
19c713d
Disable test for non systemV platform
IzawGithub Feb 20, 2024
17561e6
Fix wrong changelog number and content
IzawGithub Mar 21, 2024
2b76711
Remove first try at SystemV, replacing with refractor
IzawGithub Mar 22, 2024
94e4e11
First try at refractoring SystemV to be more Rusty
IzawGithub Mar 22, 2024
aea8588
Add a feature gate
IzawGithub Mar 22, 2024
02b0de2
Add missing doc
IzawGithub Mar 22, 2024
ed99763
Fix doctest copy and paste error
IzawGithub Mar 22, 2024
b614d81
Remove Clone derive, wasn't working correctly
IzawGithub Mar 22, 2024
2629192
Update test to create an entirely new SharedMemory object
IzawGithub Mar 22, 2024
b7b8818
Misc formatting
IzawGithub Mar 22, 2024
930f352
Remove unused static mutex for system_v
IzawGithub Mar 24, 2024
4bd41cf
Add `Shm` wrapper for creating a shared memory segment
IzawGithub Mar 24, 2024
2c714c2
Remove function that create a memory segment from `SharedMemory`
IzawGithub Mar 24, 2024
6877712
Make `buf` parameter pass by ref
IzawGithub Mar 24, 2024
b7f6a09
Remove the `shmat` enum value that work with incompatible void ptr
IzawGithub Mar 24, 2024
d07c9b8
Update unit test
IzawGithub Mar 24, 2024
5697ffd
Update imported function
IzawGithub Mar 24, 2024
3d70ae2
Remove stable ptr_from_ref feature that isn't stable on Rust 1.69
IzawGithub Mar 24, 2024
238fe62
Remove unused comment mark
IzawGithub Mar 25, 2024
0ff180a
Add back `shmat` address. Use a raw pointer.
IzawGithub Mar 25, 2024
f5f2f59
Fix mismatched target os
IzawGithub Mar 25, 2024
2803e31
Fix wrong comment formatting
IzawGithub Mar 25, 2024
35c2f4e
Move `shmctl` function to `Shm`.
IzawGithub Mar 25, 2024
d05db61
Update doctest
IzawGithub Mar 25, 2024
ef1a839
Remove `id` from `SharedMemory` don't need it now that `shmctl` isn't…
IzawGithub Mar 25, 2024
e91efa3
Move test to independent file
IzawGithub Mar 25, 2024
d96d5ee
Follow Nix module convention
IzawGithub Mar 25, 2024
6aa8740
Update independent test import
IzawGithub Mar 25, 2024
fd108e4
Rename `system_v` feature to `sysvipc`, like Linux
IzawGithub Mar 25, 2024
2fde2c5
Update doctest import path
IzawGithub Mar 25, 2024
e531e8b
Remove `IPC_PRIVATE` value from `ShmgetFlag`, because it wasn't actua…
IzawGithub Mar 25, 2024
fee5acb
Formatting parse
IzawGithub Mar 25, 2024
52473ce
Update comment of function that moved
IzawGithub Mar 25, 2024
d526780
Fix typo `test_smh` to `test_shm`
IzawGithub Mar 26, 2024
400f71e
Add a test for unsafe `shmget`. Branch coverage is now 89.29%
IzawGithub Mar 26, 2024
d619c48
Improve code comment
IzawGithub Mar 26, 2024
ca0c5f9
Formatting parse
IzawGithub Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -64,6 +64,7 @@ resource = []
sched = ["process"]
signal = ["process"]
socket = ["memoffset"]
system_v = ["fs"]
IzawGithub marked this conversation as resolved.
Show resolved Hide resolved
term = []
time = []
ucontext = ["signal"]
Expand Down
1 change: 1 addition & 0 deletions changelog/2314.added.md
@@ -0,0 +1 @@
Add SystemV semaphore set and shared memory segments support.
6 changes: 6 additions & 0 deletions src/sys/mod.rs
Expand Up @@ -143,6 +143,12 @@ feature! {
#[allow(missing_docs)]
pub mod sysinfo;

#[cfg(any(bsd, target_os = "linux"))]
feature! {
#![feature = "system_v"]
pub mod system_v;
IzawGithub marked this conversation as resolved.
Show resolved Hide resolved
}

feature! {
#![feature = "term"]
#[allow(missing_docs)]
Expand Down
6 changes: 6 additions & 0 deletions src/sys/system_v/mod.rs
@@ -0,0 +1,6 @@
//! Interact with SystemV inter-process communication API

#[cfg(any(bsd, target_os = "linux"))]
pub mod sem;
#[cfg(any(bsd, target_os = "linux"))]
pub mod shm;
2 changes: 2 additions & 0 deletions src/sys/system_v/sem.rs
@@ -0,0 +1,2 @@
//! Safe wrapper around a SystemV semaphore
//!