is struct utimbuf in the standard sys/types.h?

karish at mindcraft.com karish at mindcraft.com
Wed Aug 8 08:03:59 AEST 1990


Submitted-From: mindcrf!karish at ucbvax.Berkeley.EDU
From:  karish at mindcraft.com

In article <10980 at cs.utexas.edu> guy at auspex.uucp (Guy Harris) writes:
|Unfortunately, the application is non-functional (at least not
|*correctly* functional) if it *doesn't* initialize the vendor-defined
|fields of a structure that's handed to the system ...

|... a
|portable application can, at best, only avoid setting the microseconds
|values of a file's accessed or modified times to some random value by
|"memset"ting the entire "utimbuf" structure to zero before filling it in
|and using it (or otherwise ensuring that the structure is zero before
|using it, e.g. using a static structure).

Keeping in mind, of course, that memset() may not be present on a POSIX
system that provides common-usage C language-dependent support.

Another ugly way to initialize the storage would be to make liberal use
of calloc() and free().
-- 

	Chuck Karish		karish at mindcraft.com
	Mindcraft, Inc.		(415) 323-9000		


Volume-Number: Volume 21, Number 22



More information about the Comp.std.unix mailing list