forked from Imagelibrary/rtems
2001-01-25 Joel Sherrill <joel@OARcorp.com>
* cpu.c, rtems/score/cpu.h: Bug report from Peter Mueller <peter.o.mueller@gmx.de> because of not correcting for the ISR vector table now being allocated from the workspace.
This commit is contained in:
@@ -23,7 +23,7 @@ SYSTEM_CALL_C_FILES = open.c close.c read.c write.c lseek.c ioctl.c mkdir.c \
|
|||||||
mknod.c mkfifo.c rmdir.c chdir.c chmod.c fchdir.c fchmod.c chown.c \
|
mknod.c mkfifo.c rmdir.c chdir.c chmod.c fchdir.c fchmod.c chown.c \
|
||||||
link.c unlink.c umask.c ftruncate.c utime.c fstat.c fcntl.c fpathconf.c \
|
link.c unlink.c umask.c ftruncate.c utime.c fstat.c fcntl.c fpathconf.c \
|
||||||
getdents.c fsync.c fdatasync.c pipe.c dup.c dup2.c symlink.c readlink.c \
|
getdents.c fsync.c fdatasync.c pipe.c dup.c dup2.c symlink.c readlink.c \
|
||||||
creat.c
|
creat.c chroot.c
|
||||||
|
|
||||||
DIRECTORY_SCAN_C_FILES = opendir.c closedir.c readdir.c rewinddir.c \
|
DIRECTORY_SCAN_C_FILES = opendir.c closedir.c readdir.c rewinddir.c \
|
||||||
scandir.c seekdir.c telldir.c getcwd.c
|
scandir.c seekdir.c telldir.c getcwd.c
|
||||||
|
|||||||
59
c/src/exec/libcsupport/src/chroot.c
Normal file
59
c/src/exec/libcsupport/src/chroot.c
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* chroot() - Change Root Directory
|
||||||
|
* Author: fernando.ruiz@ctv.es
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1999.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <rtems/libio_.h>
|
||||||
|
|
||||||
|
int chroot(
|
||||||
|
const char *pathname
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
rtems_filesystem_location_info_t loc;
|
||||||
|
|
||||||
|
if (rtems_current_user_env == &rtems_global_user_env)
|
||||||
|
set_errno_and_return_minus_one( ENOTSUP );
|
||||||
|
|
||||||
|
loc = rtems_filesystem_root;i /* save the value */
|
||||||
|
|
||||||
|
/* if has been already changed */
|
||||||
|
rtems_filesystem_root = rtems_global_user_env.filesystem_root;
|
||||||
|
|
||||||
|
result = chdir(pathname);
|
||||||
|
if (result) {
|
||||||
|
rtems_filesystem_root = loc; /* restore the value */
|
||||||
|
set_errno_and_return_minus_one( errno );
|
||||||
|
};
|
||||||
|
rtems_filesystem_root = rtems_filesystem_current;
|
||||||
|
|
||||||
|
result = chdir("/");
|
||||||
|
if (result) {
|
||||||
|
rtems_filesystem_root = loc; /* restore the value */
|
||||||
|
set_errno_and_return_minus_one( errno );
|
||||||
|
};
|
||||||
|
|
||||||
|
/*XXX : Call this? Sorry but I don't known if it is necesary */
|
||||||
|
/* The old root.
|
||||||
|
rtems_filesystem_freenode( &loc );
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -1,4 +1,10 @@
|
|||||||
|
|
||||||
|
2001-01-25 Fernando Ruiz <fernando.ruiz@ctv.es>
|
||||||
|
|
||||||
|
* Alternate email is correo@fernando-ruiz.com
|
||||||
|
* libc/chroot.c: New file.
|
||||||
|
* libc/Makefile.am: Reflect above.
|
||||||
|
|
||||||
2001-01-25 Fernando Ruiz <fernando.ruiz@ctv.es>
|
2001-01-25 Fernando Ruiz <fernando.ruiz@ctv.es>
|
||||||
|
|
||||||
* Alternate email is correo@fernando-ruiz.com
|
* Alternate email is correo@fernando-ruiz.com
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ SYSTEM_CALL_C_FILES = open.c close.c read.c write.c lseek.c ioctl.c mkdir.c \
|
|||||||
mknod.c mkfifo.c rmdir.c chdir.c chmod.c fchdir.c fchmod.c chown.c \
|
mknod.c mkfifo.c rmdir.c chdir.c chmod.c fchdir.c fchmod.c chown.c \
|
||||||
link.c unlink.c umask.c ftruncate.c utime.c fstat.c fcntl.c fpathconf.c \
|
link.c unlink.c umask.c ftruncate.c utime.c fstat.c fcntl.c fpathconf.c \
|
||||||
getdents.c fsync.c fdatasync.c pipe.c dup.c dup2.c symlink.c readlink.c \
|
getdents.c fsync.c fdatasync.c pipe.c dup.c dup2.c symlink.c readlink.c \
|
||||||
creat.c
|
creat.c chroot.c
|
||||||
|
|
||||||
DIRECTORY_SCAN_C_FILES = opendir.c closedir.c readdir.c rewinddir.c \
|
DIRECTORY_SCAN_C_FILES = opendir.c closedir.c readdir.c rewinddir.c \
|
||||||
scandir.c seekdir.c telldir.c getcwd.c
|
scandir.c seekdir.c telldir.c getcwd.c
|
||||||
|
|||||||
59
c/src/lib/libc/chroot.c
Normal file
59
c/src/lib/libc/chroot.c
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* chroot() - Change Root Directory
|
||||||
|
* Author: fernando.ruiz@ctv.es
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1999.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <rtems/libio_.h>
|
||||||
|
|
||||||
|
int chroot(
|
||||||
|
const char *pathname
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
rtems_filesystem_location_info_t loc;
|
||||||
|
|
||||||
|
if (rtems_current_user_env == &rtems_global_user_env)
|
||||||
|
set_errno_and_return_minus_one( ENOTSUP );
|
||||||
|
|
||||||
|
loc = rtems_filesystem_root;i /* save the value */
|
||||||
|
|
||||||
|
/* if has been already changed */
|
||||||
|
rtems_filesystem_root = rtems_global_user_env.filesystem_root;
|
||||||
|
|
||||||
|
result = chdir(pathname);
|
||||||
|
if (result) {
|
||||||
|
rtems_filesystem_root = loc; /* restore the value */
|
||||||
|
set_errno_and_return_minus_one( errno );
|
||||||
|
};
|
||||||
|
rtems_filesystem_root = rtems_filesystem_current;
|
||||||
|
|
||||||
|
result = chdir("/");
|
||||||
|
if (result) {
|
||||||
|
rtems_filesystem_root = loc; /* restore the value */
|
||||||
|
set_errno_and_return_minus_one( errno );
|
||||||
|
};
|
||||||
|
|
||||||
|
/*XXX : Call this? Sorry but I don't known if it is necesary */
|
||||||
|
/* The old root.
|
||||||
|
rtems_filesystem_freenode( &loc );
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
59
cpukit/libcsupport/src/chroot.c
Normal file
59
cpukit/libcsupport/src/chroot.c
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* chroot() - Change Root Directory
|
||||||
|
* Author: fernando.ruiz@ctv.es
|
||||||
|
*
|
||||||
|
* COPYRIGHT (c) 1989-1999.
|
||||||
|
* On-Line Applications Research Corporation (OAR).
|
||||||
|
*
|
||||||
|
* The license and distribution terms for this file may be
|
||||||
|
* found in the file LICENSE in this distribution or at
|
||||||
|
* http://www.OARcorp.com/rtems/license.html.
|
||||||
|
*
|
||||||
|
* $Id$
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <rtems.h>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
|
#include <rtems/libio_.h>
|
||||||
|
|
||||||
|
int chroot(
|
||||||
|
const char *pathname
|
||||||
|
)
|
||||||
|
{
|
||||||
|
int result;
|
||||||
|
rtems_filesystem_location_info_t loc;
|
||||||
|
|
||||||
|
if (rtems_current_user_env == &rtems_global_user_env)
|
||||||
|
set_errno_and_return_minus_one( ENOTSUP );
|
||||||
|
|
||||||
|
loc = rtems_filesystem_root;i /* save the value */
|
||||||
|
|
||||||
|
/* if has been already changed */
|
||||||
|
rtems_filesystem_root = rtems_global_user_env.filesystem_root;
|
||||||
|
|
||||||
|
result = chdir(pathname);
|
||||||
|
if (result) {
|
||||||
|
rtems_filesystem_root = loc; /* restore the value */
|
||||||
|
set_errno_and_return_minus_one( errno );
|
||||||
|
};
|
||||||
|
rtems_filesystem_root = rtems_filesystem_current;
|
||||||
|
|
||||||
|
result = chdir("/");
|
||||||
|
if (result) {
|
||||||
|
rtems_filesystem_root = loc; /* restore the value */
|
||||||
|
set_errno_and_return_minus_one( errno );
|
||||||
|
};
|
||||||
|
|
||||||
|
/*XXX : Call this? Sorry but I don't known if it is necesary */
|
||||||
|
/* The old root.
|
||||||
|
rtems_filesystem_freenode( &loc );
|
||||||
|
*/
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user