Page MenuHomeFreeBSD

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

Authored by kib on Mon, May 13, 11:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 22, 2:41 AM
Unknown Object (File)
Sun, May 19, 3:54 AM
Unknown Object (File)
Sat, May 18, 8:37 PM
Unknown Object (File)
Sat, May 18, 9:47 AM
Unknown Object (File)
Thu, May 16, 7:34 PM
Unknown Object (File)
Thu, May 16, 5:49 PM
Unknown Object (File)
Thu, May 16, 4:43 PM
Unknown Object (File)
Tue, May 14, 6:29 PM

Diff Detail

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

Event Timeline

kib requested review of this revision.Mon, May 13, 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.Mon, May 13, 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.Mon, May 13, 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.Tue, May 14, 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.Thu, May 16, 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.Thu, May 16, 5:54 PM
This revision was automatically updated to reflect the committed changes.