Bug #14985
closedadjtime could be more const
100%
Description
Our definition for adjtime
does not specify the first argument as const:
int adjtime(struct timeval *delta, struct timeval *olddelta);
This is at odds with most other UNIX-y platforms such as Linux, FreeBSD, NetBSD, etc, which declare the delta
argument as const.
I noticed this discrepancy when the rust libc tests began emitting errors on illumos since their declared FFI symbol for adjtime was recently updated to feature a const delta
.
It seems relatively safe to update ours to match.
Updated by Patrick Mooney about 1 year ago
On a machine running these bits, I repeated an illumos build to ensure that the change in adjtime()
prototype in /usr/include
did not somehow have adverse effects on the build. The full build completed with no issues.
With the patch installed, the portion of the rust-libc test suite relating to adjtime
now passes, since its prototype matches those in other OSes (and rust-libc assumes a common signature for all UNIX-y operating systems).
Updated by Patrick Mooney about 1 year ago
The updated man page shows the correct signature:
SYNOPSIS #include <sys/time.h> int adjtime(const struct timeval *delta, struct timeval *olddelta);
Updated by Patrick Mooney about 1 year ago
- Status changed from New to Pending RTI
- Assignee set to Patrick Mooney
- % Done changed from 0 to 90
Updated by Electric Monk about 1 year ago
- Status changed from Pending RTI to Closed
- % Done changed from 90 to 100
git commit b93865c3d90e9b0d73e338c9abb3293c35c571a8
commit b93865c3d90e9b0d73e338c9abb3293c35c571a8 Author: Patrick Mooney <pmooney@pfmooney.com> Date: 2022-10-03T17:05:12.000Z 14985 adjtime could be more const Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@mnx.io>