# linux: futex v1 API cleanup · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/cfe5defd025b79ade5f9243a7d6ebaad176cb6ad)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: cfe5defd025b79ade5f9243a7d6ebaad176cb6ad

Requested commit: cfe5defd025b79ade5f9243a7d6ebaad176cb6ad

Commit: cfe5defd025b79ade5f9243a7d6ebaad176cb6ad

Tree: 7f85cd11d09dac313910d64610a8ceae649360bc

Author: Pat Tullmann

Committer: Pat Tullmann

## Message

```
linux: futex v1 API cleanup

* Use `packed struct` for flags arguments.  So, instead of
  `linux.FUTEX.WAIT` use `.{ .cmd = .WAIT, .private = true }`

* rename `futex_wait` and `futex_wake` which didn't actually specify
  wait/wake, as `futex_3arg` and `futex_4arg` (as its the number
  of parameters that is different, the `op` is whatever is specified.

* expose the full six-arg flavor of the syscall (for some of the advanced
  ops), and add packed structs for their arguments.

* Use a `packed union` to support the 4th parameter which is sometimes a
  `timespec` pointer, and sometimes a `u32`.

* Add tests that make sure the structure layout is correct and that the
  basic argument passing is working (no actual futexes are contended).

```

## Parents

- [850655f06b7dd8dc6e637d4980e6b7f9ac1b43d9](https://git.cafe/gitcafe/zig/commit/850655f06b7dd8dc6e637d4980e6b7f9ac1b43d9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/cfe5defd025b79ade5f9243a7d6ebaad176cb6ad?format=markdown)
