1) As far as we can tell, the ftime() function call that appears in most BSD
UNIX systems (including Sun UNIX) is obsolete and now replaced by the
gettimeofday() function call. A/UX has gettimeofday() but not ftime().
From the structure returned by ftime() and the new structures used by
gettimeofday(), it should not be difficult to use the new gettimeofday()
instead of the obsoleted ftime(). The structure returned by ftime() is
defined in <sys/timeb.h> of BSD UNIX as:
struct timeb
{
time_t time;
unsigned short millitm;
short timezone;
short dstflag;
};
The structures used by gettimeofday() are defined in <sys/time.h> as:
struct timeval {
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
};
struct timezone {
int tz_minuteswest; /* Greenwich */
int tz_dsttime; /* type of dst correct to apply */
};
2) To do a synchronous write to DISK, the fsync (2) system call should be
used after the write(2) or writev (2) system call. The fsync (2) system
call causes all in-core copies of buffers for the associated file to be
written to a DISK. See fsync (2) manual page for more information.
Note that the use of the O_NDELAY and O_NONBLOCK flags in the open() system
call for controlling I/O applies only to FIFOs and communication lines like
tty's. See open (2) manual pages for more information.