-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfsLowDriver.c
More file actions
53 lines (49 loc) · 1.29 KB
/
fsLowDriver.c
File metadata and controls
53 lines (49 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
#include <errno.h>
#include <math.h>
#include "fsLow.h"
//int main (int argc, char *argv[])
// {
// char * filename;
// uint64_t volumeSize;
// uint64_t blockSize;
// int retVal;
//
// if (argc > 3)
// {
// filename = argv[1];
// volumeSize = atoll (argv[2]);
// blockSize = atoll (argv[3]);
// }
//
// retVal = startPartitionSystem (filename, &volumeSize, &blockSize);
// printf("Opened %s, Volume Size: %llu; BlockSize: %llu; Return %d\n", filename, (ull_t)volumeSize, (ull_t)blockSize, retVal);
//
// char * buf = malloc(blockSize *2);
// char * buf2 = malloc(blockSize *2);
// memset (buf, 0, blockSize*2);
// strcpy (buf, "Now is the time for all good people to come to the aid of their countrymen\n");
// strcpy (&buf[blockSize+10], "Four score and seven years ago our fathers brought forth onto this continent a new nation\n");
// LBAwrite (buf, 2, 0);
// LBAwrite (buf, 2, 3);
// LBAread (buf2, 2, 0);
// if (memcmp(buf, buf2, blockSize*2)==0)
// {
// printf("Read/Write worked\n");
// }
// else
// printf("FAILURE on Write/Read\n");
//
// free (buf);
// free(buf2);
// closePartitionSystem();
// return 0;
// }