Re: [PATCH] [RFCv2] notify userspace about time changes

Greg KH
2010-08-19T15:40:11Z

On Thu, Aug 19, 2010 at 11:36:12AM +0300, Kirill A. Shutemov wrote:
> On Wed, Aug 18, 2010 at 09:09:37PM -0700, Greg KH wrote:
> > On Wed, Aug 18, 2010 at 04:53:03PM -0700, Andrew Morton wrote:
> > > Is sysfs the right interface for this thing? Bear in mind that
> > > CONFIG_SYSFS does exist.
> > >
> > > > + fd = open("/sys/kernel/time_notify", O_WRONLY);
> > > > + fdprintf(fd, "%d 1 0 1 1", efd);
> > >
> > > why not
> > >
> > > sys_time_notify(efd, 1, 0, 1, 1);
> >
> > Yeah, that would be much better than a sysfs file, this is abusing the
> > sysfs interface quite a lot.
>
> Do you really think, that increasing number of syscalls is better then
> fs-based interfaces?

As you are pretty much creating a new syscall here anyway, there is no
problem with making it a real one, right? That way you can properly
handle the user/kernel documentation and persistance over time (i.e. you
can't change it.)

So yes, a syscall would be better, especially as this does not exactly
fit into the model of sysfs, right?

thanks,

greg k-h