summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-24 20:58:47 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-02-24 20:58:47 +0000
commit3cf8394af5f646642df593c8de833441e186af64 (patch)
tree879804337835a352853d5eb06d31565d4dba33d7
parentMoved mpc860.h around to make things compile. (diff)
downloadrtems-3cf8394af5f646642df593c8de833441e186af64.tar.bz2
Changed IMFS to use IMFS_NAME_MAX as the maximum length of a basename
rather then NAME_MAX. NAME_MAX is 255 and that lets IMFS chew up memory too fast. Perhaps in the future, the places in IMFS that put a maximum length name string on the stack and the jnode structure does not include a maximu length name string can be fixed so this is not a problem.
-rw-r--r--c/src/exec/libcsupport/src/mount.c6
-rw-r--r--c/src/exec/libfs/src/imfs/imfs.h36
-rw-r--r--c/src/exec/libfs/src/imfs/imfs_creat.c2
-rw-r--r--c/src/exec/libfs/src/imfs/imfs_eval.c4
-rw-r--r--c/src/exec/libfs/src/imfs/imfs_gtkn.c4
-rw-r--r--c/src/exec/libfs/src/imfs/imfs_link.c2
-rw-r--r--c/src/exec/libfs/src/imfs/imfs_mknod.c2
-rw-r--r--c/src/exec/libfs/src/imfs/imfs_symlink.c2
-rw-r--r--c/src/lib/libc/imfs.h36
-rw-r--r--c/src/lib/libc/imfs_creat.c2
-rw-r--r--c/src/lib/libc/imfs_eval.c4
-rw-r--r--c/src/lib/libc/imfs_gtkn.c4
-rw-r--r--c/src/lib/libc/imfs_link.c2
-rw-r--r--c/src/lib/libc/imfs_mknod.c2
-rw-r--r--c/src/lib/libc/imfs_symlink.c2
-rw-r--r--c/src/lib/libc/mount.c6
-rw-r--r--c/src/libfs/src/imfs/imfs.h36
-rw-r--r--c/src/libfs/src/imfs/imfs_creat.c2
-rw-r--r--c/src/libfs/src/imfs/imfs_eval.c4
-rw-r--r--c/src/libfs/src/imfs/imfs_gtkn.c4
-rw-r--r--c/src/libfs/src/imfs/imfs_link.c2
-rw-r--r--c/src/libfs/src/imfs/imfs_mknod.c2
-rw-r--r--c/src/libfs/src/imfs/imfs_symlink.c2
-rw-r--r--cpukit/libcsupport/src/mount.c6
-rw-r--r--cpukit/libfs/src/imfs/imfs.h36
-rw-r--r--cpukit/libfs/src/imfs/imfs_creat.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_eval.c4
-rw-r--r--cpukit/libfs/src/imfs/imfs_gtkn.c4
-rw-r--r--cpukit/libfs/src/imfs/imfs_link.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_mknod.c2
-rw-r--r--cpukit/libfs/src/imfs/imfs_symlink.c2
31 files changed, 131 insertions, 95 deletions
diff --git a/c/src/exec/libcsupport/src/mount.c b/c/src/exec/libcsupport/src/mount.c
index 9b42c78118..d7d12f442e 100644
--- a/c/src/exec/libcsupport/src/mount.c
+++ b/c/src/exec/libcsupport/src/mount.c
@@ -32,12 +32,16 @@
Chain_Control rtems_filesystem_mount_table_control;
+#include "imfs.h"
+
+/* XXX this structure should be in an IMFS specific file */
+/* XXX this structure should use real constants */
rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS = {
5, /* link_max */
6, /* max_canon */
7, /* max_input */
- 255, /* name_max */
+ IMFS_NAME_MAX, /* name_max */
255, /* path_max */
2, /* pipe_buf */
1, /* posix_async_io */
diff --git a/c/src/exec/libfs/src/imfs/imfs.h b/c/src/exec/libfs/src/imfs/imfs.h
index e67964971e..0421e9e25c 100644
--- a/c/src/exec/libfs/src/imfs/imfs.h
+++ b/c/src/exec/libfs/src/imfs/imfs.h
@@ -126,25 +126,31 @@ typedef union {
} IMFS_types_union;
/*
+ * Maximum length of a "basename" of an IMFS file/node.
+ */
+
+#define IMFS_NAME_MAX 32
+
+/*
* The control structure for an IMFS jnode.
*/
struct IMFS_jnode_tt {
- Chain_Node Node; /* for chaining them together */
- IMFS_jnode_t *Parent; /* Parent node */
- char name[NAME_MAX+1]; /* "basename" */
- mode_t st_mode; /* File mode */
- nlink_t st_nlink; /* Link count */
- ino_t st_ino; /* inode */
-
- uid_t st_uid; /* User ID of owner */
- gid_t st_gid; /* Group ID of owner */
-
- time_t st_atime; /* Time of last access */
- time_t st_mtime; /* Time of last modification */
- time_t st_ctime; /* Time of last status change */
- IMFS_jnode_types_t type; /* Type of this entry */
- IMFS_types_union info;
+ Chain_Node Node; /* for chaining them together */
+ IMFS_jnode_t *Parent; /* Parent node */
+ char name[IMFS_NAME_MAX+1]; /* "basename" */
+ mode_t st_mode; /* File mode */
+ nlink_t st_nlink; /* Link count */
+ ino_t st_ino; /* inode */
+
+ uid_t st_uid; /* User ID of owner */
+ gid_t st_gid; /* Group ID of owner */
+
+ time_t st_atime; /* Time of last access */
+ time_t st_mtime; /* Time of last modification */
+ time_t st_ctime; /* Time of last status change */
+ IMFS_jnode_types_t type; /* Type of this entry */
+ IMFS_types_union info;
};
#define IMFS_update_atime( _jnode ) \
diff --git a/c/src/exec/libfs/src/imfs/imfs_creat.c b/c/src/exec/libfs/src/imfs/imfs_creat.c
index fd38e7f993..6b638ed07c 100644
--- a/c/src/exec/libfs/src/imfs/imfs_creat.c
+++ b/c/src/exec/libfs/src/imfs/imfs_creat.c
@@ -51,7 +51,7 @@ IMFS_jnode_t *IMFS_create_node(
node->st_nlink = 1;
node->type = type;
- strncpy( node->name, name, NAME_MAX );
+ strncpy( node->name, name, IMFS_NAME_MAX );
/*
* Fill in the mode and permission information for the jnode structure.
diff --git a/c/src/exec/libfs/src/imfs/imfs_eval.c b/c/src/exec/libfs/src/imfs/imfs_eval.c
index d6d444f6d2..e7e2d47908 100644
--- a/c/src/exec/libfs/src/imfs/imfs_eval.c
+++ b/c/src/exec/libfs/src/imfs/imfs_eval.c
@@ -277,7 +277,7 @@ int IMFS_evaluate_for_make(
int i = 0;
int len;
IMFS_token_types type;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int done = 0;
@@ -467,7 +467,7 @@ int IMFS_eval_path(
int i = 0;
int len;
IMFS_token_types type = IMFS_CURRENT_DIR;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int result;
diff --git a/c/src/exec/libfs/src/imfs/imfs_gtkn.c b/c/src/exec/libfs/src/imfs/imfs_gtkn.c
index 052c67ceba..aa63841725 100644
--- a/c/src/exec/libfs/src/imfs/imfs_gtkn.c
+++ b/c/src/exec/libfs/src/imfs/imfs_gtkn.c
@@ -32,11 +32,11 @@ IMFS_token_types IMFS_get_token(
* Copy a name into token. (Remember NULL is a token.)
*/
- while ( !IMFS_is_separator( path[i] ) && (i <= NAME_MAX) ) {
+ while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
token[i] = path[i];
- if (i == NAME_MAX)
+ if (i == IMFS_NAME_MAX)
return IMFS_INVALID_TOKEN;
if ( !IMFS_is_valid_name_char( token[i] ) )
diff --git a/c/src/exec/libfs/src/imfs/imfs_link.c b/c/src/exec/libfs/src/imfs/imfs_link.c
index 2232209705..34d277646d 100644
--- a/c/src/exec/libfs/src/imfs/imfs_link.c
+++ b/c/src/exec/libfs/src/imfs/imfs_link.c
@@ -28,7 +28,7 @@ int IMFS_link(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*
diff --git a/c/src/exec/libfs/src/imfs/imfs_mknod.c b/c/src/exec/libfs/src/imfs/imfs_mknod.c
index d4feef4f36..c8c05b3a26 100644
--- a/c/src/exec/libfs/src/imfs/imfs_mknod.c
+++ b/c/src/exec/libfs/src/imfs/imfs_mknod.c
@@ -35,7 +35,7 @@ int IMFS_mknod(
IMFS_token_types type = 0;
IMFS_jnode_t *new_node;
int result;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
IMFS_types_union info;
IMFS_get_token( token, new_name, &result );
diff --git a/c/src/exec/libfs/src/imfs/imfs_symlink.c b/c/src/exec/libfs/src/imfs/imfs_symlink.c
index 0d3ebbd670..36b24fef88 100644
--- a/c/src/exec/libfs/src/imfs/imfs_symlink.c
+++ b/c/src/exec/libfs/src/imfs/imfs_symlink.c
@@ -28,7 +28,7 @@ int IMFS_symlink(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*
diff --git a/c/src/lib/libc/imfs.h b/c/src/lib/libc/imfs.h
index e67964971e..0421e9e25c 100644
--- a/c/src/lib/libc/imfs.h
+++ b/c/src/lib/libc/imfs.h
@@ -126,25 +126,31 @@ typedef union {
} IMFS_types_union;
/*
+ * Maximum length of a "basename" of an IMFS file/node.
+ */
+
+#define IMFS_NAME_MAX 32
+
+/*
* The control structure for an IMFS jnode.
*/
struct IMFS_jnode_tt {
- Chain_Node Node; /* for chaining them together */
- IMFS_jnode_t *Parent; /* Parent node */
- char name[NAME_MAX+1]; /* "basename" */
- mode_t st_mode; /* File mode */
- nlink_t st_nlink; /* Link count */
- ino_t st_ino; /* inode */
-
- uid_t st_uid; /* User ID of owner */
- gid_t st_gid; /* Group ID of owner */
-
- time_t st_atime; /* Time of last access */
- time_t st_mtime; /* Time of last modification */
- time_t st_ctime; /* Time of last status change */
- IMFS_jnode_types_t type; /* Type of this entry */
- IMFS_types_union info;
+ Chain_Node Node; /* for chaining them together */
+ IMFS_jnode_t *Parent; /* Parent node */
+ char name[IMFS_NAME_MAX+1]; /* "basename" */
+ mode_t st_mode; /* File mode */
+ nlink_t st_nlink; /* Link count */
+ ino_t st_ino; /* inode */
+
+ uid_t st_uid; /* User ID of owner */
+ gid_t st_gid; /* Group ID of owner */
+
+ time_t st_atime; /* Time of last access */
+ time_t st_mtime; /* Time of last modification */
+ time_t st_ctime; /* Time of last status change */
+ IMFS_jnode_types_t type; /* Type of this entry */
+ IMFS_types_union info;
};
#define IMFS_update_atime( _jnode ) \
diff --git a/c/src/lib/libc/imfs_creat.c b/c/src/lib/libc/imfs_creat.c
index fd38e7f993..6b638ed07c 100644
--- a/c/src/lib/libc/imfs_creat.c
+++ b/c/src/lib/libc/imfs_creat.c
@@ -51,7 +51,7 @@ IMFS_jnode_t *IMFS_create_node(
node->st_nlink = 1;
node->type = type;
- strncpy( node->name, name, NAME_MAX );
+ strncpy( node->name, name, IMFS_NAME_MAX );
/*
* Fill in the mode and permission information for the jnode structure.
diff --git a/c/src/lib/libc/imfs_eval.c b/c/src/lib/libc/imfs_eval.c
index d6d444f6d2..e7e2d47908 100644
--- a/c/src/lib/libc/imfs_eval.c
+++ b/c/src/lib/libc/imfs_eval.c
@@ -277,7 +277,7 @@ int IMFS_evaluate_for_make(
int i = 0;
int len;
IMFS_token_types type;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int done = 0;
@@ -467,7 +467,7 @@ int IMFS_eval_path(
int i = 0;
int len;
IMFS_token_types type = IMFS_CURRENT_DIR;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int result;
diff --git a/c/src/lib/libc/imfs_gtkn.c b/c/src/lib/libc/imfs_gtkn.c
index 052c67ceba..aa63841725 100644
--- a/c/src/lib/libc/imfs_gtkn.c
+++ b/c/src/lib/libc/imfs_gtkn.c
@@ -32,11 +32,11 @@ IMFS_token_types IMFS_get_token(
* Copy a name into token. (Remember NULL is a token.)
*/
- while ( !IMFS_is_separator( path[i] ) && (i <= NAME_MAX) ) {
+ while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
token[i] = path[i];
- if (i == NAME_MAX)
+ if (i == IMFS_NAME_MAX)
return IMFS_INVALID_TOKEN;
if ( !IMFS_is_valid_name_char( token[i] ) )
diff --git a/c/src/lib/libc/imfs_link.c b/c/src/lib/libc/imfs_link.c
index 2232209705..34d277646d 100644
--- a/c/src/lib/libc/imfs_link.c
+++ b/c/src/lib/libc/imfs_link.c
@@ -28,7 +28,7 @@ int IMFS_link(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*
diff --git a/c/src/lib/libc/imfs_mknod.c b/c/src/lib/libc/imfs_mknod.c
index d4feef4f36..c8c05b3a26 100644
--- a/c/src/lib/libc/imfs_mknod.c
+++ b/c/src/lib/libc/imfs_mknod.c
@@ -35,7 +35,7 @@ int IMFS_mknod(
IMFS_token_types type = 0;
IMFS_jnode_t *new_node;
int result;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
IMFS_types_union info;
IMFS_get_token( token, new_name, &result );
diff --git a/c/src/lib/libc/imfs_symlink.c b/c/src/lib/libc/imfs_symlink.c
index 0d3ebbd670..36b24fef88 100644
--- a/c/src/lib/libc/imfs_symlink.c
+++ b/c/src/lib/libc/imfs_symlink.c
@@ -28,7 +28,7 @@ int IMFS_symlink(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*
diff --git a/c/src/lib/libc/mount.c b/c/src/lib/libc/mount.c
index 9b42c78118..d7d12f442e 100644
--- a/c/src/lib/libc/mount.c
+++ b/c/src/lib/libc/mount.c
@@ -32,12 +32,16 @@
Chain_Control rtems_filesystem_mount_table_control;
+#include "imfs.h"
+
+/* XXX this structure should be in an IMFS specific file */
+/* XXX this structure should use real constants */
rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS = {
5, /* link_max */
6, /* max_canon */
7, /* max_input */
- 255, /* name_max */
+ IMFS_NAME_MAX, /* name_max */
255, /* path_max */
2, /* pipe_buf */
1, /* posix_async_io */
diff --git a/c/src/libfs/src/imfs/imfs.h b/c/src/libfs/src/imfs/imfs.h
index e67964971e..0421e9e25c 100644
--- a/c/src/libfs/src/imfs/imfs.h
+++ b/c/src/libfs/src/imfs/imfs.h
@@ -126,25 +126,31 @@ typedef union {
} IMFS_types_union;
/*
+ * Maximum length of a "basename" of an IMFS file/node.
+ */
+
+#define IMFS_NAME_MAX 32
+
+/*
* The control structure for an IMFS jnode.
*/
struct IMFS_jnode_tt {
- Chain_Node Node; /* for chaining them together */
- IMFS_jnode_t *Parent; /* Parent node */
- char name[NAME_MAX+1]; /* "basename" */
- mode_t st_mode; /* File mode */
- nlink_t st_nlink; /* Link count */
- ino_t st_ino; /* inode */
-
- uid_t st_uid; /* User ID of owner */
- gid_t st_gid; /* Group ID of owner */
-
- time_t st_atime; /* Time of last access */
- time_t st_mtime; /* Time of last modification */
- time_t st_ctime; /* Time of last status change */
- IMFS_jnode_types_t type; /* Type of this entry */
- IMFS_types_union info;
+ Chain_Node Node; /* for chaining them together */
+ IMFS_jnode_t *Parent; /* Parent node */
+ char name[IMFS_NAME_MAX+1]; /* "basename" */
+ mode_t st_mode; /* File mode */
+ nlink_t st_nlink; /* Link count */
+ ino_t st_ino; /* inode */
+
+ uid_t st_uid; /* User ID of owner */
+ gid_t st_gid; /* Group ID of owner */
+
+ time_t st_atime; /* Time of last access */
+ time_t st_mtime; /* Time of last modification */
+ time_t st_ctime; /* Time of last status change */
+ IMFS_jnode_types_t type; /* Type of this entry */
+ IMFS_types_union info;
};
#define IMFS_update_atime( _jnode ) \
diff --git a/c/src/libfs/src/imfs/imfs_creat.c b/c/src/libfs/src/imfs/imfs_creat.c
index fd38e7f993..6b638ed07c 100644
--- a/c/src/libfs/src/imfs/imfs_creat.c
+++ b/c/src/libfs/src/imfs/imfs_creat.c
@@ -51,7 +51,7 @@ IMFS_jnode_t *IMFS_create_node(
node->st_nlink = 1;
node->type = type;
- strncpy( node->name, name, NAME_MAX );
+ strncpy( node->name, name, IMFS_NAME_MAX );
/*
* Fill in the mode and permission information for the jnode structure.
diff --git a/c/src/libfs/src/imfs/imfs_eval.c b/c/src/libfs/src/imfs/imfs_eval.c
index d6d444f6d2..e7e2d47908 100644
--- a/c/src/libfs/src/imfs/imfs_eval.c
+++ b/c/src/libfs/src/imfs/imfs_eval.c
@@ -277,7 +277,7 @@ int IMFS_evaluate_for_make(
int i = 0;
int len;
IMFS_token_types type;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int done = 0;
@@ -467,7 +467,7 @@ int IMFS_eval_path(
int i = 0;
int len;
IMFS_token_types type = IMFS_CURRENT_DIR;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int result;
diff --git a/c/src/libfs/src/imfs/imfs_gtkn.c b/c/src/libfs/src/imfs/imfs_gtkn.c
index 052c67ceba..aa63841725 100644
--- a/c/src/libfs/src/imfs/imfs_gtkn.c
+++ b/c/src/libfs/src/imfs/imfs_gtkn.c
@@ -32,11 +32,11 @@ IMFS_token_types IMFS_get_token(
* Copy a name into token. (Remember NULL is a token.)
*/
- while ( !IMFS_is_separator( path[i] ) && (i <= NAME_MAX) ) {
+ while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
token[i] = path[i];
- if (i == NAME_MAX)
+ if (i == IMFS_NAME_MAX)
return IMFS_INVALID_TOKEN;
if ( !IMFS_is_valid_name_char( token[i] ) )
diff --git a/c/src/libfs/src/imfs/imfs_link.c b/c/src/libfs/src/imfs/imfs_link.c
index 2232209705..34d277646d 100644
--- a/c/src/libfs/src/imfs/imfs_link.c
+++ b/c/src/libfs/src/imfs/imfs_link.c
@@ -28,7 +28,7 @@ int IMFS_link(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*
diff --git a/c/src/libfs/src/imfs/imfs_mknod.c b/c/src/libfs/src/imfs/imfs_mknod.c
index d4feef4f36..c8c05b3a26 100644
--- a/c/src/libfs/src/imfs/imfs_mknod.c
+++ b/c/src/libfs/src/imfs/imfs_mknod.c
@@ -35,7 +35,7 @@ int IMFS_mknod(
IMFS_token_types type = 0;
IMFS_jnode_t *new_node;
int result;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
IMFS_types_union info;
IMFS_get_token( token, new_name, &result );
diff --git a/c/src/libfs/src/imfs/imfs_symlink.c b/c/src/libfs/src/imfs/imfs_symlink.c
index 0d3ebbd670..36b24fef88 100644
--- a/c/src/libfs/src/imfs/imfs_symlink.c
+++ b/c/src/libfs/src/imfs/imfs_symlink.c
@@ -28,7 +28,7 @@ int IMFS_symlink(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*
diff --git a/cpukit/libcsupport/src/mount.c b/cpukit/libcsupport/src/mount.c
index 9b42c78118..d7d12f442e 100644
--- a/cpukit/libcsupport/src/mount.c
+++ b/cpukit/libcsupport/src/mount.c
@@ -32,12 +32,16 @@
Chain_Control rtems_filesystem_mount_table_control;
+#include "imfs.h"
+
+/* XXX this structure should be in an IMFS specific file */
+/* XXX this structure should use real constants */
rtems_filesystem_limits_and_options_t IMFS_LIMITS_AND_OPTIONS = {
5, /* link_max */
6, /* max_canon */
7, /* max_input */
- 255, /* name_max */
+ IMFS_NAME_MAX, /* name_max */
255, /* path_max */
2, /* pipe_buf */
1, /* posix_async_io */
diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h
index e67964971e..0421e9e25c 100644
--- a/cpukit/libfs/src/imfs/imfs.h
+++ b/cpukit/libfs/src/imfs/imfs.h
@@ -126,25 +126,31 @@ typedef union {
} IMFS_types_union;
/*
+ * Maximum length of a "basename" of an IMFS file/node.
+ */
+
+#define IMFS_NAME_MAX 32
+
+/*
* The control structure for an IMFS jnode.
*/
struct IMFS_jnode_tt {
- Chain_Node Node; /* for chaining them together */
- IMFS_jnode_t *Parent; /* Parent node */
- char name[NAME_MAX+1]; /* "basename" */
- mode_t st_mode; /* File mode */
- nlink_t st_nlink; /* Link count */
- ino_t st_ino; /* inode */
-
- uid_t st_uid; /* User ID of owner */
- gid_t st_gid; /* Group ID of owner */
-
- time_t st_atime; /* Time of last access */
- time_t st_mtime; /* Time of last modification */
- time_t st_ctime; /* Time of last status change */
- IMFS_jnode_types_t type; /* Type of this entry */
- IMFS_types_union info;
+ Chain_Node Node; /* for chaining them together */
+ IMFS_jnode_t *Parent; /* Parent node */
+ char name[IMFS_NAME_MAX+1]; /* "basename" */
+ mode_t st_mode; /* File mode */
+ nlink_t st_nlink; /* Link count */
+ ino_t st_ino; /* inode */
+
+ uid_t st_uid; /* User ID of owner */
+ gid_t st_gid; /* Group ID of owner */
+
+ time_t st_atime; /* Time of last access */
+ time_t st_mtime; /* Time of last modification */
+ time_t st_ctime; /* Time of last status change */
+ IMFS_jnode_types_t type; /* Type of this entry */
+ IMFS_types_union info;
};
#define IMFS_update_atime( _jnode ) \
diff --git a/cpukit/libfs/src/imfs/imfs_creat.c b/cpukit/libfs/src/imfs/imfs_creat.c
index fd38e7f993..6b638ed07c 100644
--- a/cpukit/libfs/src/imfs/imfs_creat.c
+++ b/cpukit/libfs/src/imfs/imfs_creat.c
@@ -51,7 +51,7 @@ IMFS_jnode_t *IMFS_create_node(
node->st_nlink = 1;
node->type = type;
- strncpy( node->name, name, NAME_MAX );
+ strncpy( node->name, name, IMFS_NAME_MAX );
/*
* Fill in the mode and permission information for the jnode structure.
diff --git a/cpukit/libfs/src/imfs/imfs_eval.c b/cpukit/libfs/src/imfs/imfs_eval.c
index d6d444f6d2..e7e2d47908 100644
--- a/cpukit/libfs/src/imfs/imfs_eval.c
+++ b/cpukit/libfs/src/imfs/imfs_eval.c
@@ -277,7 +277,7 @@ int IMFS_evaluate_for_make(
int i = 0;
int len;
IMFS_token_types type;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int done = 0;
@@ -467,7 +467,7 @@ int IMFS_eval_path(
int i = 0;
int len;
IMFS_token_types type = IMFS_CURRENT_DIR;
- char token[ NAME_MAX + 1 ];
+ char token[ IMFS_NAME_MAX + 1 ];
rtems_filesystem_location_info_t newloc;
IMFS_jnode_t *node;
int result;
diff --git a/cpukit/libfs/src/imfs/imfs_gtkn.c b/cpukit/libfs/src/imfs/imfs_gtkn.c
index 052c67ceba..aa63841725 100644
--- a/cpukit/libfs/src/imfs/imfs_gtkn.c
+++ b/cpukit/libfs/src/imfs/imfs_gtkn.c
@@ -32,11 +32,11 @@ IMFS_token_types IMFS_get_token(
* Copy a name into token. (Remember NULL is a token.)
*/
- while ( !IMFS_is_separator( path[i] ) && (i <= NAME_MAX) ) {
+ while ( !IMFS_is_separator( path[i] ) && (i <= IMFS_NAME_MAX) ) {
token[i] = path[i];
- if (i == NAME_MAX)
+ if (i == IMFS_NAME_MAX)
return IMFS_INVALID_TOKEN;
if ( !IMFS_is_valid_name_char( token[i] ) )
diff --git a/cpukit/libfs/src/imfs/imfs_link.c b/cpukit/libfs/src/imfs/imfs_link.c
index 2232209705..34d277646d 100644
--- a/cpukit/libfs/src/imfs/imfs_link.c
+++ b/cpukit/libfs/src/imfs/imfs_link.c
@@ -28,7 +28,7 @@ int IMFS_link(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*
diff --git a/cpukit/libfs/src/imfs/imfs_mknod.c b/cpukit/libfs/src/imfs/imfs_mknod.c
index d4feef4f36..c8c05b3a26 100644
--- a/cpukit/libfs/src/imfs/imfs_mknod.c
+++ b/cpukit/libfs/src/imfs/imfs_mknod.c
@@ -35,7 +35,7 @@ int IMFS_mknod(
IMFS_token_types type = 0;
IMFS_jnode_t *new_node;
int result;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
IMFS_types_union info;
IMFS_get_token( token, new_name, &result );
diff --git a/cpukit/libfs/src/imfs/imfs_symlink.c b/cpukit/libfs/src/imfs/imfs_symlink.c
index 0d3ebbd670..36b24fef88 100644
--- a/cpukit/libfs/src/imfs/imfs_symlink.c
+++ b/cpukit/libfs/src/imfs/imfs_symlink.c
@@ -28,7 +28,7 @@ int IMFS_symlink(
{
IMFS_types_union info;
IMFS_jnode_t *new_node;
- char new_name[ NAME_MAX + 1 ];
+ char new_name[ IMFS_NAME_MAX + 1 ];
int i;
/*