41"@(#) Copyright (c) 1993 Regents of the University of California.\n\
42 All rights reserved.\n";
58#define DEFFILEMODE S_IWRITE
88 aflag = cflag = fflag =
mflag = timeset = 0;
121 if (aflag == 0 &&
mflag == 0)
128 if (!timeset &&
argc > 1) {
131 if (*
p ==
'\0' && (
len == 8 ||
len == 10)) {
197#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
228 t->tm_year += yearset;
232 t->tm_year = yearset + 2000;
234 t->tm_year = yearset + 1900;
253 "out of range or illegal time specification: [[CC]YY]MMDDhhmm[.SS]");
276 "out of range or illegal time specification: MMDDhhmm[yy]");
286 tvp[0] =
sb.st_atime;
287 tvp[1] =
sb.st_mtime;
291rw(
char *fname,
struct stat *sbp,
int force)
293 int fd, needed_chmod,
rval;
302 needed_chmod =
rval = 0;
312 if (
_read(
fd, &
byte,
sizeof(
byte)) !=
sizeof(
byte))
316 if (
_write(
fd, &
byte,
sizeof(
byte)) !=
sizeof(
byte))
319 if (
_write(
fd, &
byte,
sizeof(
byte)) !=
sizeof(
byte)) {
325 warn(
"%s: file modified", fname);
335 warn(
"%s: permissions modified", fname);
345 "usage: touch [-acfm] [-r file] [-t time] file ...\n");
int getopt(int nargc, char *const *nargv, const char *ostr)
char *CDECL strerror(int err)
int CDECL _read(int fd, void *buf, unsigned int count)
int CDECL _chmod(const char *path, int flags)
int WINAPIV fprintf(FILE *file, const char *format,...)
int CDECL _write(int fd, const void *buf, unsigned int count)
int CDECL _chsize(int fd, __msvcrt_long size)
__msvcrt_long CDECL _lseek(int fd, __msvcrt_long offset, int whence)
int WINAPIV _open(const char *path, int flags,...)
_ACRTIMP __msvcrt_long __cdecl strtol(const char *, char **, int)
_ACRTIMP char *__cdecl strchr(const char *, int)
_ACRTIMP size_t __cdecl strlen(const char *)
static time_t mktime(struct tm *tm)
static struct tm * localtime(const time_t *t)
GLsizeiptr const GLvoid GLenum usage
void stime_arg1(char *arg, time_t *tvp)
void stime_file(char *fname, time_t *tvp)
void stime_arg2(char *arg, int year, time_t *tvp)