Question: Create a program in C using Xv6 O.S. where: 1. The program reads lines of a file and then prints out all of the lines
Create a program in C using Xv6 O.S. where:
1. The program reads lines of a file and then prints out all of the lines of the file MINUS consecutive lines that are duplicates of one another
2. If there is no file, the program reads the input from stdin and does the same
(Xv6 C is a little different to the C we're used to, as there is no stdio, printf calls 2 parameters, etc.
You can view the code in this file that controls for word count to help get a better sense of the format:
#include #include #include "types.h" "stat.h" "user,h" char buf[5121; void wc (int fd, char *name) int i, n; int 1, w, c, inword; inword while((n - ; =read(fd, buf, sizeof (buf))) > 0){ for(i-e; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
