forked from Imagelibrary/rtems
2000-08-25 Joel Sherrill <joel.sherrill@OARcorp.com>
* libc/isatty.c, libc/imfs_handlers_directory.c, libc/creat.c, libc/imfs_directory.c: Fixed style issues.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* creat() "system call" */
|
||||
|
||||
/* This is needed by f2c and therefore the SPEC benchmarks. */
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
/* isatty.c */
|
||||
|
||||
/* Dumb implementation so programs will at least run. */
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
isatty (int fd)
|
||||
int isatty(
|
||||
int fd
|
||||
)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (fstat (fd, &buf) < 0)
|
||||
return 0;
|
||||
|
||||
if (S_ISCHR (buf.st_mode))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* XXX
|
||||
* IMFS Directory Access Routines
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
@@ -25,7 +25,9 @@
|
||||
#include "imfs.h"
|
||||
#include "libio_.h"
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_open
|
||||
*
|
||||
* This rountine will verify that the node being opened as a directory is
|
||||
* in fact a directory node. If it is then the offset into the directory
|
||||
* will be set to 0 to position to the first directory entry.
|
||||
@@ -50,9 +52,9 @@ int imfs_dir_open(
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_read
|
||||
*
|
||||
* This routine will read the next directory entry based on the directory
|
||||
* offset. The offset should be equal to -n- time the size of an individual
|
||||
* dirent structure. If n is not an integer multiple of the sizeof a
|
||||
@@ -100,7 +102,7 @@ int imfs_dir_read(
|
||||
last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
/* The directory was not empty so try to move to the desired entry in chain*/
|
||||
for(
|
||||
for (
|
||||
current_entry = 0;
|
||||
current_entry < last_entry;
|
||||
current_entry = current_entry + sizeof(struct dirent) ){
|
||||
@@ -138,7 +140,9 @@ int imfs_dir_read(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_close
|
||||
*
|
||||
* This routine will be called by the generic close routine to cleanup any
|
||||
* resources that have been allocated for the management of the file
|
||||
*/
|
||||
@@ -147,16 +151,20 @@ int imfs_dir_close(
|
||||
rtems_libio_t *iop
|
||||
)
|
||||
{
|
||||
/* The generic close routine handles the deallocation of the file control */
|
||||
/* and associated memory. At present the imfs_dir_close simply */
|
||||
/* returns a successful completion status */
|
||||
/*
|
||||
* The generic close routine handles the deallocation of the file control
|
||||
* and associated memory. At present the imfs_dir_close simply
|
||||
* returns a successful completion status.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_lseek
|
||||
*
|
||||
* This routine will behave in one of three ways based on the state of
|
||||
* argument whence. Based on the state of its value the offset argument will
|
||||
* be interpreted using one of the following methods:
|
||||
@@ -180,8 +188,7 @@ int imfs_dir_lseek(
|
||||
normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
|
||||
switch( whence )
|
||||
{
|
||||
switch( whence ) {
|
||||
case SEEK_SET: /* absolute move from the start of the file */
|
||||
iop->offset = normal_offset;
|
||||
break;
|
||||
@@ -203,7 +210,9 @@ int imfs_dir_lseek(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_fstat
|
||||
*
|
||||
* This routine will obtain the following information concerning the current
|
||||
* directory:
|
||||
* st_dev 0ll
|
||||
|
||||
@@ -36,10 +36,3 @@ rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
|
||||
imfs_dir_rmnod
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
|
||||
2000-08-25 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* libc/isatty.c, libc/imfs_handlers_directory.c, libc/creat.c,
|
||||
libc/imfs_directory.c: Fixed style issues.
|
||||
|
||||
2000-08-11 Chris Johns <ccj@acm.org>
|
||||
|
||||
* libc/chmod.c: Return ENOTSUP if filesystem does not have handler.
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* creat() "system call" */
|
||||
|
||||
/* This is needed by f2c and therefore the SPEC benchmarks. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* XXX
|
||||
* IMFS Directory Access Routines
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
@@ -25,7 +25,9 @@
|
||||
#include "imfs.h"
|
||||
#include "libio_.h"
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_open
|
||||
*
|
||||
* This rountine will verify that the node being opened as a directory is
|
||||
* in fact a directory node. If it is then the offset into the directory
|
||||
* will be set to 0 to position to the first directory entry.
|
||||
@@ -50,9 +52,9 @@ int imfs_dir_open(
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_read
|
||||
*
|
||||
* This routine will read the next directory entry based on the directory
|
||||
* offset. The offset should be equal to -n- time the size of an individual
|
||||
* dirent structure. If n is not an integer multiple of the sizeof a
|
||||
@@ -100,7 +102,7 @@ int imfs_dir_read(
|
||||
last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
/* The directory was not empty so try to move to the desired entry in chain*/
|
||||
for(
|
||||
for (
|
||||
current_entry = 0;
|
||||
current_entry < last_entry;
|
||||
current_entry = current_entry + sizeof(struct dirent) ){
|
||||
@@ -138,7 +140,9 @@ int imfs_dir_read(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_close
|
||||
*
|
||||
* This routine will be called by the generic close routine to cleanup any
|
||||
* resources that have been allocated for the management of the file
|
||||
*/
|
||||
@@ -147,16 +151,20 @@ int imfs_dir_close(
|
||||
rtems_libio_t *iop
|
||||
)
|
||||
{
|
||||
/* The generic close routine handles the deallocation of the file control */
|
||||
/* and associated memory. At present the imfs_dir_close simply */
|
||||
/* returns a successful completion status */
|
||||
/*
|
||||
* The generic close routine handles the deallocation of the file control
|
||||
* and associated memory. At present the imfs_dir_close simply
|
||||
* returns a successful completion status.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_lseek
|
||||
*
|
||||
* This routine will behave in one of three ways based on the state of
|
||||
* argument whence. Based on the state of its value the offset argument will
|
||||
* be interpreted using one of the following methods:
|
||||
@@ -180,8 +188,7 @@ int imfs_dir_lseek(
|
||||
normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
|
||||
switch( whence )
|
||||
{
|
||||
switch( whence ) {
|
||||
case SEEK_SET: /* absolute move from the start of the file */
|
||||
iop->offset = normal_offset;
|
||||
break;
|
||||
@@ -203,7 +210,9 @@ int imfs_dir_lseek(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_fstat
|
||||
*
|
||||
* This routine will obtain the following information concerning the current
|
||||
* directory:
|
||||
* st_dev 0ll
|
||||
|
||||
@@ -36,10 +36,3 @@ rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
|
||||
imfs_dir_rmnod
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
/* isatty.c */
|
||||
|
||||
/* Dumb implementation so programs will at least run. */
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
isatty (int fd)
|
||||
int isatty(
|
||||
int fd
|
||||
)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (fstat (fd, &buf) < 0)
|
||||
return 0;
|
||||
|
||||
if (S_ISCHR (buf.st_mode))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* XXX
|
||||
* IMFS Directory Access Routines
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
@@ -25,7 +25,9 @@
|
||||
#include "imfs.h"
|
||||
#include "libio_.h"
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_open
|
||||
*
|
||||
* This rountine will verify that the node being opened as a directory is
|
||||
* in fact a directory node. If it is then the offset into the directory
|
||||
* will be set to 0 to position to the first directory entry.
|
||||
@@ -50,9 +52,9 @@ int imfs_dir_open(
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_read
|
||||
*
|
||||
* This routine will read the next directory entry based on the directory
|
||||
* offset. The offset should be equal to -n- time the size of an individual
|
||||
* dirent structure. If n is not an integer multiple of the sizeof a
|
||||
@@ -100,7 +102,7 @@ int imfs_dir_read(
|
||||
last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
/* The directory was not empty so try to move to the desired entry in chain*/
|
||||
for(
|
||||
for (
|
||||
current_entry = 0;
|
||||
current_entry < last_entry;
|
||||
current_entry = current_entry + sizeof(struct dirent) ){
|
||||
@@ -138,7 +140,9 @@ int imfs_dir_read(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_close
|
||||
*
|
||||
* This routine will be called by the generic close routine to cleanup any
|
||||
* resources that have been allocated for the management of the file
|
||||
*/
|
||||
@@ -147,16 +151,20 @@ int imfs_dir_close(
|
||||
rtems_libio_t *iop
|
||||
)
|
||||
{
|
||||
/* The generic close routine handles the deallocation of the file control */
|
||||
/* and associated memory. At present the imfs_dir_close simply */
|
||||
/* returns a successful completion status */
|
||||
/*
|
||||
* The generic close routine handles the deallocation of the file control
|
||||
* and associated memory. At present the imfs_dir_close simply
|
||||
* returns a successful completion status.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_lseek
|
||||
*
|
||||
* This routine will behave in one of three ways based on the state of
|
||||
* argument whence. Based on the state of its value the offset argument will
|
||||
* be interpreted using one of the following methods:
|
||||
@@ -180,8 +188,7 @@ int imfs_dir_lseek(
|
||||
normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
|
||||
switch( whence )
|
||||
{
|
||||
switch( whence ) {
|
||||
case SEEK_SET: /* absolute move from the start of the file */
|
||||
iop->offset = normal_offset;
|
||||
break;
|
||||
@@ -203,7 +210,9 @@ int imfs_dir_lseek(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_fstat
|
||||
*
|
||||
* This routine will obtain the following information concerning the current
|
||||
* directory:
|
||||
* st_dev 0ll
|
||||
|
||||
@@ -36,10 +36,3 @@ rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
|
||||
imfs_dir_rmnod
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/* creat() "system call" */
|
||||
|
||||
/* This is needed by f2c and therefore the SPEC benchmarks. */
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
/* isatty.c */
|
||||
|
||||
/* Dumb implementation so programs will at least run. */
|
||||
/*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.OARcorp.com/rtems/license.html.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
int
|
||||
isatty (int fd)
|
||||
int isatty(
|
||||
int fd
|
||||
)
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (fstat (fd, &buf) < 0)
|
||||
return 0;
|
||||
|
||||
if (S_ISCHR (buf.st_mode))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* XXX
|
||||
* IMFS Directory Access Routines
|
||||
*
|
||||
* COPYRIGHT (c) 1989-1999.
|
||||
* On-Line Applications Research Corporation (OAR).
|
||||
@@ -25,7 +25,9 @@
|
||||
#include "imfs.h"
|
||||
#include "libio_.h"
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_open
|
||||
*
|
||||
* This rountine will verify that the node being opened as a directory is
|
||||
* in fact a directory node. If it is then the offset into the directory
|
||||
* will be set to 0 to position to the first directory entry.
|
||||
@@ -50,9 +52,9 @@ int imfs_dir_open(
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_read
|
||||
*
|
||||
* This routine will read the next directory entry based on the directory
|
||||
* offset. The offset should be equal to -n- time the size of an individual
|
||||
* dirent structure. If n is not an integer multiple of the sizeof a
|
||||
@@ -100,7 +102,7 @@ int imfs_dir_read(
|
||||
last_entry = first_entry + (count/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
/* The directory was not empty so try to move to the desired entry in chain*/
|
||||
for(
|
||||
for (
|
||||
current_entry = 0;
|
||||
current_entry < last_entry;
|
||||
current_entry = current_entry + sizeof(struct dirent) ){
|
||||
@@ -138,7 +140,9 @@ int imfs_dir_read(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_close
|
||||
*
|
||||
* This routine will be called by the generic close routine to cleanup any
|
||||
* resources that have been allocated for the management of the file
|
||||
*/
|
||||
@@ -147,16 +151,20 @@ int imfs_dir_close(
|
||||
rtems_libio_t *iop
|
||||
)
|
||||
{
|
||||
/* The generic close routine handles the deallocation of the file control */
|
||||
/* and associated memory. At present the imfs_dir_close simply */
|
||||
/* returns a successful completion status */
|
||||
/*
|
||||
* The generic close routine handles the deallocation of the file control
|
||||
* and associated memory. At present the imfs_dir_close simply
|
||||
* returns a successful completion status.
|
||||
*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_lseek
|
||||
*
|
||||
* This routine will behave in one of three ways based on the state of
|
||||
* argument whence. Based on the state of its value the offset argument will
|
||||
* be interpreted using one of the following methods:
|
||||
@@ -180,8 +188,7 @@ int imfs_dir_lseek(
|
||||
normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);
|
||||
|
||||
|
||||
switch( whence )
|
||||
{
|
||||
switch( whence ) {
|
||||
case SEEK_SET: /* absolute move from the start of the file */
|
||||
iop->offset = normal_offset;
|
||||
break;
|
||||
@@ -203,7 +210,9 @@ int imfs_dir_lseek(
|
||||
|
||||
|
||||
|
||||
/* -----------------------------------------------------------------------
|
||||
/*
|
||||
* imfs_dir_fstat
|
||||
*
|
||||
* This routine will obtain the following information concerning the current
|
||||
* directory:
|
||||
* st_dev 0ll
|
||||
|
||||
@@ -36,10 +36,3 @@ rtems_filesystem_file_handlers_r IMFS_directory_handlers = {
|
||||
imfs_dir_rmnod
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user