From 59b88eccba554ac90263118c56590214eefd3fd5 Mon Sep 17 00:00:00 2001 From: Ken Thompson Date: Tue, 13 May 1975 19:49:30 -0500 Subject: [PATCH] Research V6 development Work on file usr/source/s1/clri.s Work on file usr/source/s1/chmod.c Co-Authored-By: Dennis Ritchie Synthesized-from: v6 --- usr/source/s1/chmod.c | 27 +++++++++++++++++++ usr/source/s1/clri.s | 63 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 usr/source/s1/chmod.c create mode 100644 usr/source/s1/clri.s diff --git a/usr/source/s1/chmod.c b/usr/source/s1/chmod.c new file mode 100644 index 0000000000..b6047836d7 --- /dev/null +++ b/usr/source/s1/chmod.c @@ -0,0 +1,27 @@ +main(argc, argv) +char **argv; +{ + register i, m; + register char *c; + int count; + + if(argc < 3) { + printf("arg count\n"); + exit(1); + } + c = argv[1]; + m = 0; + for(m=0; *c; c++) { + if(*c < '0' || *c > '7') { + printf("bad mode\n"); + exit(1); + } + m = (m<<3) | *c - '0'; + } + for(i=2; i +2: + +filsys: +.even + .bss +buf: .=.+512. -- 2.20.1