Signed-off-by: Timothy Manning <tfhmanning@gmail.com>
$ mkdir /mnt/y
$ mount -t yaffs2 /dev/mtdblock0 /mnt/y
$ mkdir /mnt/y
$ mount -t yaffs2 /dev/mtdblock0 /mnt/y
How to change the permissions on the nandsim partition
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
$ sudo chmod a+wr /mnt/y/
#check the permission change
$ touch /mnt/y/test_file
How to clean the folder
-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;
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)
{
int get_exit_on_error(void)
{
node *new_node=NULL;
if (pos==HEAD){
new_node=malloc(sizeof(node));
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;
new_node->string=NULL;
new_node->next=head_node;
return new_node;
char * generate_random_string(unsigned int length)
{
char * generate_random_string(unsigned int length)
{
unsigned int x;
for (x=0;x<(length-1);x++)
{
unsigned int x;
for (x=0;x<(length-1);x++)
{
string[x]='\0';
return string;
}
string[x]='\0';
return string;
}
void set_print_level(int new_level)
{
PRINT_LEVEL=new_level;
void set_print_level(int new_level)
{
PRINT_LEVEL=new_level;
void print_message(char print_level,char *message)
{
if (print_level <= PRINT_LEVEL){
void print_message(char print_level,char *message)
{
if (print_level <= PRINT_LEVEL){
-unsigned int random_int(void)
- return (random()%4294967295);
+ return (random()%1000000);
}
void check_function(int output)
}
void check_function(int output)
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#define NAME_RANGE 10
#define ROOT_PATH "/mnt/y/"
#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);
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);
char * generate_random_string(unsigned int length);
void get_error_linux(void);
void check_function(int output);
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);
sprintf(message,"seeding srand with: %d\n",x);
print_message(2,message);
srand(x);
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);
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);
dir_data=readdir(open_dir);
}
closedir(open_dir);
#ifndef __linux_test_h__
#define __linux_test_h__
#include <stdio.h>
#ifndef __linux_test_h__
#define __linux_test_h__
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>