From c23af3a8c15510ed62ebd5d352b14b395e5e0d02 Mon Sep 17 00:00:00 2001 From: Mark Friedman Date: Thu, 5 Sep 1991 22:27:17 +0000 Subject: [PATCH] Added utime() to system calls and SET-FILE-TIMES! to primitives. --- v7/src/microcode/pruxfs.c | 19 ++++++++++++++++++- v7/src/microcode/utabmd.scm | 5 +++-- v7/src/microcode/ux.h | 5 ++++- v8/src/microcode/utabmd.scm | 5 +++-- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/v7/src/microcode/pruxfs.c b/v7/src/microcode/pruxfs.c index d9e980bef..40338c966 100644 --- a/v7/src/microcode/pruxfs.c +++ b/v7/src/microcode/pruxfs.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/pruxfs.c,v 9.44 1991/01/24 11:25:09 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/pruxfs.c,v 9.45 1991/09/05 22:26:48 markf Exp $ Copyright (c) 1987-91 Massachusetts Institute of Technology @@ -356,3 +356,20 @@ DEFUN (protect_fd, (fd), int fd) (*p) = fd; transaction_record_action (tat_always, protect_fd_close, p); } + +DEFINE_PRIMITIVE ("SET-FILE-TIMES!", Prim_set_file_times, 3, 3, + "Given a file name and two integers, change the access and modification \n\ +times of the file to the times represented by the two integers. \n\ +Those integers are the times in seconds since 00:00:00 GMT, Jan. 1, 1970 \n\ +The file must exist and you must be the owner (or superuser).") +{ + PRIMITIVE_HEADER (3); + { + struct utimbuf times; + + times.actime = arg_integer (2); + times.modtime = arg_integer (3); + STD_VOID_SYSTEM_CALL(syscall_utime, (UX_utime ((STRING_ARG (1)), ×))); + PRIMITIVE_RETURN (SHARP_F); + } +} diff --git a/v7/src/microcode/utabmd.scm b/v7/src/microcode/utabmd.scm index 372a41489..6c6c16f90 100644 --- a/v7/src/microcode/utabmd.scm +++ b/v7/src/microcode/utabmd.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $ ;;; ;;; Copyright (c) 1987-91 Massachusetts Institute of Technology ;;; @@ -628,6 +628,7 @@ TIME TIMES UNLINK + UTIME VFORK WRITE )) @@ -695,4 +696,4 @@ ;;; This identification string is saved by the system. -"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $" \ No newline at end of file +"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $" \ No newline at end of file diff --git a/v7/src/microcode/ux.h b/v7/src/microcode/ux.h index 3b422e722..4528702cc 100644 --- a/v7/src/microcode/ux.h +++ b/v7/src/microcode/ux.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.h,v 1.25 1991/08/24 02:27:37 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/ux.h,v 1.26 1991/09/05 22:26:30 markf Exp $ Copyright (c) 1988-91 Massachusetts Institute of Technology @@ -49,6 +49,7 @@ MIT in each case. */ #include #include #include +#include #include "oscond.h" #include "ansidecl.h" @@ -111,6 +112,7 @@ enum syscall_names syscall_time, syscall_times, syscall_unlink, + syscall_utime, syscall_vfork, syscall_write }; @@ -706,6 +708,7 @@ extern char * EXFUN (getlogin, (void)); #define UX_system system #define UX_time time #define UX_unlink unlink +#define UX_utime utime #define UX_write write #define UX_wait wait diff --git a/v8/src/microcode/utabmd.scm b/v8/src/microcode/utabmd.scm index 50c22bbce..71fe9ab77 100644 --- a/v8/src/microcode/utabmd.scm +++ b/v8/src/microcode/utabmd.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $ ;;; ;;; Copyright (c) 1987-91 Massachusetts Institute of Technology ;;; @@ -628,6 +628,7 @@ TIME TIMES UNLINK + UTIME VFORK WRITE )) @@ -695,4 +696,4 @@ ;;; This identification string is saved by the system. -"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.58 1991/08/24 01:51:14 cph Exp $" \ No newline at end of file +"$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/utabmd.scm,v 9.59 1991/09/05 22:27:17 markf Exp $" \ No newline at end of file -- 2.25.1