Here is what we need for udev to get the seconds since uptime. It implements the linux sysinfo system call. thanks, Kay -------------- next part -------------- diff -Nru a/klibc/SYSCALLS b/klibc/SYSCALLS --- a/klibc/SYSCALLS Sat Apr 3 01:37:12 2004 +++ b/klibc/SYSCALLS Sat Apr 3 01:37:12 2004 @@ -143,6 +143,7 @@ <!ia64> int query_module(const char *, int, void *, size_t, size_t) int reboot::__reboot(int, int, int, void *) int syslog::klogctl(int, char *, int) +int sysinfo(struct sysinfo *) # # Low-level I/O (generally architecture-specific) diff -Nru a/klibc/include/sys/sysinfo.h b/klibc/include/sys/sysinfo.h --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/klibc/include/sys/sysinfo.h Sat Apr 3 01:37:12 2004 @@ -0,0 +1,12 @@ +/* + * sys/sysinfo.h + */ + +#ifndef _SYS_SYSINFO_H +#define _SYS_SYSINFO_H + +#include <linux/kernel.h> + +extern int sysinfo (struct sysinfo *info); + +#endif /* _SYS_SYSINFO_H */
Kay Sievers wrote:> Here is what we need for udev to get the seconds since uptime. > It implements the linux sysinfo system call. >Why does udev need this info? -hpa
On Mon, Apr 05, 2004 at 12:36:37PM -0700, H. Peter Anvin wrote:> Kay Sievers wrote: > > Here is what we need for udev to get the seconds since uptime. > > It implements the linux sysinfo system call. > > > > Why does udev need this info?We need a monotonically increasing time source independent from the system time. The hotplug events are tagged with a timestamp to determine its age for timeout handling. If we use time() or similar and the init scripts are running ntpdate or changing the timezone from a localtime BIOS clock, set by some other stupid OS, udev gets confused. So I use the uptime seconds now, any better idea? thanks, Kay
On Tue, 6 Apr 2004 00:19:06 +0200 Kay Sievers wrote: | On Mon, Apr 05, 2004 at 12:36:37PM -0700, H. Peter Anvin wrote: | > Kay Sievers wrote: | > > Here is what we need for udev to get the seconds since uptime. | > > It implements the linux sysinfo system call. | > > | > | > Why does udev need this info? | | We need a monotonically increasing time source independent from the | system time. The hotplug events are tagged with a timestamp to | determine its age for timeout handling. If we use time() or similar and | the init scripts are running ntpdate or changing the timezone from a | localtime BIOS clock, set by some other stupid OS, udev gets confused. | So I use the uptime seconds now, any better idea? Uh, does that prevent (restrict) more than 1 hotplug event per second? -- ~Randy "We have met the enemy and he is us." -- Pogo (by Walt Kelly)
On Mon, Apr 05, 2004 at 03:17:29PM -0700, Randy.Dunlap wrote:> On Tue, 6 Apr 2004 00:19:06 +0200 Kay Sievers wrote: > > | On Mon, Apr 05, 2004 at 12:36:37PM -0700, H. Peter Anvin wrote: > | > Kay Sievers wrote: > | > > Here is what we need for udev to get the seconds since uptime. > | > > It implements the linux sysinfo system call. > | > > > | > > | > Why does udev need this info? > | > | We need a monotonically increasing time source independent from the > | system time. The hotplug events are tagged with a timestamp to > | determine its age for timeout handling. If we use time() or similar and > | the init scripts are running ntpdate or changing the timezone from a > | localtime BIOS clock, set by some other stupid OS, udev gets confused. > | So I use the uptime seconds now, any better idea? > > Uh, does that prevent (restrict) more than 1 hotplug event per second?Oh, come on :) No, it tags the event, waits for possibly missing sequences and runs all in the right order. Every event for different DEVPATH is executed in parallel and events for the same DEVPATH are executed one after the other. If a sequence is missing (normally it never happens) the later events are delayed by a maximum of 10 seconds. Kay