Changeset a02224e in rtems


Ignore:
Timestamp:
Jan 4, 2002, 6:29:37 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
b2709481
Parents:
b72e368c
Message:

2002-01-04 Ralf Corsepius <corsepiu@…>

  • include/rtems/libio_.h: Remove set_errno_and_return_minus_one.
  • libc/cfsetispeed.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/cfsetospeed.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chdir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chmod.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chown.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/chroot.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/closedir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/eval.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fchdir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fchmod.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fdatasync.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fpathconf.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fstat.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/fsync.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ftruncate.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/getdents.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ioctl.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/link.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/lseek.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/mknod.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/open.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/read.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/readlink.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/rmdir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/stat.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/symlink.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/tcsetattr.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/telldir.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ttyname.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/ttyname_r.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/unlink.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/unmount.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/utime.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
  • libc/write.c: Include <rtems/seterr.h>. Apply rtems_set_errno_and_return_minus_one.
Files:
106 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/libcsupport/include/rtems/libio_.h

    rb72e368c ra02224e  
    6969
    7070/*
    71  *  set_errno_and_return_minus_one
    72  *
    73  *  Macro to ease common way to return an error.
    74  */
    75 
    76 #ifndef set_errno_and_return_minus_one
    77 #define set_errno_and_return_minus_one( _error ) \
    78   do { errno = (_error); return -1; } while(0)
    79 #endif
    80 
    81 /*
    8271 *  rtems_libio_iop
    8372 *
     
    153142  do {                                                \
    154143      if (((_iop)->flags & (_flag)) == 0) {           \
    155             set_errno_and_return_minus_one( EINVAL ); \
     144            rtems_set_errno_and_return_minus_one( EINVAL ); \
    156145            return -1;                                \
    157146      }                                               \
     
    252241#define _POSIX_types_Getlogin_buffer (rtems_current_user_env->login_buffer)
    253242
    254 
    255243/*
    256244 *  Instantiate a private copy of the per user information for the calling task.
  • c/src/exec/libcsupport/src/cfsetispeed.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int cfsetispeed(
     
    3233{
    3334  if ( speed & ~CBAUD )
    34     set_errno_and_return_minus_one( EINVAL );
     35    rtems_set_errno_and_return_minus_one( EINVAL );
    3536
    3637  tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD));
  • c/src/exec/libcsupport/src/cfsetospeed.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int cfsetospeed(
     
    3233{
    3334  if ( speed & ~CBAUD )
    34     set_errno_and_return_minus_one( EINVAL );
     35    rtems_set_errno_and_return_minus_one( EINVAL );
    3536
    3637  tp->c_cflag = (tp->c_cflag & ~CBAUD) | speed;
  • c/src/exec/libcsupport/src/chdir.c

    rb72e368c ra02224e  
    2222
    2323#include <rtems/libio_.h>
     24#include <rtems/seterr.h>
    2425
    2526int chdir(
     
    4546  if ( !loc.ops->node_type_h ) {
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
    5152    rtems_filesystem_freenode( &loc );
    52     set_errno_and_return_minus_one( ENOTDIR );
     53    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5354  }
    5455 
  • c/src/exec/libcsupport/src/chmod.c

    rb72e368c ra02224e  
    2424
    2525#include <rtems/libio_.h>
     26#include <rtems/seterr.h>
    2627
    2728int chmod(
     
    4041  if ( !loc.handlers ){
    4142    rtems_filesystem_freenode( &loc );
    42     set_errno_and_return_minus_one( EBADF );
     43    rtems_set_errno_and_return_minus_one( EBADF );
    4344  }
    4445
    4546  if ( !loc.handlers->fchmod_h ){
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
  • c/src/exec/libcsupport/src/chown.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int chown(
     
    3839  if ( !loc.ops->chown_h ) {
    3940    rtems_filesystem_freenode( &loc );
    40     set_errno_and_return_minus_one( ENOTSUP );
     41    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4142  }
    4243
  • c/src/exec/libcsupport/src/chroot.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int chroot(
     
    3536   rtems_libio_set_private_env(); /* try to set a new private env*/
    3637   if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  };
    3940
     
    4344  if (result) {
    4445    rtems_filesystem_root = loc; /* restore the value */
    45     set_errno_and_return_minus_one( errno );
     46    rtems_set_errno_and_return_minus_one( errno );
    4647  };
    4748  rtems_filesystem_root = rtems_filesystem_current;
  • c/src/exec/libcsupport/src/closedir.c

    rb72e368c ra02224e  
    5252
    5353#include <rtems/libio_.h>
     54#include <rtems/seterr.h>
    5455
    5556/*
     
    6364
    6465        if ( !dirp )
    65           set_errno_and_return_minus_one( EBADF );
     66          rtems_set_errno_and_return_minus_one( EBADF );
    6667
    6768        fd = dirp->dd_fd;
  • c/src/exec/libcsupport/src/eval.c

    rb72e368c ra02224e  
    2020#include <rtems.h>
    2121#include <rtems/libio_.h>
     22#include <rtems/seterr.h>
    2223
    2324int rtems_filesystem_evaluate_path(
     
    3738
    3839  if ( !pathname )
    39     set_errno_and_return_minus_one( EFAULT );
     40    rtems_set_errno_and_return_minus_one( EFAULT );
    4041
    4142  if ( !pathloc )
    42     set_errno_and_return_minus_one( EIO );       /* should never happen */
     43    rtems_set_errno_and_return_minus_one( EIO );       /* should never happen */
    4344 
    4445  /*
     
    4950
    5051  if ( !pathloc->ops->evalpath_h )
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253
    5354  result = (*pathloc->ops->evalpath_h)( &pathname[i], flags, pathloc );
     
    6162
    6263    if ( !pathloc->ops->node_type_h )
    63       set_errno_and_return_minus_one( ENOTSUP );
     64      rtems_set_errno_and_return_minus_one( ENOTSUP );
    6465
    6566    type = (*pathloc->ops->node_type_h)( pathloc );
     
    6970
    7071        if ( !pathloc->ops->eval_link_h )
    71           set_errno_and_return_minus_one( ENOTSUP );
     72          rtems_set_errno_and_return_minus_one( ENOTSUP );
    7273
    7374         result =  (*pathloc->ops->eval_link_h)( pathloc, flags );
  • c/src/exec/libcsupport/src/fchdir.c

    rb72e368c ra02224e  
    2323#include <rtems/libio.h>
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int fchdir(
     
    4546
    4647  if ( !iop->pathinfo.ops ) {
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if ( !iop->pathinfo.ops->node_type_h ) {
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253  }
    5354
    5455  if (  (*iop->pathinfo.ops->node_type_h)( &iop->pathinfo ) !=
    5556                                          RTEMS_FILESYSTEM_DIRECTORY ) {
    56     set_errno_and_return_minus_one( ENOTDIR );
     57    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5758  }
    5859 
  • c/src/exec/libcsupport/src/fchmod.c

    rb72e368c ra02224e  
    2323#include <rtems/libio.h>
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int fchmod(
     
    4243
    4344  if ( !iop->handlers->fchmod_h )
    44     set_errno_and_return_minus_one( ENOTSUP );
     45    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4546
    4647  return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode );
  • c/src/exec/libcsupport/src/fdatasync.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int fdatasync(
     
    3637
    3738  if ( !iop->handlers->fdatasync_h )
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940
    4041  return (*iop->handlers->fdatasync_h)( iop );
  • c/src/exec/libcsupport/src/fpathconf.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021#include <unistd.h>
     
    7980      break;
    8081    default:
    81       set_errno_and_return_minus_one( EINVAL );
     82      rtems_set_errno_and_return_minus_one( EINVAL );
    8283      break;
    8384  }
  • c/src/exec/libcsupport/src/fstat.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int fstat(
     
    3435
    3536  if ( !sbuf )
    36     set_errno_and_return_minus_one( EFAULT );
     37    rtems_set_errno_and_return_minus_one( EFAULT );
    3738
    3839  /*
     
    4546
    4647  if ( !iop->handlers )
    47     set_errno_and_return_minus_one( EBADF );
     48    rtems_set_errno_and_return_minus_one( EBADF );
    4849
    4950  if ( !iop->handlers->fstat_h )
    50     set_errno_and_return_minus_one( ENOTSUP );
     51    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5152
    5253  /*
  • c/src/exec/libcsupport/src/fsync.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int fsync(
     
    3637
    3738  if ( !iop->handlers )
    38     set_errno_and_return_minus_one( EBADF );
     39    rtems_set_errno_and_return_minus_one( EBADF );
    3940
    4041  if ( !iop->handlers->fsync_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  return (*iop->handlers->fsync_h)( iop );
  • c/src/exec/libcsupport/src/ftruncate.c

    rb72e368c ra02224e  
    2020
    2121#include <rtems/libio_.h>
     22#include <rtems/seterr.h>
    2223
    2324int ftruncate(
     
    4344  loc = iop->pathinfo;
    4445  if ( !loc.ops->node_type_h )
    45     set_errno_and_return_minus_one( ENOTSUP );
     46    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4647   
    4748  if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY )
    48     set_errno_and_return_minus_one( EISDIR );
     49    rtems_set_errno_and_return_minus_one( EISDIR );
    4950
    5051  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
    5152
    5253  if ( !iop->handlers->ftruncate_h )
    53     set_errno_and_return_minus_one( ENOTSUP );
     54    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5455
    5556  return (*iop->handlers->ftruncate_h)( iop, length );
  • c/src/exec/libcsupport/src/getdents.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int getdents(
     
    4647  loc = iop->pathinfo;
    4748  if ( !loc.ops->node_type_h )
    48     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4950   
    5051  if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY )
    51     set_errno_and_return_minus_one( ENOTDIR );
     52    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5253
    5354  /*
     
    5758
    5859  if ( !iop->handlers->read_h )
    59     set_errno_and_return_minus_one( ENOTSUP );
     60    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6061
    6162  return (*iop->handlers->read_h)( iop, dd_buf, dd_len  );
  • c/src/exec/libcsupport/src/ioctl.c

    rb72e368c ra02224e  
    1919#endif
    2020
     21#include <stdarg.h>
     22
    2123#include <rtems/libio_.h>
     24#include <rtems/seterr.h>
    2225
    2326#include <unistd.h>
     
    4750
    4851  if ( !iop->handlers )
    49     set_errno_and_return_minus_one( EBADF );
     52    rtems_set_errno_and_return_minus_one( EBADF );
    5053
    5154  if ( !iop->handlers->ioctl_h )
    52     set_errno_and_return_minus_one( ENOTSUP );
     55    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5356
    5457  rc = (*iop->handlers->ioctl_h)( iop, command, buffer );
  • c/src/exec/libcsupport/src/link.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int link(
     
    4950  if ( !parent_loc.ops->evalformake_h ) {
    5051    rtems_filesystem_freenode( &existing_loc );
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253  }
    5354
     
    5556  if ( result != 0 ) {
    5657    rtems_filesystem_freenode( &existing_loc );
    57     set_errno_and_return_minus_one( result );
     58    rtems_set_errno_and_return_minus_one( result );
    5859  }
    5960
     
    6667    rtems_filesystem_freenode( &existing_loc );
    6768    rtems_filesystem_freenode( &parent_loc );
    68     set_errno_and_return_minus_one( EXDEV );
     69    rtems_set_errno_and_return_minus_one( EXDEV );
    6970  }
    7071
     
    7273    rtems_filesystem_freenode( &existing_loc );
    7374    rtems_filesystem_freenode( &parent_loc );
    74     set_errno_and_return_minus_one( ENOTSUP );
     75    rtems_set_errno_and_return_minus_one( ENOTSUP );
    7576  }
    7677
  • c/src/exec/libcsupport/src/lseek.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223off_t lseek(
     
    3940
    4041  if ( !iop->handlers->lseek_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  /*
     
    6061
    6162    default:
    62       set_errno_and_return_minus_one( EINVAL );
     63      rtems_set_errno_and_return_minus_one( EINVAL );
    6364  }
    6465
  • c/src/exec/libcsupport/src/mknod.c

    rb72e368c ra02224e  
    2828
    2929#include <rtems/libio_.h>
     30#include <rtems/seterr.h>
    3031
    3132int mknod(
     
    4142
    4243  if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
    43     set_errno_and_return_minus_one( EINVAL );
     44    rtems_set_errno_and_return_minus_one( EINVAL );
    4445 
    4546  if ( S_ISFIFO(mode) )
    46     set_errno_and_return_minus_one( ENOTSUP );
     47    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4748
    4849  rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
     
    5051  if ( !temp_loc.ops->evalformake_h ) {
    5152    rtems_filesystem_freenode( &temp_loc );
    52     set_errno_and_return_minus_one( ENOTSUP );
     53    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5354  }
    5455
     
    6364  if ( !temp_loc.ops->mknod_h ) {
    6465    rtems_filesystem_freenode( &temp_loc );
    65     set_errno_and_return_minus_one( ENOTSUP );
     66    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6667  }
    6768
  • c/src/exec/libcsupport/src/open.c

    rb72e368c ra02224e  
    1616#endif
    1717
     18#include <stdarg.h>
     19#include <fcntl.h>
    1820#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    1922
    2023#include <unistd.h>
     
    185188    if ( loc_to_free )
    186189      rtems_filesystem_freenode( loc_to_free );
    187     set_errno_and_return_minus_one( rc );
     190    rtems_set_errno_and_return_minus_one( rc );
    188191  }
    189192
  • c/src/exec/libcsupport/src/read.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021ssize_t read(
     
    3940
    4041  if ( !iop->handlers->read_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  rc = (*iop->handlers->read_h)( iop, buffer, count );
  • c/src/exec/libcsupport/src/readlink.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021int readlink(
     
    2829
    2930  if (!buf)
    30     set_errno_and_return_minus_one( EFAULT );
     31    rtems_set_errno_and_return_minus_one( EFAULT );
    3132
    3233  result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE );
     
    3637  if ( !loc.ops->node_type_h ){
    3738    rtems_filesystem_freenode( &loc );
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940  }
    4041
    4142  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){
    4243    rtems_filesystem_freenode( &loc );
    43     set_errno_and_return_minus_one( EINVAL );
     44    rtems_set_errno_and_return_minus_one( EINVAL );
    4445  }
    4546
    4647  if ( !loc.ops->readlink_h ){
    4748    rtems_filesystem_freenode( &loc );
    48     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4950  }
    5051
  • c/src/exec/libcsupport/src/rmdir.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int rmdir(
     
    4546  if ( !loc.ops->node_type_h ){
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
    5152    rtems_filesystem_freenode( &loc );
    52     set_errno_and_return_minus_one( ENOTDIR );
     53    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5354  }
    5455
     
    5960  if ( !loc.handlers->rmnod_h ){
    6061    rtems_filesystem_freenode( &loc );
    61     set_errno_and_return_minus_one( ENOTSUP );
     62    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6263  }
    6364
  • c/src/exec/libcsupport/src/stat.c

    rb72e368c ra02224e  
    4242
    4343#include <rtems/libio_.h>
     44#include <rtems/seterr.h>
    4445
    4546int _STAT_NAME(
     
    5657
    5758  if ( !buf )
    58     set_errno_and_return_minus_one( EFAULT );
     59    rtems_set_errno_and_return_minus_one( EFAULT );
    5960
    6061  status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
     
    6465  if ( !loc.handlers->fstat_h ){
    6566    rtems_filesystem_freenode( &loc );
    66     set_errno_and_return_minus_one( ENOTSUP );
     67    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6768  }
    6869
  • c/src/exec/libcsupport/src/symlink.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021int symlink(
     
    3536  if ( !loc.ops->symlink_h ) {
    3637    rtems_filesystem_freenode( &loc );
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  }
    3940
  • c/src/exec/libcsupport/src/tcsetattr.c

    rb72e368c ra02224e  
    2727#include <rtems/libio.h>
    2828#include <rtems/libio_.h>
     29#include <rtems/seterr.h>
    2930
    3031int tcsetattr(
     
    3637  switch (opt) {
    3738  default:
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940
    4041  case TCSADRAIN:
  • c/src/exec/libcsupport/src/telldir.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
    25 
     25#include <rtems/seterr.h>
    2626
    2727long telldir(
     
    3232
    3333  if ( !dirp )
    34     set_errno_and_return_minus_one( EBADF );
     34    rtems_set_errno_and_return_minus_one( EBADF );
    3535
    3636  /*
  • c/src/exec/libcsupport/src/ttyname.c

    rb72e368c ra02224e  
    2020
    2121#include <rtems/libio_.h>
    22 
     22#include <rtems/seterr.h>
    2323
    2424int ttyname_r(
     
    3737  /* Must be a terminal. */
    3838  if (tcgetattr (fd, &tty) < 0)
    39     set_errno_and_return_minus_one(EBADF);
     39    rtems_set_errno_and_return_minus_one(EBADF);
    4040
    4141  /* Must be a character device. */
    4242  if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    43     set_errno_and_return_minus_one(EBADF);
     43    rtems_set_errno_and_return_minus_one(EBADF);
    4444
    4545  if ((dp = opendir (_PATH_DEV)) == NULL)
    46     set_errno_and_return_minus_one(EBADF);
     46    rtems_set_errno_and_return_minus_one(EBADF);
    4747
    4848  for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
  • c/src/exec/libcsupport/src/ttyname_r.c

    rb72e368c ra02224e  
    5656
    5757#include <rtems/libio_.h>
     58#include <rtems/seterr.h>
    5859
    5960/*
     
    7677  /* Must be a terminal. */
    7778  if (tcgetattr (fd, &tty) < 0)
    78     set_errno_and_return_minus_one(EBADF);
     79    rtems_set_errno_and_return_minus_one(EBADF);
    7980
    8081  /* Must be a character device. */
    8182  if (_fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    82     set_errno_and_return_minus_one(EBADF);
     83    rtems_set_errno_and_return_minus_one(EBADF);
    8384
    8485  if ((dp = opendir (_PATH_DEV)) == NULL)
    85     set_errno_and_return_minus_one(EBADF);
     86    rtems_set_errno_and_return_minus_one(EBADF);
    8687
    8788  for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
  • c/src/exec/libcsupport/src/unlink.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int unlink(
     
    3738  if ( !loc.ops->node_type_h ) {
    3839    rtems_filesystem_freenode( &loc );
    39     set_errno_and_return_minus_one( ENOTSUP );
     40    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4041  }
    4142
    4243  if (  (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) {
    4344    rtems_filesystem_freenode( &loc );
    44     set_errno_and_return_minus_one( EISDIR );
     45    rtems_set_errno_and_return_minus_one( EISDIR );
    4546  }
    4647
    4748  if ( !loc.ops->unlink_h ) {
    4849    rtems_filesystem_freenode( &loc );
    49     set_errno_and_return_minus_one( ENOTSUP );
     50    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5051  }
    5152
  • c/src/exec/libcsupport/src/unmount.c

    rb72e368c ra02224e  
    3232
    3333#include <rtems/libio_.h>
     34#include <rtems/seterr.h>
    3435
    3536/*
     
    126127  if ( !rtems_filesystem_nodes_equal( fs_root_loc, &loc) ){
    127128    rtems_filesystem_freenode( &loc );
    128     set_errno_and_return_minus_one( EACCES );
     129    rtems_set_errno_and_return_minus_one( EACCES );
    129130  }
    130131
     
    140141
    141142  if ( !fs_mount_loc->ops->unmount_h )
    142     set_errno_and_return_minus_one( ENOTSUP );
     143    rtems_set_errno_and_return_minus_one( ENOTSUP );
    143144
    144145  if ( !fs_root_loc->ops->fsunmount_me_h )
    145     set_errno_and_return_minus_one( ENOTSUP );
     146    rtems_set_errno_and_return_minus_one( ENOTSUP );
    146147
    147148
     
    155156
    156157  if ( rtems_filesystem_current.mt_entry == mt_entry )
    157     set_errno_and_return_minus_one( EBUSY );
     158    rtems_set_errno_and_return_minus_one( EBUSY );
    158159
    159160  /*
     
    162163
    163164  if ( file_systems_below_this_mountpoint( path, fs_root_loc, mt_entry ) != 0 )
    164     set_errno_and_return_minus_one( EBUSY );
     165    rtems_set_errno_and_return_minus_one( EBUSY );
    165166
    166167  /*
     
    171172
    172173  if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 )
    173     set_errno_and_return_minus_one( EBUSY );
     174    rtems_set_errno_and_return_minus_one( EBUSY );
    174175 
    175176  /*
  • c/src/exec/libcsupport/src/utime.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int utime(
     
    3536  if ( !temp_loc.ops->utime_h ){
    3637    rtems_filesystem_freenode( &temp_loc );
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  }
    3940
  • c/src/exec/libcsupport/src/write.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
    19 
     19#include <rtems/seterr.h>
    2020
    2121/*
     
    4747
    4848  if ( !iop->handlers->write_h )
    49     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5050
    5151  rc = (*iop->handlers->write_h)( iop, buffer, count );
  • c/src/lib/ChangeLog

    rb72e368c ra02224e  
     12002-01-04      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
     2
     3        * include/rtems/libio_.h: Remove set_errno_and_return_minus_one.
     4        * libc/cfsetispeed.c: Include <rtems/seterr.h>.
     5        Apply rtems_set_errno_and_return_minus_one.
     6        * libc/cfsetospeed.c: Include <rtems/seterr.h>.
     7        Apply rtems_set_errno_and_return_minus_one.
     8        * libc/chdir.c: Include <rtems/seterr.h>.
     9        Apply rtems_set_errno_and_return_minus_one.
     10        * libc/chmod.c: Include <rtems/seterr.h>.
     11        Apply rtems_set_errno_and_return_minus_one.
     12        * libc/chown.c: Include <rtems/seterr.h>.
     13        Apply rtems_set_errno_and_return_minus_one.
     14        * libc/chroot.c: Include <rtems/seterr.h>.
     15        Apply rtems_set_errno_and_return_minus_one.
     16        * libc/closedir.c: Include <rtems/seterr.h>.
     17        Apply rtems_set_errno_and_return_minus_one.
     18        * libc/eval.c: Include <rtems/seterr.h>.
     19        Apply rtems_set_errno_and_return_minus_one.
     20        * libc/fchdir.c: Include <rtems/seterr.h>.
     21        Apply rtems_set_errno_and_return_minus_one.
     22        * libc/fchmod.c: Include <rtems/seterr.h>.
     23        Apply rtems_set_errno_and_return_minus_one.
     24        * libc/fdatasync.c: Include <rtems/seterr.h>.
     25        Apply rtems_set_errno_and_return_minus_one.
     26        * libc/fpathconf.c: Include <rtems/seterr.h>.
     27        Apply rtems_set_errno_and_return_minus_one.
     28        * libc/fstat.c: Include <rtems/seterr.h>.
     29        Apply rtems_set_errno_and_return_minus_one.
     30        * libc/fsync.c: Include <rtems/seterr.h>.
     31        Apply rtems_set_errno_and_return_minus_one.
     32        * libc/ftruncate.c: Include <rtems/seterr.h>.
     33        Apply rtems_set_errno_and_return_minus_one.
     34        * libc/getdents.c: Include <rtems/seterr.h>.
     35        Apply rtems_set_errno_and_return_minus_one.
     36        * libc/ioctl.c: Include <rtems/seterr.h>.
     37        Apply rtems_set_errno_and_return_minus_one.
     38        * libc/link.c: Include <rtems/seterr.h>.
     39        Apply rtems_set_errno_and_return_minus_one.
     40        * libc/lseek.c: Include <rtems/seterr.h>.
     41        Apply rtems_set_errno_and_return_minus_one.
     42        * libc/mknod.c: Include <rtems/seterr.h>.
     43        Apply rtems_set_errno_and_return_minus_one.
     44        * libc/open.c: Include <rtems/seterr.h>.
     45        Apply rtems_set_errno_and_return_minus_one.
     46        * libc/read.c: Include <rtems/seterr.h>.
     47        Apply rtems_set_errno_and_return_minus_one.
     48        * libc/readlink.c: Include <rtems/seterr.h>.
     49        Apply rtems_set_errno_and_return_minus_one.
     50        * libc/rmdir.c: Include <rtems/seterr.h>.
     51        Apply rtems_set_errno_and_return_minus_one.
     52        * libc/stat.c: Include <rtems/seterr.h>.
     53        Apply rtems_set_errno_and_return_minus_one.
     54        * libc/symlink.c: Include <rtems/seterr.h>.
     55        Apply rtems_set_errno_and_return_minus_one.
     56        * libc/tcsetattr.c: Include <rtems/seterr.h>.
     57        Apply rtems_set_errno_and_return_minus_one.
     58        * libc/telldir.c: Include <rtems/seterr.h>.
     59        Apply rtems_set_errno_and_return_minus_one.
     60        * libc/ttyname.c: Include <rtems/seterr.h>.
     61        Apply rtems_set_errno_and_return_minus_one.
     62        * libc/ttyname_r.c: Include <rtems/seterr.h>.
     63        Apply rtems_set_errno_and_return_minus_one.
     64        * libc/unlink.c: Include <rtems/seterr.h>.
     65        Apply rtems_set_errno_and_return_minus_one.
     66        * libc/unmount.c: Include <rtems/seterr.h>.
     67        Apply rtems_set_errno_and_return_minus_one.
     68        * libc/utime.c: Include <rtems/seterr.h>.
     69        Apply rtems_set_errno_and_return_minus_one.
     70        * libc/write.c: Include <rtems/seterr.h>.
     71        Apply rtems_set_errno_and_return_minus_one.
     72
    1732002-01-03      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    274
  • c/src/lib/include/rtems/libio_.h

    rb72e368c ra02224e  
    6969
    7070/*
    71  *  set_errno_and_return_minus_one
    72  *
    73  *  Macro to ease common way to return an error.
    74  */
    75 
    76 #ifndef set_errno_and_return_minus_one
    77 #define set_errno_and_return_minus_one( _error ) \
    78   do { errno = (_error); return -1; } while(0)
    79 #endif
    80 
    81 /*
    8271 *  rtems_libio_iop
    8372 *
     
    153142  do {                                                \
    154143      if (((_iop)->flags & (_flag)) == 0) {           \
    155             set_errno_and_return_minus_one( EINVAL ); \
     144            rtems_set_errno_and_return_minus_one( EINVAL ); \
    156145            return -1;                                \
    157146      }                                               \
     
    252241#define _POSIX_types_Getlogin_buffer (rtems_current_user_env->login_buffer)
    253242
    254 
    255243/*
    256244 *  Instantiate a private copy of the per user information for the calling task.
  • c/src/lib/libc/cfsetispeed.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int cfsetispeed(
     
    3233{
    3334  if ( speed & ~CBAUD )
    34     set_errno_and_return_minus_one( EINVAL );
     35    rtems_set_errno_and_return_minus_one( EINVAL );
    3536
    3637  tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD));
  • c/src/lib/libc/cfsetospeed.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int cfsetospeed(
     
    3233{
    3334  if ( speed & ~CBAUD )
    34     set_errno_and_return_minus_one( EINVAL );
     35    rtems_set_errno_and_return_minus_one( EINVAL );
    3536
    3637  tp->c_cflag = (tp->c_cflag & ~CBAUD) | speed;
  • c/src/lib/libc/chdir.c

    rb72e368c ra02224e  
    2222
    2323#include <rtems/libio_.h>
     24#include <rtems/seterr.h>
    2425
    2526int chdir(
     
    4546  if ( !loc.ops->node_type_h ) {
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
    5152    rtems_filesystem_freenode( &loc );
    52     set_errno_and_return_minus_one( ENOTDIR );
     53    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5354  }
    5455 
  • c/src/lib/libc/chmod.c

    rb72e368c ra02224e  
    2424
    2525#include <rtems/libio_.h>
     26#include <rtems/seterr.h>
    2627
    2728int chmod(
     
    4041  if ( !loc.handlers ){
    4142    rtems_filesystem_freenode( &loc );
    42     set_errno_and_return_minus_one( EBADF );
     43    rtems_set_errno_and_return_minus_one( EBADF );
    4344  }
    4445
    4546  if ( !loc.handlers->fchmod_h ){
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
  • c/src/lib/libc/chown.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int chown(
     
    3839  if ( !loc.ops->chown_h ) {
    3940    rtems_filesystem_freenode( &loc );
    40     set_errno_and_return_minus_one( ENOTSUP );
     41    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4142  }
    4243
  • c/src/lib/libc/chroot.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int chroot(
     
    3536   rtems_libio_set_private_env(); /* try to set a new private env*/
    3637   if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  };
    3940
     
    4344  if (result) {
    4445    rtems_filesystem_root = loc; /* restore the value */
    45     set_errno_and_return_minus_one( errno );
     46    rtems_set_errno_and_return_minus_one( errno );
    4647  };
    4748  rtems_filesystem_root = rtems_filesystem_current;
  • c/src/lib/libc/closedir.c

    rb72e368c ra02224e  
    5252
    5353#include <rtems/libio_.h>
     54#include <rtems/seterr.h>
    5455
    5556/*
     
    6364
    6465        if ( !dirp )
    65           set_errno_and_return_minus_one( EBADF );
     66          rtems_set_errno_and_return_minus_one( EBADF );
    6667
    6768        fd = dirp->dd_fd;
  • c/src/lib/libc/eval.c

    rb72e368c ra02224e  
    2020#include <rtems.h>
    2121#include <rtems/libio_.h>
     22#include <rtems/seterr.h>
    2223
    2324int rtems_filesystem_evaluate_path(
     
    3738
    3839  if ( !pathname )
    39     set_errno_and_return_minus_one( EFAULT );
     40    rtems_set_errno_and_return_minus_one( EFAULT );
    4041
    4142  if ( !pathloc )
    42     set_errno_and_return_minus_one( EIO );       /* should never happen */
     43    rtems_set_errno_and_return_minus_one( EIO );       /* should never happen */
    4344 
    4445  /*
     
    4950
    5051  if ( !pathloc->ops->evalpath_h )
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253
    5354  result = (*pathloc->ops->evalpath_h)( &pathname[i], flags, pathloc );
     
    6162
    6263    if ( !pathloc->ops->node_type_h )
    63       set_errno_and_return_minus_one( ENOTSUP );
     64      rtems_set_errno_and_return_minus_one( ENOTSUP );
    6465
    6566    type = (*pathloc->ops->node_type_h)( pathloc );
     
    6970
    7071        if ( !pathloc->ops->eval_link_h )
    71           set_errno_and_return_minus_one( ENOTSUP );
     72          rtems_set_errno_and_return_minus_one( ENOTSUP );
    7273
    7374         result =  (*pathloc->ops->eval_link_h)( pathloc, flags );
  • c/src/lib/libc/fchdir.c

    rb72e368c ra02224e  
    2323#include <rtems/libio.h>
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int fchdir(
     
    4546
    4647  if ( !iop->pathinfo.ops ) {
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if ( !iop->pathinfo.ops->node_type_h ) {
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253  }
    5354
    5455  if (  (*iop->pathinfo.ops->node_type_h)( &iop->pathinfo ) !=
    5556                                          RTEMS_FILESYSTEM_DIRECTORY ) {
    56     set_errno_and_return_minus_one( ENOTDIR );
     57    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5758  }
    5859 
  • c/src/lib/libc/fchmod.c

    rb72e368c ra02224e  
    2323#include <rtems/libio.h>
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int fchmod(
     
    4243
    4344  if ( !iop->handlers->fchmod_h )
    44     set_errno_and_return_minus_one( ENOTSUP );
     45    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4546
    4647  return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode );
  • c/src/lib/libc/fdatasync.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int fdatasync(
     
    3637
    3738  if ( !iop->handlers->fdatasync_h )
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940
    4041  return (*iop->handlers->fdatasync_h)( iop );
  • c/src/lib/libc/fpathconf.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021#include <unistd.h>
     
    7980      break;
    8081    default:
    81       set_errno_and_return_minus_one( EINVAL );
     82      rtems_set_errno_and_return_minus_one( EINVAL );
    8283      break;
    8384  }
  • c/src/lib/libc/fstat.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int fstat(
     
    3435
    3536  if ( !sbuf )
    36     set_errno_and_return_minus_one( EFAULT );
     37    rtems_set_errno_and_return_minus_one( EFAULT );
    3738
    3839  /*
     
    4546
    4647  if ( !iop->handlers )
    47     set_errno_and_return_minus_one( EBADF );
     48    rtems_set_errno_and_return_minus_one( EBADF );
    4849
    4950  if ( !iop->handlers->fstat_h )
    50     set_errno_and_return_minus_one( ENOTSUP );
     51    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5152
    5253  /*
  • c/src/lib/libc/fsync.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int fsync(
     
    3637
    3738  if ( !iop->handlers )
    38     set_errno_and_return_minus_one( EBADF );
     39    rtems_set_errno_and_return_minus_one( EBADF );
    3940
    4041  if ( !iop->handlers->fsync_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  return (*iop->handlers->fsync_h)( iop );
  • c/src/lib/libc/ftruncate.c

    rb72e368c ra02224e  
    2020
    2121#include <rtems/libio_.h>
     22#include <rtems/seterr.h>
    2223
    2324int ftruncate(
     
    4344  loc = iop->pathinfo;
    4445  if ( !loc.ops->node_type_h )
    45     set_errno_and_return_minus_one( ENOTSUP );
     46    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4647   
    4748  if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY )
    48     set_errno_and_return_minus_one( EISDIR );
     49    rtems_set_errno_and_return_minus_one( EISDIR );
    4950
    5051  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
    5152
    5253  if ( !iop->handlers->ftruncate_h )
    53     set_errno_and_return_minus_one( ENOTSUP );
     54    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5455
    5556  return (*iop->handlers->ftruncate_h)( iop, length );
  • c/src/lib/libc/getdents.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int getdents(
     
    4647  loc = iop->pathinfo;
    4748  if ( !loc.ops->node_type_h )
    48     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4950   
    5051  if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY )
    51     set_errno_and_return_minus_one( ENOTDIR );
     52    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5253
    5354  /*
     
    5758
    5859  if ( !iop->handlers->read_h )
    59     set_errno_and_return_minus_one( ENOTSUP );
     60    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6061
    6162  return (*iop->handlers->read_h)( iop, dd_buf, dd_len  );
  • c/src/lib/libc/ioctl.c

    rb72e368c ra02224e  
    1919#endif
    2020
     21#include <stdarg.h>
     22
    2123#include <rtems/libio_.h>
     24#include <rtems/seterr.h>
    2225
    2326#include <unistd.h>
     
    4750
    4851  if ( !iop->handlers )
    49     set_errno_and_return_minus_one( EBADF );
     52    rtems_set_errno_and_return_minus_one( EBADF );
    5053
    5154  if ( !iop->handlers->ioctl_h )
    52     set_errno_and_return_minus_one( ENOTSUP );
     55    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5356
    5457  rc = (*iop->handlers->ioctl_h)( iop, command, buffer );
  • c/src/lib/libc/link.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int link(
     
    4950  if ( !parent_loc.ops->evalformake_h ) {
    5051    rtems_filesystem_freenode( &existing_loc );
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253  }
    5354
     
    5556  if ( result != 0 ) {
    5657    rtems_filesystem_freenode( &existing_loc );
    57     set_errno_and_return_minus_one( result );
     58    rtems_set_errno_and_return_minus_one( result );
    5859  }
    5960
     
    6667    rtems_filesystem_freenode( &existing_loc );
    6768    rtems_filesystem_freenode( &parent_loc );
    68     set_errno_and_return_minus_one( EXDEV );
     69    rtems_set_errno_and_return_minus_one( EXDEV );
    6970  }
    7071
     
    7273    rtems_filesystem_freenode( &existing_loc );
    7374    rtems_filesystem_freenode( &parent_loc );
    74     set_errno_and_return_minus_one( ENOTSUP );
     75    rtems_set_errno_and_return_minus_one( ENOTSUP );
    7576  }
    7677
  • c/src/lib/libc/lseek.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223off_t lseek(
     
    3940
    4041  if ( !iop->handlers->lseek_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  /*
     
    6061
    6162    default:
    62       set_errno_and_return_minus_one( EINVAL );
     63      rtems_set_errno_and_return_minus_one( EINVAL );
    6364  }
    6465
  • c/src/lib/libc/mknod.c

    rb72e368c ra02224e  
    2828
    2929#include <rtems/libio_.h>
     30#include <rtems/seterr.h>
    3031
    3132int mknod(
     
    4142
    4243  if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
    43     set_errno_and_return_minus_one( EINVAL );
     44    rtems_set_errno_and_return_minus_one( EINVAL );
    4445 
    4546  if ( S_ISFIFO(mode) )
    46     set_errno_and_return_minus_one( ENOTSUP );
     47    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4748
    4849  rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
     
    5051  if ( !temp_loc.ops->evalformake_h ) {
    5152    rtems_filesystem_freenode( &temp_loc );
    52     set_errno_and_return_minus_one( ENOTSUP );
     53    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5354  }
    5455
     
    6364  if ( !temp_loc.ops->mknod_h ) {
    6465    rtems_filesystem_freenode( &temp_loc );
    65     set_errno_and_return_minus_one( ENOTSUP );
     66    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6667  }
    6768
  • c/src/lib/libc/open.c

    rb72e368c ra02224e  
    1616#endif
    1717
     18#include <stdarg.h>
     19#include <fcntl.h>
    1820#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    1922
    2023#include <unistd.h>
     
    185188    if ( loc_to_free )
    186189      rtems_filesystem_freenode( loc_to_free );
    187     set_errno_and_return_minus_one( rc );
     190    rtems_set_errno_and_return_minus_one( rc );
    188191  }
    189192
  • c/src/lib/libc/read.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021ssize_t read(
     
    3940
    4041  if ( !iop->handlers->read_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  rc = (*iop->handlers->read_h)( iop, buffer, count );
  • c/src/lib/libc/readlink.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021int readlink(
     
    2829
    2930  if (!buf)
    30     set_errno_and_return_minus_one( EFAULT );
     31    rtems_set_errno_and_return_minus_one( EFAULT );
    3132
    3233  result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE );
     
    3637  if ( !loc.ops->node_type_h ){
    3738    rtems_filesystem_freenode( &loc );
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940  }
    4041
    4142  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){
    4243    rtems_filesystem_freenode( &loc );
    43     set_errno_and_return_minus_one( EINVAL );
     44    rtems_set_errno_and_return_minus_one( EINVAL );
    4445  }
    4546
    4647  if ( !loc.ops->readlink_h ){
    4748    rtems_filesystem_freenode( &loc );
    48     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4950  }
    5051
  • c/src/lib/libc/rmdir.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int rmdir(
     
    4546  if ( !loc.ops->node_type_h ){
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
    5152    rtems_filesystem_freenode( &loc );
    52     set_errno_and_return_minus_one( ENOTDIR );
     53    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5354  }
    5455
     
    5960  if ( !loc.handlers->rmnod_h ){
    6061    rtems_filesystem_freenode( &loc );
    61     set_errno_and_return_minus_one( ENOTSUP );
     62    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6263  }
    6364
  • c/src/lib/libc/stat.c

    rb72e368c ra02224e  
    4242
    4343#include <rtems/libio_.h>
     44#include <rtems/seterr.h>
    4445
    4546int _STAT_NAME(
     
    5657
    5758  if ( !buf )
    58     set_errno_and_return_minus_one( EFAULT );
     59    rtems_set_errno_and_return_minus_one( EFAULT );
    5960
    6061  status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
     
    6465  if ( !loc.handlers->fstat_h ){
    6566    rtems_filesystem_freenode( &loc );
    66     set_errno_and_return_minus_one( ENOTSUP );
     67    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6768  }
    6869
  • c/src/lib/libc/symlink.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021int symlink(
     
    3536  if ( !loc.ops->symlink_h ) {
    3637    rtems_filesystem_freenode( &loc );
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  }
    3940
  • c/src/lib/libc/tcsetattr.c

    rb72e368c ra02224e  
    2727#include <rtems/libio.h>
    2828#include <rtems/libio_.h>
     29#include <rtems/seterr.h>
    2930
    3031int tcsetattr(
     
    3637  switch (opt) {
    3738  default:
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940
    4041  case TCSADRAIN:
  • c/src/lib/libc/telldir.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
    25 
     25#include <rtems/seterr.h>
    2626
    2727long telldir(
     
    3232
    3333  if ( !dirp )
    34     set_errno_and_return_minus_one( EBADF );
     34    rtems_set_errno_and_return_minus_one( EBADF );
    3535
    3636  /*
  • c/src/lib/libc/ttyname.c

    rb72e368c ra02224e  
    2020
    2121#include <rtems/libio_.h>
    22 
     22#include <rtems/seterr.h>
    2323
    2424int ttyname_r(
     
    3737  /* Must be a terminal. */
    3838  if (tcgetattr (fd, &tty) < 0)
    39     set_errno_and_return_minus_one(EBADF);
     39    rtems_set_errno_and_return_minus_one(EBADF);
    4040
    4141  /* Must be a character device. */
    4242  if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    43     set_errno_and_return_minus_one(EBADF);
     43    rtems_set_errno_and_return_minus_one(EBADF);
    4444
    4545  if ((dp = opendir (_PATH_DEV)) == NULL)
    46     set_errno_and_return_minus_one(EBADF);
     46    rtems_set_errno_and_return_minus_one(EBADF);
    4747
    4848  for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
  • c/src/lib/libc/ttyname_r.c

    rb72e368c ra02224e  
    5656
    5757#include <rtems/libio_.h>
     58#include <rtems/seterr.h>
    5859
    5960/*
     
    7677  /* Must be a terminal. */
    7778  if (tcgetattr (fd, &tty) < 0)
    78     set_errno_and_return_minus_one(EBADF);
     79    rtems_set_errno_and_return_minus_one(EBADF);
    7980
    8081  /* Must be a character device. */
    8182  if (_fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    82     set_errno_and_return_minus_one(EBADF);
     83    rtems_set_errno_and_return_minus_one(EBADF);
    8384
    8485  if ((dp = opendir (_PATH_DEV)) == NULL)
    85     set_errno_and_return_minus_one(EBADF);
     86    rtems_set_errno_and_return_minus_one(EBADF);
    8687
    8788  for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
  • c/src/lib/libc/unlink.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int unlink(
     
    3738  if ( !loc.ops->node_type_h ) {
    3839    rtems_filesystem_freenode( &loc );
    39     set_errno_and_return_minus_one( ENOTSUP );
     40    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4041  }
    4142
    4243  if (  (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) {
    4344    rtems_filesystem_freenode( &loc );
    44     set_errno_and_return_minus_one( EISDIR );
     45    rtems_set_errno_and_return_minus_one( EISDIR );
    4546  }
    4647
    4748  if ( !loc.ops->unlink_h ) {
    4849    rtems_filesystem_freenode( &loc );
    49     set_errno_and_return_minus_one( ENOTSUP );
     50    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5051  }
    5152
  • c/src/lib/libc/unmount.c

    rb72e368c ra02224e  
    3232
    3333#include <rtems/libio_.h>
     34#include <rtems/seterr.h>
    3435
    3536/*
     
    126127  if ( !rtems_filesystem_nodes_equal( fs_root_loc, &loc) ){
    127128    rtems_filesystem_freenode( &loc );
    128     set_errno_and_return_minus_one( EACCES );
     129    rtems_set_errno_and_return_minus_one( EACCES );
    129130  }
    130131
     
    140141
    141142  if ( !fs_mount_loc->ops->unmount_h )
    142     set_errno_and_return_minus_one( ENOTSUP );
     143    rtems_set_errno_and_return_minus_one( ENOTSUP );
    143144
    144145  if ( !fs_root_loc->ops->fsunmount_me_h )
    145     set_errno_and_return_minus_one( ENOTSUP );
     146    rtems_set_errno_and_return_minus_one( ENOTSUP );
    146147
    147148
     
    155156
    156157  if ( rtems_filesystem_current.mt_entry == mt_entry )
    157     set_errno_and_return_minus_one( EBUSY );
     158    rtems_set_errno_and_return_minus_one( EBUSY );
    158159
    159160  /*
     
    162163
    163164  if ( file_systems_below_this_mountpoint( path, fs_root_loc, mt_entry ) != 0 )
    164     set_errno_and_return_minus_one( EBUSY );
     165    rtems_set_errno_and_return_minus_one( EBUSY );
    165166
    166167  /*
     
    171172
    172173  if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 )
    173     set_errno_and_return_minus_one( EBUSY );
     174    rtems_set_errno_and_return_minus_one( EBUSY );
    174175 
    175176  /*
  • c/src/lib/libc/utime.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int utime(
     
    3536  if ( !temp_loc.ops->utime_h ){
    3637    rtems_filesystem_freenode( &temp_loc );
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  }
    3940
  • c/src/lib/libc/write.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
    19 
     19#include <rtems/seterr.h>
    2020
    2121/*
     
    4747
    4848  if ( !iop->handlers->write_h )
    49     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5050
    5151  rc = (*iop->handlers->write_h)( iop, buffer, count );
  • cpukit/libcsupport/include/rtems/libio_.h

    rb72e368c ra02224e  
    6969
    7070/*
    71  *  set_errno_and_return_minus_one
    72  *
    73  *  Macro to ease common way to return an error.
    74  */
    75 
    76 #ifndef set_errno_and_return_minus_one
    77 #define set_errno_and_return_minus_one( _error ) \
    78   do { errno = (_error); return -1; } while(0)
    79 #endif
    80 
    81 /*
    8271 *  rtems_libio_iop
    8372 *
     
    153142  do {                                                \
    154143      if (((_iop)->flags & (_flag)) == 0) {           \
    155             set_errno_and_return_minus_one( EINVAL ); \
     144            rtems_set_errno_and_return_minus_one( EINVAL ); \
    156145            return -1;                                \
    157146      }                                               \
     
    252241#define _POSIX_types_Getlogin_buffer (rtems_current_user_env->login_buffer)
    253242
    254 
    255243/*
    256244 *  Instantiate a private copy of the per user information for the calling task.
  • cpukit/libcsupport/src/cfsetispeed.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int cfsetispeed(
     
    3233{
    3334  if ( speed & ~CBAUD )
    34     set_errno_and_return_minus_one( EINVAL );
     35    rtems_set_errno_and_return_minus_one( EINVAL );
    3536
    3637  tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD));
  • cpukit/libcsupport/src/cfsetospeed.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int cfsetospeed(
     
    3233{
    3334  if ( speed & ~CBAUD )
    34     set_errno_and_return_minus_one( EINVAL );
     35    rtems_set_errno_and_return_minus_one( EINVAL );
    3536
    3637  tp->c_cflag = (tp->c_cflag & ~CBAUD) | speed;
  • cpukit/libcsupport/src/chdir.c

    rb72e368c ra02224e  
    2222
    2323#include <rtems/libio_.h>
     24#include <rtems/seterr.h>
    2425
    2526int chdir(
     
    4546  if ( !loc.ops->node_type_h ) {
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
    5152    rtems_filesystem_freenode( &loc );
    52     set_errno_and_return_minus_one( ENOTDIR );
     53    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5354  }
    5455 
  • cpukit/libcsupport/src/chmod.c

    rb72e368c ra02224e  
    2424
    2525#include <rtems/libio_.h>
     26#include <rtems/seterr.h>
    2627
    2728int chmod(
     
    4041  if ( !loc.handlers ){
    4142    rtems_filesystem_freenode( &loc );
    42     set_errno_and_return_minus_one( EBADF );
     43    rtems_set_errno_and_return_minus_one( EBADF );
    4344  }
    4445
    4546  if ( !loc.handlers->fchmod_h ){
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
  • cpukit/libcsupport/src/chown.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int chown(
     
    3839  if ( !loc.ops->chown_h ) {
    3940    rtems_filesystem_freenode( &loc );
    40     set_errno_and_return_minus_one( ENOTSUP );
     41    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4142  }
    4243
  • cpukit/libcsupport/src/chroot.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int chroot(
     
    3536   rtems_libio_set_private_env(); /* try to set a new private env*/
    3637   if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  };
    3940
     
    4344  if (result) {
    4445    rtems_filesystem_root = loc; /* restore the value */
    45     set_errno_and_return_minus_one( errno );
     46    rtems_set_errno_and_return_minus_one( errno );
    4647  };
    4748  rtems_filesystem_root = rtems_filesystem_current;
  • cpukit/libcsupport/src/closedir.c

    rb72e368c ra02224e  
    5252
    5353#include <rtems/libio_.h>
     54#include <rtems/seterr.h>
    5455
    5556/*
     
    6364
    6465        if ( !dirp )
    65           set_errno_and_return_minus_one( EBADF );
     66          rtems_set_errno_and_return_minus_one( EBADF );
    6667
    6768        fd = dirp->dd_fd;
  • cpukit/libcsupport/src/eval.c

    rb72e368c ra02224e  
    2020#include <rtems.h>
    2121#include <rtems/libio_.h>
     22#include <rtems/seterr.h>
    2223
    2324int rtems_filesystem_evaluate_path(
     
    3738
    3839  if ( !pathname )
    39     set_errno_and_return_minus_one( EFAULT );
     40    rtems_set_errno_and_return_minus_one( EFAULT );
    4041
    4142  if ( !pathloc )
    42     set_errno_and_return_minus_one( EIO );       /* should never happen */
     43    rtems_set_errno_and_return_minus_one( EIO );       /* should never happen */
    4344 
    4445  /*
     
    4950
    5051  if ( !pathloc->ops->evalpath_h )
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253
    5354  result = (*pathloc->ops->evalpath_h)( &pathname[i], flags, pathloc );
     
    6162
    6263    if ( !pathloc->ops->node_type_h )
    63       set_errno_and_return_minus_one( ENOTSUP );
     64      rtems_set_errno_and_return_minus_one( ENOTSUP );
    6465
    6566    type = (*pathloc->ops->node_type_h)( pathloc );
     
    6970
    7071        if ( !pathloc->ops->eval_link_h )
    71           set_errno_and_return_minus_one( ENOTSUP );
     72          rtems_set_errno_and_return_minus_one( ENOTSUP );
    7273
    7374         result =  (*pathloc->ops->eval_link_h)( pathloc, flags );
  • cpukit/libcsupport/src/fchdir.c

    rb72e368c ra02224e  
    2323#include <rtems/libio.h>
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int fchdir(
     
    4546
    4647  if ( !iop->pathinfo.ops ) {
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if ( !iop->pathinfo.ops->node_type_h ) {
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253  }
    5354
    5455  if (  (*iop->pathinfo.ops->node_type_h)( &iop->pathinfo ) !=
    5556                                          RTEMS_FILESYSTEM_DIRECTORY ) {
    56     set_errno_and_return_minus_one( ENOTDIR );
     57    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5758  }
    5859 
  • cpukit/libcsupport/src/fchmod.c

    rb72e368c ra02224e  
    2323#include <rtems/libio.h>
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int fchmod(
     
    4243
    4344  if ( !iop->handlers->fchmod_h )
    44     set_errno_and_return_minus_one( ENOTSUP );
     45    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4546
    4647  return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode );
  • cpukit/libcsupport/src/fdatasync.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int fdatasync(
     
    3637
    3738  if ( !iop->handlers->fdatasync_h )
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940
    4041  return (*iop->handlers->fdatasync_h)( iop );
  • cpukit/libcsupport/src/fpathconf.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021#include <unistd.h>
     
    7980      break;
    8081    default:
    81       set_errno_and_return_minus_one( EINVAL );
     82      rtems_set_errno_and_return_minus_one( EINVAL );
    8283      break;
    8384  }
  • cpukit/libcsupport/src/fstat.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int fstat(
     
    3435
    3536  if ( !sbuf )
    36     set_errno_and_return_minus_one( EFAULT );
     37    rtems_set_errno_and_return_minus_one( EFAULT );
    3738
    3839  /*
     
    4546
    4647  if ( !iop->handlers )
    47     set_errno_and_return_minus_one( EBADF );
     48    rtems_set_errno_and_return_minus_one( EBADF );
    4849
    4950  if ( !iop->handlers->fstat_h )
    50     set_errno_and_return_minus_one( ENOTSUP );
     51    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5152
    5253  /*
  • cpukit/libcsupport/src/fsync.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int fsync(
     
    3637
    3738  if ( !iop->handlers )
    38     set_errno_and_return_minus_one( EBADF );
     39    rtems_set_errno_and_return_minus_one( EBADF );
    3940
    4041  if ( !iop->handlers->fsync_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  return (*iop->handlers->fsync_h)( iop );
  • cpukit/libcsupport/src/ftruncate.c

    rb72e368c ra02224e  
    2020
    2121#include <rtems/libio_.h>
     22#include <rtems/seterr.h>
    2223
    2324int ftruncate(
     
    4344  loc = iop->pathinfo;
    4445  if ( !loc.ops->node_type_h )
    45     set_errno_and_return_minus_one( ENOTSUP );
     46    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4647   
    4748  if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY )
    48     set_errno_and_return_minus_one( EISDIR );
     49    rtems_set_errno_and_return_minus_one( EISDIR );
    4950
    5051  rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
    5152
    5253  if ( !iop->handlers->ftruncate_h )
    53     set_errno_and_return_minus_one( ENOTSUP );
     54    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5455
    5556  return (*iop->handlers->ftruncate_h)( iop, length );
  • cpukit/libcsupport/src/getdents.c

    rb72e368c ra02224e  
    2525
    2626#include <rtems/libio_.h>
     27#include <rtems/seterr.h>
    2728
    2829int getdents(
     
    4647  loc = iop->pathinfo;
    4748  if ( !loc.ops->node_type_h )
    48     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4950   
    5051  if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY )
    51     set_errno_and_return_minus_one( ENOTDIR );
     52    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5253
    5354  /*
     
    5758
    5859  if ( !iop->handlers->read_h )
    59     set_errno_and_return_minus_one( ENOTSUP );
     60    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6061
    6162  return (*iop->handlers->read_h)( iop, dd_buf, dd_len  );
  • cpukit/libcsupport/src/ioctl.c

    rb72e368c ra02224e  
    1919#endif
    2020
     21#include <stdarg.h>
     22
    2123#include <rtems/libio_.h>
     24#include <rtems/seterr.h>
    2225
    2326#include <unistd.h>
     
    4750
    4851  if ( !iop->handlers )
    49     set_errno_and_return_minus_one( EBADF );
     52    rtems_set_errno_and_return_minus_one( EBADF );
    5053
    5154  if ( !iop->handlers->ioctl_h )
    52     set_errno_and_return_minus_one( ENOTSUP );
     55    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5356
    5457  rc = (*iop->handlers->ioctl_h)( iop, command, buffer );
  • cpukit/libcsupport/src/link.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int link(
     
    4950  if ( !parent_loc.ops->evalformake_h ) {
    5051    rtems_filesystem_freenode( &existing_loc );
    51     set_errno_and_return_minus_one( ENOTSUP );
     52    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5253  }
    5354
     
    5556  if ( result != 0 ) {
    5657    rtems_filesystem_freenode( &existing_loc );
    57     set_errno_and_return_minus_one( result );
     58    rtems_set_errno_and_return_minus_one( result );
    5859  }
    5960
     
    6667    rtems_filesystem_freenode( &existing_loc );
    6768    rtems_filesystem_freenode( &parent_loc );
    68     set_errno_and_return_minus_one( EXDEV );
     69    rtems_set_errno_and_return_minus_one( EXDEV );
    6970  }
    7071
     
    7273    rtems_filesystem_freenode( &existing_loc );
    7374    rtems_filesystem_freenode( &parent_loc );
    74     set_errno_and_return_minus_one( ENOTSUP );
     75    rtems_set_errno_and_return_minus_one( ENOTSUP );
    7576  }
    7677
  • cpukit/libcsupport/src/lseek.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223off_t lseek(
     
    3940
    4041  if ( !iop->handlers->lseek_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  /*
     
    6061
    6162    default:
    62       set_errno_and_return_minus_one( EINVAL );
     63      rtems_set_errno_and_return_minus_one( EINVAL );
    6364  }
    6465
  • cpukit/libcsupport/src/mknod.c

    rb72e368c ra02224e  
    2828
    2929#include <rtems/libio_.h>
     30#include <rtems/seterr.h>
    3031
    3132int mknod(
     
    4142
    4243  if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
    43     set_errno_and_return_minus_one( EINVAL );
     44    rtems_set_errno_and_return_minus_one( EINVAL );
    4445 
    4546  if ( S_ISFIFO(mode) )
    46     set_errno_and_return_minus_one( ENOTSUP );
     47    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4748
    4849  rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
     
    5051  if ( !temp_loc.ops->evalformake_h ) {
    5152    rtems_filesystem_freenode( &temp_loc );
    52     set_errno_and_return_minus_one( ENOTSUP );
     53    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5354  }
    5455
     
    6364  if ( !temp_loc.ops->mknod_h ) {
    6465    rtems_filesystem_freenode( &temp_loc );
    65     set_errno_and_return_minus_one( ENOTSUP );
     66    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6667  }
    6768
  • cpukit/libcsupport/src/open.c

    rb72e368c ra02224e  
    1616#endif
    1717
     18#include <stdarg.h>
     19#include <fcntl.h>
    1820#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    1922
    2023#include <unistd.h>
     
    185188    if ( loc_to_free )
    186189      rtems_filesystem_freenode( loc_to_free );
    187     set_errno_and_return_minus_one( rc );
     190    rtems_set_errno_and_return_minus_one( rc );
    188191  }
    189192
  • cpukit/libcsupport/src/read.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021ssize_t read(
     
    3940
    4041  if ( !iop->handlers->read_h )
    41     set_errno_and_return_minus_one( ENOTSUP );
     42    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4243
    4344  rc = (*iop->handlers->read_h)( iop, buffer, count );
  • cpukit/libcsupport/src/readlink.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021int readlink(
     
    2829
    2930  if (!buf)
    30     set_errno_and_return_minus_one( EFAULT );
     31    rtems_set_errno_and_return_minus_one( EFAULT );
    3132
    3233  result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE );
     
    3637  if ( !loc.ops->node_type_h ){
    3738    rtems_filesystem_freenode( &loc );
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940  }
    4041
    4142  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){
    4243    rtems_filesystem_freenode( &loc );
    43     set_errno_and_return_minus_one( EINVAL );
     44    rtems_set_errno_and_return_minus_one( EINVAL );
    4445  }
    4546
    4647  if ( !loc.ops->readlink_h ){
    4748    rtems_filesystem_freenode( &loc );
    48     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4950  }
    5051
  • cpukit/libcsupport/src/rmdir.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
     25#include <rtems/seterr.h>
    2526
    2627int rmdir(
     
    4546  if ( !loc.ops->node_type_h ){
    4647    rtems_filesystem_freenode( &loc );
    47     set_errno_and_return_minus_one( ENOTSUP );
     48    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4849  }
    4950
    5051  if (  (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
    5152    rtems_filesystem_freenode( &loc );
    52     set_errno_and_return_minus_one( ENOTDIR );
     53    rtems_set_errno_and_return_minus_one( ENOTDIR );
    5354  }
    5455
     
    5960  if ( !loc.handlers->rmnod_h ){
    6061    rtems_filesystem_freenode( &loc );
    61     set_errno_and_return_minus_one( ENOTSUP );
     62    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6263  }
    6364
  • cpukit/libcsupport/src/stat.c

    rb72e368c ra02224e  
    4242
    4343#include <rtems/libio_.h>
     44#include <rtems/seterr.h>
    4445
    4546int _STAT_NAME(
     
    5657
    5758  if ( !buf )
    58     set_errno_and_return_minus_one( EFAULT );
     59    rtems_set_errno_and_return_minus_one( EFAULT );
    5960
    6061  status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
     
    6465  if ( !loc.handlers->fstat_h ){
    6566    rtems_filesystem_freenode( &loc );
    66     set_errno_and_return_minus_one( ENOTSUP );
     67    rtems_set_errno_and_return_minus_one( ENOTSUP );
    6768  }
    6869
  • cpukit/libcsupport/src/symlink.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
     19#include <rtems/seterr.h>
    1920
    2021int symlink(
     
    3536  if ( !loc.ops->symlink_h ) {
    3637    rtems_filesystem_freenode( &loc );
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  }
    3940
  • cpukit/libcsupport/src/tcsetattr.c

    rb72e368c ra02224e  
    2727#include <rtems/libio.h>
    2828#include <rtems/libio_.h>
     29#include <rtems/seterr.h>
    2930
    3031int tcsetattr(
     
    3637  switch (opt) {
    3738  default:
    38     set_errno_and_return_minus_one( ENOTSUP );
     39    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3940
    4041  case TCSADRAIN:
  • cpukit/libcsupport/src/telldir.c

    rb72e368c ra02224e  
    2323
    2424#include <rtems/libio_.h>
    25 
     25#include <rtems/seterr.h>
    2626
    2727long telldir(
     
    3232
    3333  if ( !dirp )
    34     set_errno_and_return_minus_one( EBADF );
     34    rtems_set_errno_and_return_minus_one( EBADF );
    3535
    3636  /*
  • cpukit/libcsupport/src/ttyname.c

    rb72e368c ra02224e  
    2020
    2121#include <rtems/libio_.h>
    22 
     22#include <rtems/seterr.h>
    2323
    2424int ttyname_r(
     
    3737  /* Must be a terminal. */
    3838  if (tcgetattr (fd, &tty) < 0)
    39     set_errno_and_return_minus_one(EBADF);
     39    rtems_set_errno_and_return_minus_one(EBADF);
    4040
    4141  /* Must be a character device. */
    4242  if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    43     set_errno_and_return_minus_one(EBADF);
     43    rtems_set_errno_and_return_minus_one(EBADF);
    4444
    4545  if ((dp = opendir (_PATH_DEV)) == NULL)
    46     set_errno_and_return_minus_one(EBADF);
     46    rtems_set_errno_and_return_minus_one(EBADF);
    4747
    4848  for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
  • cpukit/libcsupport/src/ttyname_r.c

    rb72e368c ra02224e  
    5656
    5757#include <rtems/libio_.h>
     58#include <rtems/seterr.h>
    5859
    5960/*
     
    7677  /* Must be a terminal. */
    7778  if (tcgetattr (fd, &tty) < 0)
    78     set_errno_and_return_minus_one(EBADF);
     79    rtems_set_errno_and_return_minus_one(EBADF);
    7980
    8081  /* Must be a character device. */
    8182  if (_fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
    82     set_errno_and_return_minus_one(EBADF);
     83    rtems_set_errno_and_return_minus_one(EBADF);
    8384
    8485  if ((dp = opendir (_PATH_DEV)) == NULL)
    85     set_errno_and_return_minus_one(EBADF);
     86    rtems_set_errno_and_return_minus_one(EBADF);
    8687
    8788  for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
  • cpukit/libcsupport/src/unlink.c

    rb72e368c ra02224e  
    1919
    2020#include <rtems/libio_.h>
     21#include <rtems/seterr.h>
    2122
    2223int unlink(
     
    3738  if ( !loc.ops->node_type_h ) {
    3839    rtems_filesystem_freenode( &loc );
    39     set_errno_and_return_minus_one( ENOTSUP );
     40    rtems_set_errno_and_return_minus_one( ENOTSUP );
    4041  }
    4142
    4243  if (  (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) {
    4344    rtems_filesystem_freenode( &loc );
    44     set_errno_and_return_minus_one( EISDIR );
     45    rtems_set_errno_and_return_minus_one( EISDIR );
    4546  }
    4647
    4748  if ( !loc.ops->unlink_h ) {
    4849    rtems_filesystem_freenode( &loc );
    49     set_errno_and_return_minus_one( ENOTSUP );
     50    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5051  }
    5152
  • cpukit/libcsupport/src/unmount.c

    rb72e368c ra02224e  
    3232
    3333#include <rtems/libio_.h>
     34#include <rtems/seterr.h>
    3435
    3536/*
     
    126127  if ( !rtems_filesystem_nodes_equal( fs_root_loc, &loc) ){
    127128    rtems_filesystem_freenode( &loc );
    128     set_errno_and_return_minus_one( EACCES );
     129    rtems_set_errno_and_return_minus_one( EACCES );
    129130  }
    130131
     
    140141
    141142  if ( !fs_mount_loc->ops->unmount_h )
    142     set_errno_and_return_minus_one( ENOTSUP );
     143    rtems_set_errno_and_return_minus_one( ENOTSUP );
    143144
    144145  if ( !fs_root_loc->ops->fsunmount_me_h )
    145     set_errno_and_return_minus_one( ENOTSUP );
     146    rtems_set_errno_and_return_minus_one( ENOTSUP );
    146147
    147148
     
    155156
    156157  if ( rtems_filesystem_current.mt_entry == mt_entry )
    157     set_errno_and_return_minus_one( EBUSY );
     158    rtems_set_errno_and_return_minus_one( EBUSY );
    158159
    159160  /*
     
    162163
    163164  if ( file_systems_below_this_mountpoint( path, fs_root_loc, mt_entry ) != 0 )
    164     set_errno_and_return_minus_one( EBUSY );
     165    rtems_set_errno_and_return_minus_one( EBUSY );
    165166
    166167  /*
     
    171172
    172173  if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 )
    173     set_errno_and_return_minus_one( EBUSY );
     174    rtems_set_errno_and_return_minus_one( EBUSY );
    174175 
    175176  /*
  • cpukit/libcsupport/src/utime.c

    rb72e368c ra02224e  
    2121
    2222#include <rtems/libio_.h>
     23#include <rtems/seterr.h>
    2324
    2425int utime(
     
    3536  if ( !temp_loc.ops->utime_h ){
    3637    rtems_filesystem_freenode( &temp_loc );
    37     set_errno_and_return_minus_one( ENOTSUP );
     38    rtems_set_errno_and_return_minus_one( ENOTSUP );
    3839  }
    3940
  • cpukit/libcsupport/src/write.c

    rb72e368c ra02224e  
    1717
    1818#include <rtems/libio_.h>
    19 
     19#include <rtems/seterr.h>
    2020
    2121/*
     
    4747
    4848  if ( !iop->handlers->write_h )
    49     set_errno_and_return_minus_one( ENOTSUP );
     49    rtems_set_errno_and_return_minus_one( ENOTSUP );
    5050
    5151  rc = (*iop->handlers->write_h)( iop, buffer, count );
Note: See TracChangeset for help on using the changeset viewer.