summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2002-01-04 18:29:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2002-01-04 18:29:37 +0000
commita02224e0e646c750c3fbd477d9d20e8560f06d3b (patch)
tree114e02b4e36821d86554f04899604abe92fcfaf4 /cpukit
parentb72e368c350737f8cafa21380744ce4e324e651a (diff)
downloadrtems-a02224e0e646c750c3fbd477d9d20e8560f06d3b.tar.bz2
2002-01-04 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* 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.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libcsupport/include/rtems/libio_.h14
-rw-r--r--cpukit/libcsupport/src/cfsetispeed.c3
-rw-r--r--cpukit/libcsupport/src/cfsetospeed.c3
-rw-r--r--cpukit/libcsupport/src/chdir.c5
-rw-r--r--cpukit/libcsupport/src/chmod.c5
-rw-r--r--cpukit/libcsupport/src/chown.c3
-rw-r--r--cpukit/libcsupport/src/chroot.c5
-rw-r--r--cpukit/libcsupport/src/closedir.c3
-rw-r--r--cpukit/libcsupport/src/eval.c11
-rw-r--r--cpukit/libcsupport/src/fchdir.c7
-rw-r--r--cpukit/libcsupport/src/fchmod.c3
-rw-r--r--cpukit/libcsupport/src/fdatasync.c3
-rw-r--r--cpukit/libcsupport/src/fpathconf.c3
-rw-r--r--cpukit/libcsupport/src/fstat.c7
-rw-r--r--cpukit/libcsupport/src/fsync.c5
-rw-r--r--cpukit/libcsupport/src/ftruncate.c7
-rw-r--r--cpukit/libcsupport/src/getdents.c7
-rw-r--r--cpukit/libcsupport/src/ioctl.c7
-rw-r--r--cpukit/libcsupport/src/link.c9
-rw-r--r--cpukit/libcsupport/src/lseek.c5
-rw-r--r--cpukit/libcsupport/src/mknod.c9
-rw-r--r--cpukit/libcsupport/src/open.c5
-rw-r--r--cpukit/libcsupport/src/read.c3
-rw-r--r--cpukit/libcsupport/src/readlink.c9
-rw-r--r--cpukit/libcsupport/src/rmdir.c7
-rw-r--r--cpukit/libcsupport/src/stat.c5
-rw-r--r--cpukit/libcsupport/src/symlink.c3
-rw-r--r--cpukit/libcsupport/src/tcsetattr.c3
-rw-r--r--cpukit/libcsupport/src/telldir.c4
-rw-r--r--cpukit/libcsupport/src/ttyname.c8
-rw-r--r--cpukit/libcsupport/src/ttyname_r.c7
-rw-r--r--cpukit/libcsupport/src/unlink.c7
-rw-r--r--cpukit/libcsupport/src/unmount.c13
-rw-r--r--cpukit/libcsupport/src/utime.c3
-rw-r--r--cpukit/libcsupport/src/write.c4
35 files changed, 114 insertions, 91 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index 6a4943be75..3b11441518 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -68,17 +68,6 @@ extern rtems_libio_t *rtems_libio_last_iop;
extern rtems_libio_t *rtems_libio_iop_freelist;
/*
- * set_errno_and_return_minus_one
- *
- * Macro to ease common way to return an error.
- */
-
-#ifndef set_errno_and_return_minus_one
-#define set_errno_and_return_minus_one( _error ) \
- do { errno = (_error); return -1; } while(0)
-#endif
-
-/*
* rtems_libio_iop
*
* Macro to return the file descriptor pointer.
@@ -152,7 +141,7 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
#define rtems_libio_check_permissions(_iop, _flag) \
do { \
if (((_iop)->flags & (_flag)) == 0) { \
- set_errno_and_return_minus_one( EINVAL ); \
+ rtems_set_errno_and_return_minus_one( EINVAL ); \
return -1; \
} \
} while (0)
@@ -251,7 +240,6 @@ extern rtems_user_env_t rtems_global_user_env;
#define _POSIX_types_Egid (rtems_current_user_env->egid)
#define _POSIX_types_Getlogin_buffer (rtems_current_user_env->login_buffer)
-
/*
* Instantiate a private copy of the per user information for the calling task.
*/
diff --git a/cpukit/libcsupport/src/cfsetispeed.c b/cpukit/libcsupport/src/cfsetispeed.c
index c26a7075e1..0298340848 100644
--- a/cpukit/libcsupport/src/cfsetispeed.c
+++ b/cpukit/libcsupport/src/cfsetispeed.c
@@ -24,6 +24,7 @@
#include <termios.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int cfsetispeed(
struct termios *tp,
@@ -31,7 +32,7 @@ int cfsetispeed(
)
{
if ( speed & ~CBAUD )
- set_errno_and_return_minus_one( EINVAL );
+ rtems_set_errno_and_return_minus_one( EINVAL );
tp->c_cflag = (tp->c_cflag & ~CIBAUD) | (speed * (CIBAUD / CBAUD));
return 0;
diff --git a/cpukit/libcsupport/src/cfsetospeed.c b/cpukit/libcsupport/src/cfsetospeed.c
index 0d8a553353..20e1b11403 100644
--- a/cpukit/libcsupport/src/cfsetospeed.c
+++ b/cpukit/libcsupport/src/cfsetospeed.c
@@ -24,6 +24,7 @@
#include <termios.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int cfsetospeed(
struct termios *tp,
@@ -31,7 +32,7 @@ int cfsetospeed(
)
{
if ( speed & ~CBAUD )
- set_errno_and_return_minus_one( EINVAL );
+ rtems_set_errno_and_return_minus_one( EINVAL );
tp->c_cflag = (tp->c_cflag & ~CBAUD) | speed;
return 0;
diff --git a/cpukit/libcsupport/src/chdir.c b/cpukit/libcsupport/src/chdir.c
index a8322e91d0..07fca7610a 100644
--- a/cpukit/libcsupport/src/chdir.c
+++ b/cpukit/libcsupport/src/chdir.c
@@ -21,6 +21,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int chdir(
const char *pathname
@@ -44,12 +45,12 @@ int chdir(
if ( !loc.ops->node_type_h ) {
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ) {
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTDIR );
+ rtems_set_errno_and_return_minus_one( ENOTDIR );
}
rtems_filesystem_freenode( &rtems_filesystem_current );
diff --git a/cpukit/libcsupport/src/chmod.c b/cpukit/libcsupport/src/chmod.c
index f4f82a823c..5e62be0683 100644
--- a/cpukit/libcsupport/src/chmod.c
+++ b/cpukit/libcsupport/src/chmod.c
@@ -23,6 +23,7 @@
#include <unistd.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int chmod(
const char *path,
@@ -39,12 +40,12 @@ int chmod(
if ( !loc.handlers ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( EBADF );
+ rtems_set_errno_and_return_minus_one( EBADF );
}
if ( !loc.handlers->fchmod_h ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*loc.handlers->fchmod_h)( &loc, mode );
diff --git a/cpukit/libcsupport/src/chown.c b/cpukit/libcsupport/src/chown.c
index 78a22ec17b..c860ace76e 100644
--- a/cpukit/libcsupport/src/chown.c
+++ b/cpukit/libcsupport/src/chown.c
@@ -22,6 +22,7 @@
#include <rtems/libio.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int chown(
const char *path,
@@ -37,7 +38,7 @@ int chown(
if ( !loc.ops->chown_h ) {
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*loc.ops->chown_h)( &loc, owner, group );
diff --git a/cpukit/libcsupport/src/chroot.c b/cpukit/libcsupport/src/chroot.c
index a7645943b4..95124a43c0 100644
--- a/cpukit/libcsupport/src/chroot.c
+++ b/cpukit/libcsupport/src/chroot.c
@@ -22,6 +22,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int chroot(
const char *pathname
@@ -34,7 +35,7 @@ int chroot(
if (rtems_current_user_env == &rtems_global_user_env) {
rtems_libio_set_private_env(); /* try to set a new private env*/
if (rtems_current_user_env == &rtems_global_user_env) /* not ok */
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
};
loc = rtems_filesystem_root; /* save the value */
@@ -42,7 +43,7 @@ int chroot(
result = chdir(pathname);
if (result) {
rtems_filesystem_root = loc; /* restore the value */
- set_errno_and_return_minus_one( errno );
+ rtems_set_errno_and_return_minus_one( errno );
};
rtems_filesystem_root = rtems_filesystem_current;
diff --git a/cpukit/libcsupport/src/closedir.c b/cpukit/libcsupport/src/closedir.c
index 0d58f0e64f..64562264ec 100644
--- a/cpukit/libcsupport/src/closedir.c
+++ b/cpukit/libcsupport/src/closedir.c
@@ -51,6 +51,7 @@ static char sccsid[] = "@(#)closedir.c 5.9 (Berkeley) 2/23/91";
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
/*
* close a directory.
@@ -62,7 +63,7 @@ closedir(dirp)
int fd;
if ( !dirp )
- set_errno_and_return_minus_one( EBADF );
+ rtems_set_errno_and_return_minus_one( EBADF );
fd = dirp->dd_fd;
dirp->dd_fd = -1;
diff --git a/cpukit/libcsupport/src/eval.c b/cpukit/libcsupport/src/eval.c
index 13ae2b6d76..7d70d20cf7 100644
--- a/cpukit/libcsupport/src/eval.c
+++ b/cpukit/libcsupport/src/eval.c
@@ -19,6 +19,7 @@
#include <rtems.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int rtems_filesystem_evaluate_path(
const char *pathname,
@@ -36,10 +37,10 @@ int rtems_filesystem_evaluate_path(
*/
if ( !pathname )
- set_errno_and_return_minus_one( EFAULT );
+ rtems_set_errno_and_return_minus_one( EFAULT );
if ( !pathloc )
- set_errno_and_return_minus_one( EIO ); /* should never happen */
+ rtems_set_errno_and_return_minus_one( EIO ); /* should never happen */
/*
* Evaluate the path using the optable evalpath.
@@ -48,7 +49,7 @@ int rtems_filesystem_evaluate_path(
rtems_filesystem_get_start_loc( pathname, &i, pathloc );
if ( !pathloc->ops->evalpath_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
result = (*pathloc->ops->evalpath_h)( &pathname[i], flags, pathloc );
@@ -60,7 +61,7 @@ int rtems_filesystem_evaluate_path(
if ( (result == 0) && follow_link ) {
if ( !pathloc->ops->node_type_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
type = (*pathloc->ops->node_type_h)( pathloc );
@@ -68,7 +69,7 @@ int rtems_filesystem_evaluate_path(
( type == RTEMS_FILESYSTEM_SYM_LINK ) ) {
if ( !pathloc->ops->eval_link_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
result = (*pathloc->ops->eval_link_h)( pathloc, flags );
diff --git a/cpukit/libcsupport/src/fchdir.c b/cpukit/libcsupport/src/fchdir.c
index ecef51950c..7c984bc892 100644
--- a/cpukit/libcsupport/src/fchdir.c
+++ b/cpukit/libcsupport/src/fchdir.c
@@ -22,6 +22,7 @@
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int fchdir(
int fd
@@ -44,16 +45,16 @@ int fchdir(
*/
if ( !iop->pathinfo.ops ) {
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
if ( !iop->pathinfo.ops->node_type_h ) {
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
if ( (*iop->pathinfo.ops->node_type_h)( &iop->pathinfo ) !=
RTEMS_FILESYSTEM_DIRECTORY ) {
- set_errno_and_return_minus_one( ENOTDIR );
+ rtems_set_errno_and_return_minus_one( ENOTDIR );
}
rtems_filesystem_freenode( &rtems_filesystem_current );
diff --git a/cpukit/libcsupport/src/fchmod.c b/cpukit/libcsupport/src/fchmod.c
index 989b3ba991..70b58a0998 100644
--- a/cpukit/libcsupport/src/fchmod.c
+++ b/cpukit/libcsupport/src/fchmod.c
@@ -22,6 +22,7 @@
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int fchmod(
int fd,
@@ -41,7 +42,7 @@ int fchmod(
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
if ( !iop->handlers->fchmod_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
return (*iop->pathinfo.handlers->fchmod_h)( &iop->pathinfo, mode );
}
diff --git a/cpukit/libcsupport/src/fdatasync.c b/cpukit/libcsupport/src/fdatasync.c
index 55f26401b2..ca27f996aa 100644
--- a/cpukit/libcsupport/src/fdatasync.c
+++ b/cpukit/libcsupport/src/fdatasync.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int fdatasync(
int fd
@@ -35,7 +36,7 @@ int fdatasync(
*/
if ( !iop->handlers->fdatasync_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
return (*iop->handlers->fdatasync_h)( iop );
}
diff --git a/cpukit/libcsupport/src/fpathconf.c b/cpukit/libcsupport/src/fpathconf.c
index 063baff38a..ac65db000b 100644
--- a/cpukit/libcsupport/src/fpathconf.c
+++ b/cpukit/libcsupport/src/fpathconf.c
@@ -16,6 +16,7 @@
#endif
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
#include <unistd.h>
#include <errno.h>
@@ -78,7 +79,7 @@ long fpathconf(
return_value = the_limits->posix_sync_io;
break;
default:
- set_errno_and_return_minus_one( EINVAL );
+ rtems_set_errno_and_return_minus_one( EINVAL );
break;
}
diff --git a/cpukit/libcsupport/src/fstat.c b/cpukit/libcsupport/src/fstat.c
index bdc994253d..22b1f8c412 100644
--- a/cpukit/libcsupport/src/fstat.c
+++ b/cpukit/libcsupport/src/fstat.c
@@ -20,6 +20,7 @@
#include <string.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int fstat(
int fd,
@@ -33,7 +34,7 @@ int fstat(
*/
if ( !sbuf )
- set_errno_and_return_minus_one( EFAULT );
+ rtems_set_errno_and_return_minus_one( EFAULT );
/*
* Now process the stat() request.
@@ -44,10 +45,10 @@ int fstat(
rtems_libio_check_is_open(iop);
if ( !iop->handlers )
- set_errno_and_return_minus_one( EBADF );
+ rtems_set_errno_and_return_minus_one( EBADF );
if ( !iop->handlers->fstat_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
/*
* Zero out the stat structure so the various support
diff --git a/cpukit/libcsupport/src/fsync.c b/cpukit/libcsupport/src/fsync.c
index f02f84414b..56ef546f83 100644
--- a/cpukit/libcsupport/src/fsync.c
+++ b/cpukit/libcsupport/src/fsync.c
@@ -18,6 +18,7 @@
#include <unistd.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int fsync(
int fd
@@ -35,10 +36,10 @@ int fsync(
*/
if ( !iop->handlers )
- set_errno_and_return_minus_one( EBADF );
+ rtems_set_errno_and_return_minus_one( EBADF );
if ( !iop->handlers->fsync_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
return (*iop->handlers->fsync_h)( iop );
}
diff --git a/cpukit/libcsupport/src/ftruncate.c b/cpukit/libcsupport/src/ftruncate.c
index 22ce26faf5..4f1cb79d93 100644
--- a/cpukit/libcsupport/src/ftruncate.c
+++ b/cpukit/libcsupport/src/ftruncate.c
@@ -19,6 +19,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int ftruncate(
int fd,
@@ -42,15 +43,15 @@ int ftruncate(
loc = iop->pathinfo;
if ( !loc.ops->node_type_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY )
- set_errno_and_return_minus_one( EISDIR );
+ rtems_set_errno_and_return_minus_one( EISDIR );
rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE );
if ( !iop->handlers->ftruncate_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
return (*iop->handlers->ftruncate_h)( iop, length );
}
diff --git a/cpukit/libcsupport/src/getdents.c b/cpukit/libcsupport/src/getdents.c
index 6523abfcd0..fe774fc2f2 100644
--- a/cpukit/libcsupport/src/getdents.c
+++ b/cpukit/libcsupport/src/getdents.c
@@ -24,6 +24,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int getdents(
int dd_fd,
@@ -45,10 +46,10 @@ int getdents(
*/
loc = iop->pathinfo;
if ( !loc.ops->node_type_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY )
- set_errno_and_return_minus_one( ENOTDIR );
+ rtems_set_errno_and_return_minus_one( ENOTDIR );
/*
* Return the number of bytes that were actually transfered as a result
@@ -56,7 +57,7 @@ int getdents(
*/
if ( !iop->handlers->read_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
return (*iop->handlers->read_h)( iop, dd_buf, dd_len );
}
diff --git a/cpukit/libcsupport/src/ioctl.c b/cpukit/libcsupport/src/ioctl.c
index 10def5e570..5527747cff 100644
--- a/cpukit/libcsupport/src/ioctl.c
+++ b/cpukit/libcsupport/src/ioctl.c
@@ -18,7 +18,10 @@
#include "config.h"
#endif
+#include <stdarg.h>
+
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
#include <unistd.h>
@@ -46,10 +49,10 @@ int ioctl(
*/
if ( !iop->handlers )
- set_errno_and_return_minus_one( EBADF );
+ rtems_set_errno_and_return_minus_one( EBADF );
if ( !iop->handlers->ioctl_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
rc = (*iop->handlers->ioctl_h)( iop, command, buffer );
diff --git a/cpukit/libcsupport/src/link.c b/cpukit/libcsupport/src/link.c
index 0797600849..6587f76fb5 100644
--- a/cpukit/libcsupport/src/link.c
+++ b/cpukit/libcsupport/src/link.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int link(
const char *existing,
@@ -48,13 +49,13 @@ int link(
if ( !parent_loc.ops->evalformake_h ) {
rtems_filesystem_freenode( &existing_loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*parent_loc.ops->evalformake_h)( &new[i], &parent_loc, &name_start );
if ( result != 0 ) {
rtems_filesystem_freenode( &existing_loc );
- set_errno_and_return_minus_one( result );
+ rtems_set_errno_and_return_minus_one( result );
}
/*
@@ -65,13 +66,13 @@ int link(
if ( parent_loc.mt_entry != existing_loc.mt_entry ) {
rtems_filesystem_freenode( &existing_loc );
rtems_filesystem_freenode( &parent_loc );
- set_errno_and_return_minus_one( EXDEV );
+ rtems_set_errno_and_return_minus_one( EXDEV );
}
if ( !parent_loc.ops->link_h ) {
rtems_filesystem_freenode( &existing_loc );
rtems_filesystem_freenode( &parent_loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*parent_loc.ops->link_h)( &existing_loc, &parent_loc, name_start );
diff --git a/cpukit/libcsupport/src/lseek.c b/cpukit/libcsupport/src/lseek.c
index af41116346..0a87a4997d 100644
--- a/cpukit/libcsupport/src/lseek.c
+++ b/cpukit/libcsupport/src/lseek.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
off_t lseek(
int fd,
@@ -38,7 +39,7 @@ off_t lseek(
*/
if ( !iop->handlers->lseek_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
/*
* Now process the lseek().
@@ -59,7 +60,7 @@ off_t lseek(
break;
default:
- set_errno_and_return_minus_one( EINVAL );
+ rtems_set_errno_and_return_minus_one( EINVAL );
}
/*
diff --git a/cpukit/libcsupport/src/mknod.c b/cpukit/libcsupport/src/mknod.c
index e725643be3..6110b90e1d 100644
--- a/cpukit/libcsupport/src/mknod.c
+++ b/cpukit/libcsupport/src/mknod.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int mknod(
const char *pathname,
@@ -40,16 +41,16 @@ int mknod(
int result;
if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
- set_errno_and_return_minus_one( EINVAL );
+ rtems_set_errno_and_return_minus_one( EINVAL );
if ( S_ISFIFO(mode) )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
rtems_filesystem_get_start_loc( pathname, &i, &temp_loc );
if ( !temp_loc.ops->evalformake_h ) {
rtems_filesystem_freenode( &temp_loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*temp_loc.ops->evalformake_h)(
@@ -62,7 +63,7 @@ int mknod(
if ( !temp_loc.ops->mknod_h ) {
rtems_filesystem_freenode( &temp_loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*temp_loc.ops->mknod_h)( name_start, mode, dev, &temp_loc );
diff --git a/cpukit/libcsupport/src/open.c b/cpukit/libcsupport/src/open.c
index 4bb2ce17ae..f36f74d4ac 100644
--- a/cpukit/libcsupport/src/open.c
+++ b/cpukit/libcsupport/src/open.c
@@ -15,7 +15,10 @@
#include "config.h"
#endif
+#include <stdarg.h>
+#include <fcntl.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
#include <unistd.h>
@@ -184,7 +187,7 @@ done:
rtems_libio_free( iop );
if ( loc_to_free )
rtems_filesystem_freenode( loc_to_free );
- set_errno_and_return_minus_one( rc );
+ rtems_set_errno_and_return_minus_one( rc );
}
return iop - rtems_libio_iops;
diff --git a/cpukit/libcsupport/src/read.c b/cpukit/libcsupport/src/read.c
index 0e478c47c3..421f967caf 100644
--- a/cpukit/libcsupport/src/read.c
+++ b/cpukit/libcsupport/src/read.c
@@ -16,6 +16,7 @@
#endif
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
ssize_t read(
int fd,
@@ -38,7 +39,7 @@ ssize_t read(
*/
if ( !iop->handlers->read_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
rc = (*iop->handlers->read_h)( iop, buffer, count );
diff --git a/cpukit/libcsupport/src/readlink.c b/cpukit/libcsupport/src/readlink.c
index 2419657e1e..2e2d897709 100644
--- a/cpukit/libcsupport/src/readlink.c
+++ b/cpukit/libcsupport/src/readlink.c
@@ -16,6 +16,7 @@
#endif
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int readlink(
const char *pathname,
@@ -27,7 +28,7 @@ int readlink(
int result;
if (!buf)
- set_errno_and_return_minus_one( EFAULT );
+ rtems_set_errno_and_return_minus_one( EFAULT );
result = rtems_filesystem_evaluate_path( pathname, 0, &loc, FALSE );
if ( result != 0 )
@@ -35,17 +36,17 @@ int readlink(
if ( !loc.ops->node_type_h ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_SYM_LINK ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( EINVAL );
+ rtems_set_errno_and_return_minus_one( EINVAL );
}
if ( !loc.ops->readlink_h ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*loc.ops->readlink_h)( &loc, buf, bufsize );
diff --git a/cpukit/libcsupport/src/rmdir.c b/cpukit/libcsupport/src/rmdir.c
index 1a7cdda537..b306894d06 100644
--- a/cpukit/libcsupport/src/rmdir.c
+++ b/cpukit/libcsupport/src/rmdir.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int rmdir(
const char *pathname
@@ -44,12 +45,12 @@ int rmdir(
if ( !loc.ops->node_type_h ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
if ( (*loc.ops->node_type_h)( &loc ) != RTEMS_FILESYSTEM_DIRECTORY ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTDIR );
+ rtems_set_errno_and_return_minus_one( ENOTDIR );
}
/*
@@ -58,7 +59,7 @@ int rmdir(
if ( !loc.handlers->rmnod_h ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*loc.handlers->rmnod_h)( &loc );
diff --git a/cpukit/libcsupport/src/stat.c b/cpukit/libcsupport/src/stat.c
index 872f55ca7c..60a098e929 100644
--- a/cpukit/libcsupport/src/stat.c
+++ b/cpukit/libcsupport/src/stat.c
@@ -41,6 +41,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int _STAT_NAME(
const char *path,
@@ -55,7 +56,7 @@ int _STAT_NAME(
*/
if ( !buf )
- set_errno_and_return_minus_one( EFAULT );
+ rtems_set_errno_and_return_minus_one( EFAULT );
status = rtems_filesystem_evaluate_path( path, 0, &loc, _STAT_FOLLOW_LINKS );
if ( status != 0 )
@@ -63,7 +64,7 @@ int _STAT_NAME(
if ( !loc.handlers->fstat_h ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
/*
diff --git a/cpukit/libcsupport/src/symlink.c b/cpukit/libcsupport/src/symlink.c
index 657b7c4728..8d5bb30bd5 100644
--- a/cpukit/libcsupport/src/symlink.c
+++ b/cpukit/libcsupport/src/symlink.c
@@ -16,6 +16,7 @@
#endif
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int symlink(
const char *actualpath,
@@ -34,7 +35,7 @@ int symlink(
if ( !loc.ops->symlink_h ) {
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*loc.ops->symlink_h)( &loc, actualpath, name_start);
diff --git a/cpukit/libcsupport/src/tcsetattr.c b/cpukit/libcsupport/src/tcsetattr.c
index f97a38d76b..f7a413c956 100644
--- a/cpukit/libcsupport/src/tcsetattr.c
+++ b/cpukit/libcsupport/src/tcsetattr.c
@@ -26,6 +26,7 @@
#include <rtems/libio.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int tcsetattr(
int fd,
@@ -35,7 +36,7 @@ int tcsetattr(
{
switch (opt) {
default:
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
case TCSADRAIN:
if (ioctl( fd, RTEMS_IO_TCDRAIN, NULL ) < 0)
diff --git a/cpukit/libcsupport/src/telldir.c b/cpukit/libcsupport/src/telldir.c
index 385b2f74f4..81c9606ebf 100644
--- a/cpukit/libcsupport/src/telldir.c
+++ b/cpukit/libcsupport/src/telldir.c
@@ -22,7 +22,7 @@
#include <errno.h>
#include <rtems/libio_.h>
-
+#include <rtems/seterr.h>
long telldir(
DIR *dirp
@@ -31,7 +31,7 @@ long telldir(
rtems_libio_t *iop;
if ( !dirp )
- set_errno_and_return_minus_one( EBADF );
+ rtems_set_errno_and_return_minus_one( EBADF );
/*
* Get the file control block structure associated with the
diff --git a/cpukit/libcsupport/src/ttyname.c b/cpukit/libcsupport/src/ttyname.c
index c649cf06ca..8a3a272ba5 100644
--- a/cpukit/libcsupport/src/ttyname.c
+++ b/cpukit/libcsupport/src/ttyname.c
@@ -19,7 +19,7 @@
#include <errno.h>
#include <rtems/libio_.h>
-
+#include <rtems/seterr.h>
int ttyname_r(
int fd,
@@ -36,14 +36,14 @@ int ttyname_r(
/* Must be a terminal. */
if (tcgetattr (fd, &tty) < 0)
- set_errno_and_return_minus_one(EBADF);
+ rtems_set_errno_and_return_minus_one(EBADF);
/* Must be a character device. */
if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
- set_errno_and_return_minus_one(EBADF);
+ rtems_set_errno_and_return_minus_one(EBADF);
if ((dp = opendir (_PATH_DEV)) == NULL)
- set_errno_and_return_minus_one(EBADF);
+ rtems_set_errno_and_return_minus_one(EBADF);
for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
{
diff --git a/cpukit/libcsupport/src/ttyname_r.c b/cpukit/libcsupport/src/ttyname_r.c
index 554fed6398..42c93a4696 100644
--- a/cpukit/libcsupport/src/ttyname_r.c
+++ b/cpukit/libcsupport/src/ttyname_r.c
@@ -55,6 +55,7 @@ static char sccsid[] = "@(#)ttyname.c 5.10 (Berkeley) 5/6/91";
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
/*
* ttyname_r() - POSIX 1003.1b 4.7.2 - Demetermine Terminal Device Name
@@ -75,14 +76,14 @@ int ttyname_r(
/* Must be a terminal. */
if (tcgetattr (fd, &tty) < 0)
- set_errno_and_return_minus_one(EBADF);
+ rtems_set_errno_and_return_minus_one(EBADF);
/* Must be a character device. */
if (_fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
- set_errno_and_return_minus_one(EBADF);
+ rtems_set_errno_and_return_minus_one(EBADF);
if ((dp = opendir (_PATH_DEV)) == NULL)
- set_errno_and_return_minus_one(EBADF);
+ rtems_set_errno_and_return_minus_one(EBADF);
for (rval = NULL; (dirp = readdir (dp)) != NULL ;)
{
diff --git a/cpukit/libcsupport/src/unlink.c b/cpukit/libcsupport/src/unlink.c
index d843d11893..09a68c9247 100644
--- a/cpukit/libcsupport/src/unlink.c
+++ b/cpukit/libcsupport/src/unlink.c
@@ -18,6 +18,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int unlink(
const char *path
@@ -36,17 +37,17 @@ int unlink(
if ( !loc.ops->node_type_h ) {
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
if ( (*loc.ops->node_type_h)( &loc ) == RTEMS_FILESYSTEM_DIRECTORY ) {
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( EISDIR );
+ rtems_set_errno_and_return_minus_one( EISDIR );
}
if ( !loc.ops->unlink_h ) {
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*loc.ops->unlink_h)( &loc );
diff --git a/cpukit/libcsupport/src/unmount.c b/cpukit/libcsupport/src/unmount.c
index fa5e71077d..9c2653378b 100644
--- a/cpukit/libcsupport/src/unmount.c
+++ b/cpukit/libcsupport/src/unmount.c
@@ -31,6 +31,7 @@
#include <assert.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
/*
* Data structures and routines private to mount/unmount pair.
@@ -125,7 +126,7 @@ int unmount(
if ( !rtems_filesystem_nodes_equal( fs_root_loc, &loc) ){
rtems_filesystem_freenode( &loc );
- set_errno_and_return_minus_one( EACCES );
+ rtems_set_errno_and_return_minus_one( EACCES );
}
/*
@@ -139,10 +140,10 @@ int unmount(
*/
if ( !fs_mount_loc->ops->unmount_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
if ( !fs_root_loc->ops->fsunmount_me_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
/*
@@ -154,14 +155,14 @@ int unmount(
*/
if ( rtems_filesystem_current.mt_entry == mt_entry )
- set_errno_and_return_minus_one( EBUSY );
+ rtems_set_errno_and_return_minus_one( EBUSY );
/*
* Verify there are no file systems below the path specified
*/
if ( file_systems_below_this_mountpoint( path, fs_root_loc, mt_entry ) != 0 )
- set_errno_and_return_minus_one( EBUSY );
+ rtems_set_errno_and_return_minus_one( EBUSY );
/*
* Run the file descriptor table to determine if there are any file
@@ -170,7 +171,7 @@ int unmount(
*/
if ( rtems_libio_is_open_files_in_fs( mt_entry ) == 1 )
- set_errno_and_return_minus_one( EBUSY );
+ rtems_set_errno_and_return_minus_one( EBUSY );
/*
* Allow the file system being unmounted on to do its cleanup.
diff --git a/cpukit/libcsupport/src/utime.c b/cpukit/libcsupport/src/utime.c
index ba9a50a63d..f176615231 100644
--- a/cpukit/libcsupport/src/utime.c
+++ b/cpukit/libcsupport/src/utime.c
@@ -20,6 +20,7 @@
#include <errno.h>
#include <rtems/libio_.h>
+#include <rtems/seterr.h>
int utime(
const char *path,
@@ -34,7 +35,7 @@ int utime(
if ( !temp_loc.ops->utime_h ){
rtems_filesystem_freenode( &temp_loc );
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
}
result = (*temp_loc.ops->utime_h)( &temp_loc, times->actime, times->modtime );
diff --git a/cpukit/libcsupport/src/write.c b/cpukit/libcsupport/src/write.c
index 71abc87813..697c4c59ec 100644
--- a/cpukit/libcsupport/src/write.c
+++ b/cpukit/libcsupport/src/write.c
@@ -16,7 +16,7 @@
#endif
#include <rtems/libio_.h>
-
+#include <rtems/seterr.h>
/*
* write
@@ -46,7 +46,7 @@ ssize_t write(
*/
if ( !iop->handlers->write_h )
- set_errno_and_return_minus_one( ENOTSUP );
+ rtems_set_errno_and_return_minus_one( ENOTSUP );
rc = (*iop->handlers->write_h)( iop, buffer, count );