Changeset 7c1a82f in rtems
- Timestamp:
- 05/23/00 15:41:04 (23 years ago)
- Children:
- 625f1a6
- Parents:
- 1b69693
- Location:
- c/src/lib/libc
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libc/imfs.h
r1b69693 r7c1a82f 151 151 IMFS_jnode_t *Parent; /* Parent node */ 152 152 char name[IMFS_NAME_MAX+1]; /* "basename" */ 153 mode_t st at_mode;/* File mode */154 nlink_t st at_nlink;/* Link count */155 ino_t st at_ino;/* inode */156 157 uid_t st at_uid;/* User ID of owner */158 gid_t st at_gid;/* Group ID of owner */159 160 time_t st at_atime;/* Time of last access */161 time_t st at_mtime;/* Time of last modification */162 time_t st at_ctime;/* Time of last status change */153 mode_t st_mode; /* File mode */ 154 nlink_t st_nlink; /* Link count */ 155 ino_t st_ino; /* inode */ 156 157 uid_t st_uid; /* User ID of owner */ 158 gid_t st_gid; /* Group ID of owner */ 159 160 time_t st_atime; /* Time of last access */ 161 time_t st_mtime; /* Time of last modification */ 162 time_t st_ctime; /* Time of last status change */ 163 163 IMFS_jnode_types_t type; /* Type of this entry */ 164 164 IMFS_types_union info; … … 169 169 struct timeval tv; \ 170 170 gettimeofday( &tv, 0 ); \ 171 _jnode->st at_atime = (time_t) tv.tv_sec; \171 _jnode->st_atime = (time_t) tv.tv_sec; \ 172 172 } while (0) 173 173 … … 176 176 struct timeval tv; \ 177 177 gettimeofday( &tv, 0 ); \ 178 _jnode->st at_mtime = (time_t) tv.tv_sec; \178 _jnode->st_mtime = (time_t) tv.tv_sec; \ 179 179 } while (0) 180 180 … … 183 183 struct timeval tv; \ 184 184 gettimeofday( &tv, 0 ); \ 185 _jnode->st at_ctime = (time_t) tv.tv_sec; \185 _jnode->st_ctime = (time_t) tv.tv_sec; \ 186 186 } while (0) 187 187 … … 190 190 struct timeval tv; \ 191 191 gettimeofday( &tv, 0 ); \ 192 _jnode->st at_mtime = (time_t) tv.tv_sec; \193 _jnode->st at_atime = (time_t) tv.tv_sec; \192 _jnode->st_mtime = (time_t) tv.tv_sec; \ 193 _jnode->st_atime = (time_t) tv.tv_sec; \ 194 194 } while (0) 195 195 -
c/src/lib/libc/imfs_chown.c
r1b69693 r7c1a82f 39 39 st_uid = geteuid(); 40 40 41 if ( ( st_uid != jnode->st at_uid ) && ( st_uid != 0 ) )41 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 42 42 set_errno_and_return_minus_one( EPERM ); 43 43 #endif 44 44 45 jnode->st at_uid = owner;46 jnode->st at_gid = group;45 jnode->st_uid = owner; 46 jnode->st_gid = group; 47 47 48 48 IMFS_update_ctime( jnode ); -
c/src/lib/libc/imfs_creat.c
r1b69693 r7c1a82f 49 49 */ 50 50 51 node->st at_nlink = 1;51 node->st_nlink = 1; 52 52 node->type = type; 53 53 strncpy( node->name, name, IMFS_NAME_MAX ); … … 57 57 */ 58 58 59 node->st at_mode = mode & ~rtems_filesystem_umask;59 node->st_mode = mode & ~rtems_filesystem_umask; 60 60 61 61 #if defined(RTEMS_POSIX_API) 62 node->st at_uid = geteuid();63 node->st at_gid = getegid();62 node->st_uid = geteuid(); 63 node->st_gid = getegid(); 64 64 #else 65 node->st at_uid = 0;66 node->st at_gid = 0;65 node->st_uid = 0; 66 node->st_gid = 0; 67 67 #endif 68 68 … … 73 73 gettimeofday( &tv, 0 ); 74 74 75 node->st at_atime = (time_t) tv.tv_sec;76 node->st at_mtime = (time_t) tv.tv_sec;77 node->st at_ctime = (time_t) tv.tv_sec;75 node->st_atime = (time_t) tv.tv_sec; 76 node->st_mtime = (time_t) tv.tv_sec; 77 node->st_ctime = (time_t) tv.tv_sec; 78 78 79 79 /* … … 122 122 123 123 fs_info = parent_loc->mt_entry->fs_info; 124 node->st at_ino = ++fs_info->ino_count;124 node->st_ino = ++fs_info->ino_count; 125 125 } 126 126 -
c/src/lib/libc/imfs_directory.c
r1b69693 r7c1a82f 241 241 242 242 buf->st_dev = 0ll; 243 buf->st_ino = the_jnode->st at_ino;244 buf->st_mode = the_jnode->st at_mode;245 buf->st_nlink = the_jnode->st at_nlink;246 buf->st_uid = the_jnode->st at_uid;247 buf->st_gid = the_jnode->st at_gid;243 buf->st_ino = the_jnode->st_ino; 244 buf->st_mode = the_jnode->st_mode; 245 buf->st_nlink = the_jnode->st_nlink; 246 buf->st_uid = the_jnode->st_uid; 247 buf->st_gid = the_jnode->st_gid; 248 248 buf->st_rdev = 0ll; 249 249 buf->st_blksize = 0; 250 250 buf->st_blocks = 0; 251 buf->st_atime = the_jnode->st at_atime;252 buf->st_mtime = the_jnode->st at_mtime;253 buf->st_ctime = the_jnode->st at_ctime;251 buf->st_atime = the_jnode->st_atime; 252 buf->st_mtime = the_jnode->st_mtime; 253 buf->st_ctime = the_jnode->st_ctime; 254 254 255 255 buf->st_size = 0; … … 318 318 */ 319 319 320 the_jnode->st at_nlink--;320 the_jnode->st_nlink--; 321 321 IMFS_update_ctime( the_jnode ); 322 322 … … 325 325 */ 326 326 327 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st at_nlink < 1) ) {327 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) { 328 328 329 329 /* -
c/src/lib/libc/imfs_eval.c
r1b69693 r7c1a82f 83 83 st_gid = getegid(); 84 84 #else 85 st_uid = jnode->st at_uid;86 st_gid = jnode->st at_gid;85 st_uid = jnode->st_uid; 86 st_gid = jnode->st_gid; 87 87 #endif 88 88 … … 93 93 flags_to_test = flags; 94 94 95 if ( st_uid == jnode->st at_uid )95 if ( st_uid == jnode->st_uid ) 96 96 flags_to_test <<= 6; 97 else if ( st_gid == jnode->st at_gid )97 else if ( st_gid == jnode->st_gid ) 98 98 flags_to_test <<= 3; 99 99 else … … 104 104 * to do this. 105 105 */ 106 if ( ( flags_to_test & jnode->st at_mode) == flags_to_test )106 if ( ( flags_to_test & jnode->st_mode) == flags_to_test ) 107 107 return 1; 108 108 -
c/src/lib/libc/imfs_fchmod.c
r1b69693 r7c1a82f 35 35 st_uid = geteuid(); 36 36 37 if ( ( st_uid != jnode->st at_uid ) && ( st_uid != 0 ) )37 if ( ( st_uid != jnode->st_uid ) && ( st_uid != 0 ) ) 38 38 set_errno_and_return_minus_one( EPERM ); 39 39 #endif … … 45 45 set_errno_and_return_minus_one( EPERM ); 46 46 47 jnode->st at_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO);48 jnode->st at_mode |= mode;47 jnode->st_mode &= ~(S_IRWXU | S_IRWXG | S_IRWXO); 48 jnode->st_mode |= mode; 49 49 50 50 IMFS_update_ctime( jnode ); -
c/src/lib/libc/imfs_initsupp.c
r1b69693 r7c1a82f 75 75 76 76 jnode = temp_mt_entry->mt_fs_root.node_access; 77 jnode->st at_ino = fs_info->ino_count;77 jnode->st_ino = fs_info->ino_count; 78 78 79 79 return 0; -
c/src/lib/libc/imfs_link.c
r1b69693 r7c1a82f 36 36 37 37 info.hard_link.link_node = to_loc->node_access; 38 if ( info.hard_link.link_node->st at_nlink >= LINK_MAX )38 if ( info.hard_link.link_node->st_nlink >= LINK_MAX ) 39 39 set_errno_and_return_minus_one( EMLINK ); 40 40 … … 64 64 */ 65 65 66 info.hard_link.link_node->st at_nlink++;66 info.hard_link.link_node->st_nlink++; 67 67 IMFS_update_ctime( info.hard_link.link_node ); 68 68 -
c/src/lib/libc/imfs_rmnod.c
r1b69693 r7c1a82f 46 46 */ 47 47 48 the_jnode->st at_nlink--;48 the_jnode->st_nlink--; 49 49 IMFS_update_ctime( the_jnode ); 50 50 … … 53 53 */ 54 54 55 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st at_nlink < 1) ) {55 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) { 56 56 57 57 /* -
c/src/lib/libc/imfs_stat.c
r1b69693 r7c1a82f 45 45 } 46 46 47 buf->st_mode = the_jnode->st at_mode;48 buf->st_nlink = the_jnode->st at_nlink;49 buf->st_ino = the_jnode->st at_ino;50 buf->st_uid = the_jnode->st at_uid;51 buf->st_gid = the_jnode->st at_gid;47 buf->st_mode = the_jnode->st_mode; 48 buf->st_nlink = the_jnode->st_nlink; 49 buf->st_ino = the_jnode->st_ino; 50 buf->st_uid = the_jnode->st_uid; 51 buf->st_gid = the_jnode->st_gid; 52 52 53 buf->st_atime = the_jnode->st at_atime;54 buf->st_mtime = the_jnode->st at_mtime;55 buf->st_ctime = the_jnode->st at_ctime;53 buf->st_atime = the_jnode->st_atime; 54 buf->st_mtime = the_jnode->st_mtime; 55 buf->st_ctime = the_jnode->st_ctime; 56 56 57 57 return 0; -
c/src/lib/libc/imfs_unlink.c
r1b69693 r7c1a82f 54 54 */ 55 55 56 node->info.hard_link.link_node->st at_nlink --;56 node->info.hard_link.link_node->st_nlink --; 57 57 IMFS_update_ctime( node->info.hard_link.link_node ); 58 if ( node->info.hard_link.link_node->st at_nlink < 1) {58 if ( node->info.hard_link.link_node->st_nlink < 1) { 59 59 result = (*the_link.handlers->rmnod)( &the_link ); 60 60 if ( result != 0 ) -
c/src/lib/libc/imfs_utime.c
r1b69693 r7c1a82f 31 31 the_jnode = (IMFS_jnode_t *) pathloc->node_access; 32 32 33 the_jnode->st at_atime = actime;34 the_jnode->st at_mtime = modtime;33 the_jnode->st_atime = actime; 34 the_jnode->st_mtime = modtime; 35 35 36 36 return 0; -
c/src/lib/libc/memfile.c
r1b69693 r7c1a82f 1065 1065 */ 1066 1066 1067 the_jnode->st at_nlink--;1067 the_jnode->st_nlink--; 1068 1068 IMFS_update_ctime( the_jnode ); 1069 1069 … … 1072 1072 */ 1073 1073 1074 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st at_nlink < 1) ) {1074 if ( !rtems_libio_is_file_open( the_jnode ) && (the_jnode->st_nlink < 1) ) { 1075 1075 1076 1076 /*
Note: See TracChangeset
for help on using the changeset viewer.