Skip to content

Conversation

@jmi-reds
Copy link
Contributor

@jmi-reds jmi-reds commented Nov 7, 2025

Basic futex syscall implementation.

It does only supports

  • FUTEX_WAIT and FUTEX_WAKE operation.
  • Timeout not supported

The implementation uses lists. It can be improved using hash table later.

Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
The implementation uses lists

Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
@jmi-reds jmi-reds self-assigned this Nov 7, 2025
@jmi-reds jmi-reds linked an issue Nov 7, 2025 that may be closed by this pull request
Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
@clemdiep clemdiep changed the base branch from main to 144-support-musl November 10, 2025 08:04
Copy link
Contributor

@clemdiep clemdiep left a comment

Choose a reason for hiding this comment

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

Overall, this seems ok. Just some small improvements

Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
/* no futex on futex_w */
futex = (futex_t *) calloc(1, sizeof(futex_t));
if (futex == NULL)
BUG();
Copy link
Contributor

Choose a reason for hiding this comment

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

Should also returned -EINVAL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is to indicate that calloc failed. Usually we put BUG().

Copy link
Contributor

Choose a reason for hiding this comment

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

Make sense :-)

Copy link
Contributor

@clemdiep clemdiep left a comment

Choose a reason for hiding this comment

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

Last small fix and then all good

Signed-off-by: Jean-Pierre Miceli <jean-pierre.miceli@heig-vd.ch>
@jmi-reds jmi-reds merged commit 774b56e into 144-support-musl Nov 17, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementation of futex syscall

4 participants