Page MenuHomeFreeBSD

fattime: make the test code build again
ClosedPublic

Authored by jeffpc_josefsipek.net on Apr 12 2024, 2:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 21, 2:10 AM
Unknown Object (File)
Thu, Dec 18, 7:22 PM
Unknown Object (File)
Tue, Dec 16, 3:40 AM
Unknown Object (File)
Thu, Dec 11, 1:35 PM
Unknown Object (File)
Wed, Nov 26, 1:07 AM
Unknown Object (File)
Nov 23 2025, 6:20 PM
Unknown Object (File)
Nov 8 2025, 6:07 PM
Unknown Object (File)
Oct 19 2025, 8:55 PM
Subscribers

Details

Summary

This change...

  1. replaces calls to timet2fattime/fattime2timet with calls to timespec2fattime/fattime2timespec. The functions got renamed shortly after they landed in the kernel but the test code wasn't updated (see 7ea93e912bf0ef).
  2. adds a utc_offset stub.

With this, the test code builds and runs as a 32-bit binary (cc -Wall -O2
-m32 subr_fattime.c).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57043
Build 53931: arc lint + arc unit

Event Timeline

sys/kern/subr_fattime.c
301

why 1?

sys/kern/subr_fattime.c
301

I'm not happy with hardcoding 1 like this, but...

  1. the original test code assumed UTC (the subsequent change that renamed the functions (and broke the test) also added the int utc arg) and using 1 keeps the test UTC-based (not that it matters since the stub for utc_offset() always returns 0)
  2. the arg is int, so it seems wrong to use anything other than 0 or 1.
This revision is now accepted and ready to land.Apr 28 2024, 8:48 PM
This revision was automatically updated to reflect the committed changes.