Page MenuHomeFreeBSD

SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information
ClosedPublic

Authored by kib on May 13 2024, 11:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 23, 1:50 AM
Unknown Object (File)
May 22 2024, 2:41 AM
Unknown Object (File)
May 19 2024, 3:54 AM
Unknown Object (File)
May 18 2024, 8:37 PM
Unknown Object (File)
May 18 2024, 9:47 AM
Unknown Object (File)
May 16 2024, 7:34 PM
Unknown Object (File)
May 16 2024, 5:49 PM
Unknown Object (File)
May 16 2024, 4:43 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.May 13 2024, 11:56 AM

The native FreeBSD ipcs command also uses these sysctl's.

The native FreeBSD ipcs command also uses these sysctl's.

So what is the problem with native?

In D45175#1030482, @kib wrote:

The native FreeBSD ipcs command also uses these sysctl's.

So what is the problem with native?

I couldn't statically compile the 32-bits version to try. But I don't know if it would hit the same error.

This revision is now accepted and ready to land.May 13 2024, 1:25 PM
sys/kern/sysv_msg.c
1442 ↗(On Diff #138468)

Is linprocfs only called from linux binaries?

sys/kern/sysv_msg.c
1442 ↗(On Diff #138468)

Oh, right, good point. We'd still want cat(1) etc. to work, so I think this diff isn't the right solution.

A 32bit freebsd cat reading /compat/linux/mumble

In D45175#1030482, @kib wrote:

The native FreeBSD ipcs command also uses these sysctl's.

So what is the problem with native?

Forget it. I just tried a 32-bits ipcs on 64-bits and it worked.

kib retitled this revision from sysvipc: use 32bit structures for kern.ipc reporting sysctls only for native 32bit to SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information.
kib edited the summary of this revision. (Show Details)
This revision now requires review to proceed.May 13 2024, 5:39 PM
markj added inline comments.
sys/kern/sysv_msg.c
1509 ↗(On Diff #138484)

I would just allocate the array with calloc() and not bother with all of this zeroing.

This revision is now accepted and ready to land.May 14 2024, 4:22 PM
sys/kern/sysv_msg.c
1509 ↗(On Diff #138484)

These members are copied by the assignments like *pmsqk = msgids[i] above. Pre-zeroing the array would not help.

This revision now requires review to proceed.May 16 2024, 3:34 PM

I can confirm the patch works as intended.

This revision was not accepted when it landed; it landed in state Needs Review.May 16 2024, 5:54 PM
This revision was automatically updated to reflect the committed changes.