[comp.sys.atari.st] Help! Fdatime

maloff@calgary.UUCP (Sheldon Maloff) (08/22/87)

I'm hoping somebody out there can help me with this. I'm converting a
'make' program to compile and link under Lattice C 3.03. Everything works
except the 'touch' module. I'm having problems with the gemdos call
'Fdatime().'

The program lines looks like:

#define Fdatime(a,b,c)	gemdos(0x57,a,b,c)
		.
		.
		.
	unsigned long time;	/* declarations of variables */
	short fd;		/* file handle */
		.
		.		/* code to open a file via gemdos */
		.		/* and set the time		  */
		.
	Fdatime(fd,&time,1);	/* time stamp the file */
	Fclose(fd);

The program bombs in Fdatime() with 2 bombs (buss error). I've heard the
'Hitchhiker's Guide to the Bios' is wrong and  was recommended to try

	Fdatime(&time,fd,1);	/* first two args switched */

The program now bombs with 3 bombs (address error).
I think I've tried almost every combination of passing in (short) and 
(long) casts within the function call, but I still get the same
two errors. After two days of this, I'm getting rather annoyed. What
am I doing wrong?  The variable fd = 6, and time = valid Dos time format,
and the program always throws up at the Fdatime() function. This isn't
the first time I've had a fight with the Lattice C compiler, but this time
I don't know if its me, Lattice, or the OS. Gemdos calls are new to me.

	Sheldon.

        seismo!calgary!maloff
	maloff@calgary.UUCP