On Sat, Dec 31, 2022 at 07:05:20PM +0100, Mark Kettenis wrote:
> > Date: Sat, 31 Dec 2022 10:33:26 -0500
> > From: Scott Cheloha <scottchel...@gmail.com>
> > 
> > Here's another one.
> > 
> > The progress meter in scp(1) and sftp(1) updates periodically, once
> > per second.  But using alarm(3) to repeatedly rearm the signal causes
> > that update period to drift forward:
> > 
> > [...]
> > 
> > If we use setitimer(2), the update period does not drift:
> > 
> > [...]
> 
> Bad idea.  The setitimer(2) interface is marked as "OB XSI" in POSIX,
> which means that it is considerent "Obsolescent" and may be removed in
> a future version of POSIX.  Since we want ssh to be as portable as
> possible we shouldn't use it there.

Strict POSIX conformance is pretty portable.  But in practice, I think
of portability as "using stuff everyone has".

POSIX has been hunting the 4.1cBSD time interfaces for over two
decades, but no practical operating system is going to remove
gettimeofday() or setitimer() just because POSIX prefers
clock_gettime() and timer_settime() (which we don't have).

Even Windows went with Linux: WSL2 has Linux syscall compatibility,
and they have setitimer().  Defined here:

https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-msft-wsl-5.15.y/kernel/time/itimer.c#L332

> Especially for something that really is just a cosmetic "fix".

I admit that this is a minor gripe.  I can live without it.

I hope that setitimer's looming POSIX obsolescence is not a barrier to
my using it in other programs in the tree, though.

Reply via email to