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");
ACPI_SIZE strlen(const char *String)
char * strchr(const char *String, int ch)
int getopt(int nargc, char *const *nargv, const char *ostr)
GLsizeiptr const GLvoid GLenum usage
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
const char * strerror(int err)
_Check_return_opt_ _CRTIMP int __cdecl _close(_In_ int _FileHandle)
_Check_return_opt_ _CRTIMP long __cdecl _lseek(_In_ int _FileHandle, _In_ long _Offset, _In_ int _Origin)
_Check_return_ _CRTIMP int __cdecl _chmod(_In_z_ const char *_Filename, _In_ int _Mode)
_CRTIMP int __cdecl _write(_In_ int _FileHandle, _In_reads_bytes_(_MaxCharCount) const void *_Buf, _In_ unsigned int _MaxCharCount)
_Check_return_ _CRTIMP int __cdecl _read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
_CRTIMP int __cdecl _open(const char *_Filename, int _OpenFlag,...)
_Check_return_ _CRTIMP int __cdecl _chsize(_In_ int _FileHandle, _In_ long _Size)
_CRTIMP time_t __cdecl mktime(struct tm *_Tm)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
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)