tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: /dev/clockctl, O_CLOEXEC and forking



Christos Zoulas wrote:
> After fork it would work fine, after exec, not so much as the name implies :-)

Ah, you're right. 'step-systime: Bad file descriptor' messages in syslog
confused me.

> It may be closed by something else, but not the fork.

Something else breaks it, I guess. I will look further.

> Nevertheless
> we should not be exposing new API's here... We should arrange so that
> things just work. In this case, you could just call adjtime with a 0
> delta perhaps instead...

I don't like adding new public functions either but those functions
can be useful (if they are made hidden) because they avoid code
repetition and hide __clockctl_fd global variable.

I don't think adjtime will work because ntpd still runs as root and
it can't drop to an unprivileged user before it calls chroot(2).

-- 
Alex


Home | Main Index | Thread Index | Old Index