Current-Users archive

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

Re: christos-time_t has been merged

On Jan 12, 12:34am, (Izumi Tsutsui) wrote:
-- Subject: Re: christos-time_t has been merged

| I have not checked whole libsa sources, but I think current
| time_t values in libsa are used to see timeout.
| In most case the timeout value is small enough to represent it
| even in short. (MAXTMO is 20 in sys/lib/libsa/net.h)
| On the other hand, MD sources must provide the getsecs() function
| to see relative time and it currently also returns time_t, 
| but it might be better to use unsigned (and smaller) types
| to allow ignoring wraparound.
| Actually there are few MD getsecs() which return full 32bit values,
| and some of them just returns 0~59 using "sec" of TOD clock device
| to simplify code.
| So how about the following types for libsa?
| 1) use uint16_t for getsecs()
|  65536 secs == ~18 hours are enough for boot, and
|  only three files in sys/lib/libsa refer it.
|  (not sure how many MD drivers also use it though)
| 2) use int for all other functions which use time_t for timeout seconds
|  Then mechanical replacements time_t -> int will work.
|  (I guess most backend drivers implicitly convert it to int or u_int
|   via their prototype)
| Comments?

I am fine with both suggestions, but don't you think that having typedefs
instead of using naked types is better?


Home | Main Index | Thread Index | Old Index