Skip to content

实现SystemV共享内存#690

Merged
fslongjin merged 9 commits intoDragonOS-Community:masterfrom
Jomocool:shared_memory
Apr 7, 2024
Merged

实现SystemV共享内存#690
fslongjin merged 9 commits intoDragonOS-Community:masterfrom
Jomocool:shared_memory

Conversation

@Jomocool
Copy link
Collaborator

@Jomocool Jomocool commented Apr 4, 2024

No description provided.

@dragonosbot
Copy link
Contributor

r? @fslongjin

dragonosbot has assigned @fslongjin.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@dragonosbot dragonosbot added O-x86_64 Target: x86_64 S-等待审查 Status: 等待assignee以及相关方的审查。 T-driver Relevant to the driver team, which will review and decide on the PR/issue. labels Apr 4, 2024
@fslongjin
Copy link
Member

这个pr目前有冲突哈哈 @Jomocool

@fslongjin
Copy link
Member

issue: #534

/// 最后一次连接的时间
shm_atim: i64,
/// 最后一次断开连接的时间
shm_dtim: i64,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个时间的话使用Instant结构体来表示会更好。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我觉得TimeSpec应该会更好一点,因为Linux用户程序获取这些时间的好像是ns级别

@dragonosbot dragonosbot added S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。 and removed S-等待审查 Status: 等待assignee以及相关方的审查。 labels Apr 6, 2024
@fslongjin
Copy link
Member

暂时没有看出逻辑上的问题,能否传个测试程序上来?

@dragonosbot dragonosbot added A-fs Area: 文件系统 T-virtulization Relevant to the virtulization team, which will review and decide on the PR/issue. S-等待审查 Status: 等待assignee以及相关方的审查。 and removed S-等待作者修改 Status: 这正在等待作者的一些操作(例如代码更改或更多信息)。 labels Apr 7, 2024
@Jomocool
Copy link
Collaborator Author

Jomocool commented Apr 7, 2024

@dragonosbot review

Copy link
Collaborator Author

@Jomocool Jomocool left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试程序test_shm:

  • sender:将信息写入共享内存中然后发送给receiver
  • receiver:连接到sender创建的共享内存并读取数据
  • info:打印共享内存各种信息

mtime: PosixTimeSpec::default(),
ctime: PosixTimeSpec::default(),
file_type: FileType::Dir,
mode: ModeType::from_bits_truncate(0x777),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

笑死,我发现这里有个bug,mode应该是0o777而不是0x777

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈哈,还真是

@fslongjin
Copy link
Member

测试程序test_shm:

  • sender:将信息写入共享内存中然后发送给receiver
  • receiver:连接到sender创建的共享内存并读取数据
  • info:打印共享内存各种信息

为了跟其他测试程序作区分,我把他改了一下,加上了test_shm_这个前缀哈哈。

@fslongjin fslongjin merged commit 6fc066a into DragonOS-Community:master Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-fs Area: 文件系统 O-x86_64 Target: x86_64 S-等待审查 Status: 等待assignee以及相关方的审查。 T-driver Relevant to the driver team, which will review and decide on the PR/issue. T-virtulization Relevant to the virtulization team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants