Page MenuHomeFreeBSD

sysvsem: Add a timeout argument to the semop.
ClosedPublic

Authored by dchagin on May 4 2022, 4:38 PM.
Tags
None
Referenced Files
F102908039: D35121.diff
Mon, Nov 18, 2:49 PM
Unknown Object (File)
Oct 1 2024, 6:45 AM
Unknown Object (File)
Sep 5 2024, 7:57 PM
Unknown Object (File)
Sep 4 2024, 8:41 PM
Unknown Object (File)
Sep 1 2024, 12:24 AM
Unknown Object (File)
Aug 31 2024, 3:55 AM
Unknown Object (File)
Aug 19 2024, 1:06 AM
Unknown Object (File)
Aug 17 2024, 5:20 AM
Subscribers

Details

Summary

For future use in the Linux emulation layer for the semtimedop syscall
split the sys_semop syscall into two counterparts and add
struct timespec *timeout argument to the last one.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 45465
Build 42353: arc lint + arc unit

Event Timeline

jhb added inline comments.
sys/kern/sysv_sem.c
1353

I think this is fine, but I would maybe write this bit instead as something like:

if (error != 0) {
   if (error == ERESTART)
       error = EINTR;
   goto done2;
}

I think that makes the intent clearer overall.

This revision is now accepted and ready to land.May 4 2022, 6:40 PM
sys/kern/sysv_sem.c
1156

There is very similar, if not identical code, both in your recent kern_sig.c changes, and in kern_event.c::kqueue_scan(). Can it be extracted into some common helper? Also it arguably requires a comment so that people easily see how we handle timeout precision.

sys/kern/sysv_sem.c
1156

Yes, the code is almost identical, I already thought about what you suggested. I'll do it a bit later, first I need to commit my local queue, it's too big.

1353

sure