Skip to content

Inconsistent naming for struct ipc_perm #4442

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

Open
xbjfk opened this issue May 3, 2025 · 0 comments
Open

Inconsistent naming for struct ipc_perm #4442

xbjfk opened this issue May 3, 2025 · 0 comments

Comments

@xbjfk
Copy link
Contributor

xbjfk commented May 3, 2025

Hello,

In musl, the struct ipc_perm has the fields __ipc_perm_key and __ipc_perm_seq. However, these are effectively internal-only names and are aliased to __key and __seq respectively. This is done in the sys/ipc.h header. This means, in C, you can effectively use either name.

For some reason this crate uses __ipc_perm_key, over __key.
__key is used as the field name not only by the glibc struct in this crate, but also the newer architectures (loongarch64 and riscv32/riscv64). Strangely, the name __seq is used instead of __ipc_perm_seq in the same struct.

Because of this, I propose using __key instead. This will reduce the need for compile-time checks of API consumers, remove the seemingly musl-internal name, and increase consistency across architectures/libcs.`

(I'm working on a fix, just using this issue for tracking)

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

No branches or pull requests

1 participant