[Jfs-discussion] file create time

David Collier-Brown David.Collier-Brown at Sun.COM
Sat Feb 4 15:43:24 GMT 2006



Dave Kleikamp wrote:
[...] through the jfs_debugfs utility.  The timestamp is set when the
>>>file is created, but never modified after that.
> He just submitted it to the jfs-discussion mailing list this morning, so
> it needs a little bit of review, but I think it will probably make the
> 2.6.17 kernel.

	Is there a straightforward way to detect this
	at both compile- and run-time?

	At **worst** one could try to dlsym a
	pointer to the interface the first time
	someone tries to use it and return
	errno=ENOTSUP to that and
	all subsequent calls if it's not there.

	int sys_set_create_time(int fd) {
		static enum exists (UNTESTED=-1,
			PRESENT=1, ABSENT=0} = UNTESTED;

		if (exists == UNTESTED) {
			if (dlsym(RTLD_NEXT,set_create_time) == NULL) {
				exists = ABSENT;
				errno = ENOTSUP;
				return -1;
			}
			else {
				exists = PRESENT
			}
		}
		switch (exists) {
		case ABSENT;
			errno = ENOTSUP;
			return -1;
		case PRESENT:
			return set_create_time(fd);
		}
	}
--dave
-- 
David Collier-Brown,      | Always do right. This will gratify
Sun Microsystems, Toronto | some people and astonish the rest
davecb at canada.sun.com     |                      -- Mark Twain
(416) 263-5733 (x65733)   |


More information about the samba-technical mailing list