$ mkdir /mnt/y
$ mount -t yaffs2 /dev/mtdblock0 /mnt/y
+
+
How to change the permissions on the nandsim partition
+
$ sudo chmod a+wr /mnt/y/
#check the permission change
$ touch /mnt/y/test_file
How to clean the folder
+
$ rm -rf /mnt/y
-The test must me run in sudo to work
+
+The test must be run in sudo to work
+
+$ make
+$ sudo ./linux_test
static char message[200];
static int PRINT_LEVEL = 3;
static int exit_on_error_val =1;
+char string[FILE_NAME_LENGTH+1];
+
int get_exit_on_error(void)
{
node *new_node=NULL;
if (pos==HEAD){
new_node=malloc(sizeof(node));
- memset(new_node, NULL, sizeof(node));
+ memset(new_node, 0, sizeof(node));
new_node->string=NULL;
new_node->next=head_node;
return new_node;
char * generate_random_string(unsigned int length)
{
- char string[length+1];
+
unsigned int x;
for (x=0;x<(length-1);x++)
{
string[x]='\0';
return string;
}
+
void set_print_level(int new_level)
{
PRINT_LEVEL=new_level;
void print_message(char print_level,char *message)
{
if (print_level <= PRINT_LEVEL){
- printf(message);
+ printf("%s",message);
}
}
-unsigned int random_int(void)
+int random_int(void)
{
- return (random()%4294967295);
+ return (random()%1000000);
}
void check_function(int output)
#include <errno.h>
#include <stdio.h>
#include <string.h>
-#include "yaffsfs.h"
+#include <stdlib.h>
#define NAME_RANGE 10
#define ROOT_PATH "/mnt/y/"
void set_exit_on_error(int val);
int delete_linked_list(node *head_node);
node * linked_list_add_node(int pos,node *head_node);
-unsigned int random_int(void);
+int random_int(void);
char * generate_random_string(unsigned int length);
void get_error_linux(void);
void check_function(int output);
sprintf(message,"seeding srand with: %d\n",x);
print_message(2,message);
srand(x);
- yaffs_set_trace(0);
+
do {
dir->path_list->string=malloc(strlen(dir_data->d_name)+1);
strcpy(dir->path_list->string,dir_data->d_name);
sprintf(message,"opened file: %s\n",dir->path_list->string);
- print_message(3,message);
+ print_message(5,message);
dir_data=readdir(open_dir);
}
closedir(open_dir);
#ifndef __linux_test_h__
#define __linux_test_h__
#include <stdio.h>
+#include <stdlib.h>
#include <dirent.h>
-#include "yaffsfs.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>