Re: [PATCH]: DELAYTIMER_MAX is defined

Ulrich Drepper
2003-05-07T07:36:33Z

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eric Piel wrote:

>>>Playing around with the posix timers I've noticed that DELAYTIMER_MAX is
>>>not defined. This constant is specified in the POSIX specifications. It
>>>should contain the maximum possible value of overruns on a signal. It is
>>>also said that the overrun shouldn't overflow. cf
>>>http://www.opengroup.org/onlinepubs/007904975/functions/timer_getoverrun.html

This is not correct. The constant does not have to be defined. Like
all the various *_MAX constants they only have to be defined if there is
a fixed limit the implementation has. If there is none or it can only
be defined dynamically at runtime the the macro must not be defined.
Instead sysconf() can provide the value. But not even this is
necessary. sysconf() can return -1.

Anyway, in this specific case the implementation should be protected
against the ever so improbable overflow of the counter, yes. If you
want a fixed value, fine. If you want to use ULONG_MAX (or whatever),
good too. Whether we advertise this limit is another thing.
Advertising it in the macro means it never can be changed.

- --
- --------------. ,-. 444 Castro Street
Ulrich Drepper \ ,-----------------' \ Mountain View, CA 94041 USA
Red Hat `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+uLpr2ijCOnn/RHQRAgiAAKCIj4hn7m/lkOIrLjHjqirTFPfvhQCeLbxB
cl9pJ+BTHy7VQzpCDeyjmSs=
=WTUD
-----END PGP SIGNATURE-----