home *** CD-ROM | disk | FTP | other *** search
- static char sccs_id[] = "@(#) utime.c 1.2 " __DATE__ " HJR";
-
- /* utime.c (c) Copyright 1990 H.Rogers */
-
- #include <errno.h>
- #include <time.h>
-
- #include "sys/unix.h"
- #include "sys/os.h"
-
- int
- utime (char *file, register time_t * tp)
- {
- int r[6];
- os_error *e;
-
- if (!tp)
- {
- errno = EINVAL;
- return (-1);
- }
-
- file = __uname (file, 0);
-
- if (e = os_file (0x05, file, r))
- {
- __seterr (e);
- return (-1);
- }
- if (!r[0])
- {
- errno = ENOENT;
- return (-1);
- }
-
- r[2] = (r[2] & 0x000fff00U) | 0xfff00000U |
- ((((tp[1] >> 8) * 100) >> 24) + 0x33);
- r[3] = tp[1] * 100 + 0x6e996a00U;
-
- if (e = os_file (0x01, file, r))
- {
- __seterr (e);
- return (-1);
- }
-
- return (0);
- }
-