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)
Thu, Nov 7, 11:04 AM
Unknown Object (File)
Wed, Nov 6, 7:25 PM
Unknown Object (File)
Wed, Oct 23, 7:27 AM
Unknown Object (File)
Fri, Oct 18, 9:08 AM
Unknown Object (File)
Thu, Oct 17, 8:45 AM
Unknown Object (File)
Thu, Oct 17, 8:03 AM
Unknown Object (File)
Wed, Oct 16, 10:10 PM
Unknown Object (File)
Oct 14 2024, 10:25 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.