On Wed, Dec 27 2017, "Theo de Raadt" <dera...@openbsd.org> wrote: >> > I really don't get the cruscade agains gettimeofday(). Despite what >> > POSIX may say, it is not going away. And what you're proposing isn't >> > really an optimization. As far as I'm concerned this is just >> > (unwanted) churn. >> >> I don't think there's a crusade here; time(3) gives us shorter code in >> auth_unix.c, and still uses gettimeofday(2) under the hood. The two >> other diffs are dead code removal. I think it's worth it, ok jca@ > > time(3) is not actually shorter code. It is a deeper function call; > it is running more instructions. At runtime it isn't shorter code,
I really doubt that the performance impact is meaningful, and that's still less boilerplate code, something desirable IMO. > and the visible aspect is irrelevant since I have to hunt for the > sub-second initialization. > > Since timespecs also use tv_* prefixes, a hint about the other sub-second > field is being lost, also, sometimes the clearing of the sub-second field > isn't in the same place it is missing. What do you have in mind when you say "sub-second initialization"? The idea is to use time(3) when all you need is *seconds*. -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE