Patch from Chris Johns <cjohns@cybertec.com.au> to add support for

stat()'ing a symbolic link.  This is needed to support the port
of the BSD commands like ls to RTEMS.
This commit is contained in:
Joel Sherrill
2000-06-30 12:33:13 +00:00
parent 195ae7bada
commit e5d6705e46
8 changed files with 68 additions and 52 deletions

View File

@@ -26,7 +26,7 @@ rtems_filesystem_file_handlers_r IMFS_link_handlers = {
NULL, /* write */ NULL, /* write */
NULL, /* ioctl */ NULL, /* ioctl */
NULL, /* lseek */ NULL, /* lseek */
NULL, /* stat */ IMFS_stat, /* stat */
NULL, /* fchmod */ NULL, /* fchmod */
NULL, /* ftruncate */ NULL, /* ftruncate */
NULL, /* fpathconf */ NULL, /* fpathconf */

View File

@@ -39,6 +39,10 @@ int IMFS_stat(
buf->st_size = the_jnode->info.file.size; buf->st_size = the_jnode->info.file.size;
break; break;
case IMFS_SYM_LINK:
buf->st_size = 0;
break;
default: default:
set_errno_and_return_minus_one( ENOTSUP ); set_errno_and_return_minus_one( ENOTSUP );
break; break;

View File

@@ -26,7 +26,7 @@ rtems_filesystem_file_handlers_r IMFS_link_handlers = {
NULL, /* write */ NULL, /* write */
NULL, /* ioctl */ NULL, /* ioctl */
NULL, /* lseek */ NULL, /* lseek */
NULL, /* stat */ IMFS_stat, /* stat */
NULL, /* fchmod */ NULL, /* fchmod */
NULL, /* ftruncate */ NULL, /* ftruncate */
NULL, /* fpathconf */ NULL, /* fpathconf */

View File

@@ -39,6 +39,10 @@ int IMFS_stat(
buf->st_size = the_jnode->info.file.size; buf->st_size = the_jnode->info.file.size;
break; break;
case IMFS_SYM_LINK:
buf->st_size = 0;
break;
default: default:
set_errno_and_return_minus_one( ENOTSUP ); set_errno_and_return_minus_one( ENOTSUP );
break; break;

View File

@@ -26,7 +26,7 @@ rtems_filesystem_file_handlers_r IMFS_link_handlers = {
NULL, /* write */ NULL, /* write */
NULL, /* ioctl */ NULL, /* ioctl */
NULL, /* lseek */ NULL, /* lseek */
NULL, /* stat */ IMFS_stat, /* stat */
NULL, /* fchmod */ NULL, /* fchmod */
NULL, /* ftruncate */ NULL, /* ftruncate */
NULL, /* fpathconf */ NULL, /* fpathconf */

View File

@@ -39,6 +39,10 @@ int IMFS_stat(
buf->st_size = the_jnode->info.file.size; buf->st_size = the_jnode->info.file.size;
break; break;
case IMFS_SYM_LINK:
buf->st_size = 0;
break;
default: default:
set_errno_and_return_minus_one( ENOTSUP ); set_errno_and_return_minus_one( ENOTSUP );
break; break;

View File

@@ -26,7 +26,7 @@ rtems_filesystem_file_handlers_r IMFS_link_handlers = {
NULL, /* write */ NULL, /* write */
NULL, /* ioctl */ NULL, /* ioctl */
NULL, /* lseek */ NULL, /* lseek */
NULL, /* stat */ IMFS_stat, /* stat */
NULL, /* fchmod */ NULL, /* fchmod */
NULL, /* ftruncate */ NULL, /* ftruncate */
NULL, /* fpathconf */ NULL, /* fpathconf */

View File

@@ -39,6 +39,10 @@ int IMFS_stat(
buf->st_size = the_jnode->info.file.size; buf->st_size = the_jnode->info.file.size;
break; break;
case IMFS_SYM_LINK:
buf->st_size = 0;
break;
default: default:
set_errno_and_return_minus_one( ENOTSUP ); set_errno_and_return_minus_one( ENOTSUP );
break; break;