2002-02-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>

* include/rtems/libio.h: Add #include <rtems/fs.h>.
	Reflect changes due to using rtems/fs.h.
	* include/rtems/libio_.h: Reworked.
This commit is contained in:
Joel Sherrill
2002-01-16 22:54:59 +00:00
parent 36a63d7859
commit d09ad1f0e0
7 changed files with 36 additions and 228 deletions

View File

@@ -28,15 +28,7 @@
* Define data types which must be constructed using forward references. * Define data types which must be constructed using forward references.
*/ */
typedef struct rtems_libio_tt rtems_libio_t; #include <rtems/fs.h>
struct rtems_filesystem_location_info_tt;
typedef struct rtems_filesystem_location_info_tt
rtems_filesystem_location_info_t;
struct rtems_filesystem_mount_table_entry_tt;
typedef struct rtems_filesystem_mount_table_entry_tt
rtems_filesystem_mount_table_entry_t;
/* /*
* Valid RTEMS file types. * Valid RTEMS file types.
@@ -125,7 +117,7 @@ typedef int (*rtems_filesystem_rmnod_t)(
rtems_filesystem_location_info_t *pathloc /* IN */ rtems_filesystem_location_info_t *pathloc /* IN */
); );
typedef struct { struct _rtems_filesystem_file_handlers_r {
rtems_filesystem_open_t open_h; rtems_filesystem_open_t open_h;
rtems_filesystem_close_t close_h; rtems_filesystem_close_t close_h;
rtems_filesystem_read_t read_h; rtems_filesystem_read_t read_h;
@@ -140,7 +132,7 @@ typedef struct {
rtems_filesystem_fdatasync_t fdatasync_h; rtems_filesystem_fdatasync_t fdatasync_h;
rtems_filesystem_fcntl_t fcntl_h; rtems_filesystem_fcntl_t fcntl_h;
rtems_filesystem_rmnod_t rmnod_h; rtems_filesystem_rmnod_t rmnod_h;
} rtems_filesystem_file_handlers_r; };
/* /*
* File System Operations Table * File System Operations Table
@@ -248,7 +240,7 @@ typedef int (*rtems_filesystem_readlink_t)(
/* /*
* File system types * File system types
*/ */
typedef struct { struct _rtems_filesystem_operations_table {
rtems_filesystem_evalpath_t evalpath_h; rtems_filesystem_evalpath_t evalpath_h;
rtems_filesystem_evalmake_t evalformake_h; rtems_filesystem_evalmake_t evalformake_h;
rtems_filesystem_link_t link_h; rtems_filesystem_link_t link_h;
@@ -265,7 +257,10 @@ typedef struct {
rtems_filesystem_evaluate_link_t eval_link_h; rtems_filesystem_evaluate_link_t eval_link_h;
rtems_filesystem_symlink_t symlink_h; rtems_filesystem_symlink_t symlink_h;
rtems_filesystem_readlink_t readlink_h; rtems_filesystem_readlink_t readlink_h;
} rtems_filesystem_operations_table; };
#if 0
/* Now in exec/include/rtems/fs.h */
/* /*
* Structure used to determine a location/filesystem in the tree. * Structure used to determine a location/filesystem in the tree.
@@ -278,6 +273,7 @@ struct rtems_filesystem_location_info_tt
rtems_filesystem_operations_table *ops; rtems_filesystem_operations_table *ops;
rtems_filesystem_mount_table_entry_t *mt_entry; rtems_filesystem_mount_table_entry_t *mt_entry;
}; };
#endif
/* /*
* Structure used to contain file system specific information which * Structure used to contain file system specific information which

View File

@@ -20,33 +20,10 @@ extern "C" {
#include <rtems.h> #include <rtems.h>
#include <rtems/libio.h> /* include before standard IO */ #include <rtems/libio.h> /* include before standard IO */
#include <rtems/assoc.h> /* assoc.h not included by rtems.h */
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> /* O_RDONLY, et.al. */
#include <fcntl.h> /* O_RDONLY, et.al. */
#include <assert.h>
#include <stdarg.h>
#include <limits.h>
#include <errno.h>
#if ! defined(O_NDELAY)
# if defined(solaris2)
# define O_NDELAY O_NONBLOCK
# elif defined(RTEMS_NEWLIB)
# define O_NDELAY _FNBIO
# endif
#endif
#if !defined(ENOTSUP)
#define ENOTSUP EOPNOTSUPP
#endif
#include <errno.h> #include <errno.h>
#include <string.h> /* strcmp */
#include <unistd.h>
#include <stdlib.h> /* calloc() */
/* /*
* Semaphore to protect the io table * Semaphore to protect the io table
@@ -201,45 +178,11 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
/* /*
* External structures * External structures
*/ */
#if !defined(LOGIN_NAME_MAX) #include <rtems/userenv.h>
#if defined(__linux__)
#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
#else
#error "don't know how to set LOGIN_NAME_MAX"
#endif
#endif
typedef struct {
rtems_id task_id;
rtems_filesystem_location_info_t current_directory;
rtems_filesystem_location_info_t root_directory;
/* Default mode for all files. */
mode_t umask;
nlink_t link_counts;
/* _POSIX_types */
uid_t uid;
gid_t gid;
uid_t euid;
gid_t egid;
char login_buffer[LOGIN_NAME_MAX];
pid_t pgrp; /* process group id */
} rtems_user_env_t;
extern rtems_user_env_t * rtems_current_user_env; extern rtems_user_env_t * rtems_current_user_env;
extern rtems_user_env_t rtems_global_user_env; extern rtems_user_env_t rtems_global_user_env;
#define rtems_filesystem_current (rtems_current_user_env->current_directory)
#define rtems_filesystem_root (rtems_current_user_env->root_directory)
#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
#define rtems_filesystem_umask (rtems_current_user_env->umask)
#define _POSIX_types_Uid (rtems_current_user_env->uid)
#define _POSIX_types_Gid (rtems_current_user_env->gid)
#define _POSIX_types_Euid (rtems_current_user_env->euid)
#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. * Instantiate a private copy of the per user information for the calling task.
*/ */
@@ -247,8 +190,6 @@ extern rtems_user_env_t rtems_global_user_env;
rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_set_private_env(void);
rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ;
/* /*
* File Descriptor Routine Prototypes * File Descriptor Routine Prototypes
*/ */
@@ -296,6 +237,3 @@ int init_fs_mount_table();
#endif #endif
/* end of include file */ /* end of include file */

View File

@@ -1,3 +1,9 @@
2002-02-09 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* include/rtems/libio.h: Add #include <rtems/fs.h>.
Reflect changes due to using rtems/fs.h.
* include/rtems/libio_.h: Reworked.
2002-02-07 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2002-02-07 Ralf Corsepius <corsepiu@faw.uni-ulm.de>
* libc/gxx_wrappers.c: Add #include <rtems/error.h>. * libc/gxx_wrappers.c: Add #include <rtems/error.h>.

View File

@@ -28,15 +28,7 @@
* Define data types which must be constructed using forward references. * Define data types which must be constructed using forward references.
*/ */
typedef struct rtems_libio_tt rtems_libio_t; #include <rtems/fs.h>
struct rtems_filesystem_location_info_tt;
typedef struct rtems_filesystem_location_info_tt
rtems_filesystem_location_info_t;
struct rtems_filesystem_mount_table_entry_tt;
typedef struct rtems_filesystem_mount_table_entry_tt
rtems_filesystem_mount_table_entry_t;
/* /*
* Valid RTEMS file types. * Valid RTEMS file types.
@@ -125,7 +117,7 @@ typedef int (*rtems_filesystem_rmnod_t)(
rtems_filesystem_location_info_t *pathloc /* IN */ rtems_filesystem_location_info_t *pathloc /* IN */
); );
typedef struct { struct _rtems_filesystem_file_handlers_r {
rtems_filesystem_open_t open_h; rtems_filesystem_open_t open_h;
rtems_filesystem_close_t close_h; rtems_filesystem_close_t close_h;
rtems_filesystem_read_t read_h; rtems_filesystem_read_t read_h;
@@ -140,7 +132,7 @@ typedef struct {
rtems_filesystem_fdatasync_t fdatasync_h; rtems_filesystem_fdatasync_t fdatasync_h;
rtems_filesystem_fcntl_t fcntl_h; rtems_filesystem_fcntl_t fcntl_h;
rtems_filesystem_rmnod_t rmnod_h; rtems_filesystem_rmnod_t rmnod_h;
} rtems_filesystem_file_handlers_r; };
/* /*
* File System Operations Table * File System Operations Table
@@ -248,7 +240,7 @@ typedef int (*rtems_filesystem_readlink_t)(
/* /*
* File system types * File system types
*/ */
typedef struct { struct _rtems_filesystem_operations_table {
rtems_filesystem_evalpath_t evalpath_h; rtems_filesystem_evalpath_t evalpath_h;
rtems_filesystem_evalmake_t evalformake_h; rtems_filesystem_evalmake_t evalformake_h;
rtems_filesystem_link_t link_h; rtems_filesystem_link_t link_h;
@@ -265,7 +257,10 @@ typedef struct {
rtems_filesystem_evaluate_link_t eval_link_h; rtems_filesystem_evaluate_link_t eval_link_h;
rtems_filesystem_symlink_t symlink_h; rtems_filesystem_symlink_t symlink_h;
rtems_filesystem_readlink_t readlink_h; rtems_filesystem_readlink_t readlink_h;
} rtems_filesystem_operations_table; };
#if 0
/* Now in exec/include/rtems/fs.h */
/* /*
* Structure used to determine a location/filesystem in the tree. * Structure used to determine a location/filesystem in the tree.
@@ -278,6 +273,7 @@ struct rtems_filesystem_location_info_tt
rtems_filesystem_operations_table *ops; rtems_filesystem_operations_table *ops;
rtems_filesystem_mount_table_entry_t *mt_entry; rtems_filesystem_mount_table_entry_t *mt_entry;
}; };
#endif
/* /*
* Structure used to contain file system specific information which * Structure used to contain file system specific information which

View File

@@ -20,33 +20,10 @@ extern "C" {
#include <rtems.h> #include <rtems.h>
#include <rtems/libio.h> /* include before standard IO */ #include <rtems/libio.h> /* include before standard IO */
#include <rtems/assoc.h> /* assoc.h not included by rtems.h */
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> /* O_RDONLY, et.al. */
#include <fcntl.h> /* O_RDONLY, et.al. */
#include <assert.h>
#include <stdarg.h>
#include <limits.h>
#include <errno.h>
#if ! defined(O_NDELAY)
# if defined(solaris2)
# define O_NDELAY O_NONBLOCK
# elif defined(RTEMS_NEWLIB)
# define O_NDELAY _FNBIO
# endif
#endif
#if !defined(ENOTSUP)
#define ENOTSUP EOPNOTSUPP
#endif
#include <errno.h> #include <errno.h>
#include <string.h> /* strcmp */
#include <unistd.h>
#include <stdlib.h> /* calloc() */
/* /*
* Semaphore to protect the io table * Semaphore to protect the io table
@@ -201,45 +178,11 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
/* /*
* External structures * External structures
*/ */
#if !defined(LOGIN_NAME_MAX) #include <rtems/userenv.h>
#if defined(__linux__)
#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
#else
#error "don't know how to set LOGIN_NAME_MAX"
#endif
#endif
typedef struct {
rtems_id task_id;
rtems_filesystem_location_info_t current_directory;
rtems_filesystem_location_info_t root_directory;
/* Default mode for all files. */
mode_t umask;
nlink_t link_counts;
/* _POSIX_types */
uid_t uid;
gid_t gid;
uid_t euid;
gid_t egid;
char login_buffer[LOGIN_NAME_MAX];
pid_t pgrp; /* process group id */
} rtems_user_env_t;
extern rtems_user_env_t * rtems_current_user_env; extern rtems_user_env_t * rtems_current_user_env;
extern rtems_user_env_t rtems_global_user_env; extern rtems_user_env_t rtems_global_user_env;
#define rtems_filesystem_current (rtems_current_user_env->current_directory)
#define rtems_filesystem_root (rtems_current_user_env->root_directory)
#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
#define rtems_filesystem_umask (rtems_current_user_env->umask)
#define _POSIX_types_Uid (rtems_current_user_env->uid)
#define _POSIX_types_Gid (rtems_current_user_env->gid)
#define _POSIX_types_Euid (rtems_current_user_env->euid)
#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. * Instantiate a private copy of the per user information for the calling task.
*/ */
@@ -247,8 +190,6 @@ extern rtems_user_env_t rtems_global_user_env;
rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_set_private_env(void);
rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ;
/* /*
* File Descriptor Routine Prototypes * File Descriptor Routine Prototypes
*/ */
@@ -296,6 +237,3 @@ int init_fs_mount_table();
#endif #endif
/* end of include file */ /* end of include file */

View File

@@ -28,15 +28,7 @@
* Define data types which must be constructed using forward references. * Define data types which must be constructed using forward references.
*/ */
typedef struct rtems_libio_tt rtems_libio_t; #include <rtems/fs.h>
struct rtems_filesystem_location_info_tt;
typedef struct rtems_filesystem_location_info_tt
rtems_filesystem_location_info_t;
struct rtems_filesystem_mount_table_entry_tt;
typedef struct rtems_filesystem_mount_table_entry_tt
rtems_filesystem_mount_table_entry_t;
/* /*
* Valid RTEMS file types. * Valid RTEMS file types.
@@ -125,7 +117,7 @@ typedef int (*rtems_filesystem_rmnod_t)(
rtems_filesystem_location_info_t *pathloc /* IN */ rtems_filesystem_location_info_t *pathloc /* IN */
); );
typedef struct { struct _rtems_filesystem_file_handlers_r {
rtems_filesystem_open_t open_h; rtems_filesystem_open_t open_h;
rtems_filesystem_close_t close_h; rtems_filesystem_close_t close_h;
rtems_filesystem_read_t read_h; rtems_filesystem_read_t read_h;
@@ -140,7 +132,7 @@ typedef struct {
rtems_filesystem_fdatasync_t fdatasync_h; rtems_filesystem_fdatasync_t fdatasync_h;
rtems_filesystem_fcntl_t fcntl_h; rtems_filesystem_fcntl_t fcntl_h;
rtems_filesystem_rmnod_t rmnod_h; rtems_filesystem_rmnod_t rmnod_h;
} rtems_filesystem_file_handlers_r; };
/* /*
* File System Operations Table * File System Operations Table
@@ -248,7 +240,7 @@ typedef int (*rtems_filesystem_readlink_t)(
/* /*
* File system types * File system types
*/ */
typedef struct { struct _rtems_filesystem_operations_table {
rtems_filesystem_evalpath_t evalpath_h; rtems_filesystem_evalpath_t evalpath_h;
rtems_filesystem_evalmake_t evalformake_h; rtems_filesystem_evalmake_t evalformake_h;
rtems_filesystem_link_t link_h; rtems_filesystem_link_t link_h;
@@ -265,7 +257,10 @@ typedef struct {
rtems_filesystem_evaluate_link_t eval_link_h; rtems_filesystem_evaluate_link_t eval_link_h;
rtems_filesystem_symlink_t symlink_h; rtems_filesystem_symlink_t symlink_h;
rtems_filesystem_readlink_t readlink_h; rtems_filesystem_readlink_t readlink_h;
} rtems_filesystem_operations_table; };
#if 0
/* Now in exec/include/rtems/fs.h */
/* /*
* Structure used to determine a location/filesystem in the tree. * Structure used to determine a location/filesystem in the tree.
@@ -278,6 +273,7 @@ struct rtems_filesystem_location_info_tt
rtems_filesystem_operations_table *ops; rtems_filesystem_operations_table *ops;
rtems_filesystem_mount_table_entry_t *mt_entry; rtems_filesystem_mount_table_entry_t *mt_entry;
}; };
#endif
/* /*
* Structure used to contain file system specific information which * Structure used to contain file system specific information which

View File

@@ -20,33 +20,10 @@ extern "C" {
#include <rtems.h> #include <rtems.h>
#include <rtems/libio.h> /* include before standard IO */ #include <rtems/libio.h> /* include before standard IO */
#include <rtems/assoc.h> /* assoc.h not included by rtems.h */
#include <sys/types.h> #include <sys/types.h>
#include <stdio.h> /* O_RDONLY, et.al. */
#include <fcntl.h> /* O_RDONLY, et.al. */
#include <assert.h>
#include <stdarg.h>
#include <limits.h>
#include <errno.h>
#if ! defined(O_NDELAY)
# if defined(solaris2)
# define O_NDELAY O_NONBLOCK
# elif defined(RTEMS_NEWLIB)
# define O_NDELAY _FNBIO
# endif
#endif
#if !defined(ENOTSUP)
#define ENOTSUP EOPNOTSUPP
#endif
#include <errno.h> #include <errno.h>
#include <string.h> /* strcmp */
#include <unistd.h>
#include <stdlib.h> /* calloc() */
/* /*
* Semaphore to protect the io table * Semaphore to protect the io table
@@ -201,45 +178,11 @@ extern rtems_libio_t *rtems_libio_iop_freelist;
/* /*
* External structures * External structures
*/ */
#if !defined(LOGIN_NAME_MAX) #include <rtems/userenv.h>
#if defined(__linux__)
#define LOGIN_NAME_MAX _POSIX_LOGIN_NAME_MAX
#else
#error "don't know how to set LOGIN_NAME_MAX"
#endif
#endif
typedef struct {
rtems_id task_id;
rtems_filesystem_location_info_t current_directory;
rtems_filesystem_location_info_t root_directory;
/* Default mode for all files. */
mode_t umask;
nlink_t link_counts;
/* _POSIX_types */
uid_t uid;
gid_t gid;
uid_t euid;
gid_t egid;
char login_buffer[LOGIN_NAME_MAX];
pid_t pgrp; /* process group id */
} rtems_user_env_t;
extern rtems_user_env_t * rtems_current_user_env; extern rtems_user_env_t * rtems_current_user_env;
extern rtems_user_env_t rtems_global_user_env; extern rtems_user_env_t rtems_global_user_env;
#define rtems_filesystem_current (rtems_current_user_env->current_directory)
#define rtems_filesystem_root (rtems_current_user_env->root_directory)
#define rtems_filesystem_link_counts (rtems_current_user_env->link_counts)
#define rtems_filesystem_umask (rtems_current_user_env->umask)
#define _POSIX_types_Uid (rtems_current_user_env->uid)
#define _POSIX_types_Gid (rtems_current_user_env->gid)
#define _POSIX_types_Euid (rtems_current_user_env->euid)
#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. * Instantiate a private copy of the per user information for the calling task.
*/ */
@@ -247,8 +190,6 @@ extern rtems_user_env_t rtems_global_user_env;
rtems_status_code rtems_libio_set_private_env(void); rtems_status_code rtems_libio_set_private_env(void);
rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ; rtems_status_code rtems_libio_share_private_env(rtems_id task_id) ;
/* /*
* File Descriptor Routine Prototypes * File Descriptor Routine Prototypes
*/ */
@@ -296,6 +237,3 @@ int init_fs_mount_table();
#endif #endif
/* end of include file */ /* end of include file */