Page MenuHomeFreeBSD

Fix compat32 for ntp_adjtime(2).
ClosedPublic

Authored by kib on Dec 3 2020, 10:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 12 2024, 6:11 AM
Unknown Object (File)
Oct 6 2024, 5:08 PM
Unknown Object (File)
Oct 1 2024, 4:25 AM
Unknown Object (File)
Sep 27 2024, 6:45 PM
Unknown Object (File)
Sep 26 2024, 2:33 AM
Unknown Object (File)
Sep 24 2024, 7:16 PM
Unknown Object (File)
Sep 24 2024, 4:14 PM
Unknown Object (File)
Sep 24 2024, 5:43 AM

Details

Summary

Add kern_ntp_adjtime(9).
struct timex is not 32-bit safe, it uses longs for members. Provide translation.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Dec 3 2020, 10:00 PM

I don't see any issues worth noting.

This revision is now accepted and ready to land.Dec 3 2020, 11:12 PM

I'd be tempted to pass timex_copyin and timex_copyout function pointers to kern_ntp_adjtime rather than having duplicate code in sys_ and freebsd32_. That would also simplify a future compat syscall implementation.

sys/kern/kern_ntptime.c
1089–1109 ↗(On Diff #80286)

This looks like it's part of a future syscall revision, not the compat change?

kib marked an inline comment as done.Dec 3 2020, 11:42 PM

I'd be tempted to pass timex_copyin and timex_copyout function pointers to kern_ntp_adjtime rather than having duplicate code in sys_ and freebsd32_. That would also simplify a future compat syscall implementation.

Right now it seems there will be no compat syscall, ie struct timex is not going to change.

Do you still want copyin callbacks there ? It is more overhead in code for rather trivial wrappers IMO.

This revision now requires review to proceed.Dec 3 2020, 11:42 PM

Without a compat syscall it seems fine to leave this as is.

This revision is now accepted and ready to land.Dec 4 2020, 4:39 PM
This revision was automatically updated to reflect the committed changes.