From c625a641218fbda23582354b3cfc7a7c7a4e4287 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sun, 21 Dec 2014 20:12:28 +0100 Subject: Filesystem: Delete node type operation Use the fstat handler instead. --- cpukit/libcsupport/include/rtems/libio_.h | 35 ++++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'cpukit/libcsupport/include/rtems/libio_.h') diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h index 458201ea3f..e204508cf1 100644 --- a/cpukit/libcsupport/include/rtems/libio_.h +++ b/cpukit/libcsupport/include/rtems/libio_.h @@ -205,21 +205,6 @@ void rtems_filesystem_location_clone( const rtems_filesystem_location_info_t *master ); -/** - * @brief Returns the type of a node. - * - * This function obtains and releases the file system instance lock. - * - * @param[in] loc The location of the node. - * - * @retval type The node type. - * - * @see rtems_filesystem_instance_lock(). - */ -rtems_filesystem_node_types_t rtems_filesystem_node_type( - const rtems_filesystem_location_info_t *loc -); - /** * @brief Releases all resources of a location. * @@ -919,6 +904,26 @@ static inline ssize_t rtems_libio_iovec_eval( return total; } +/** + * @brief Returns the file type of the file referenced by the filesystem + * location. + * + * @brief[in] loc The filesystem location. + * + * @return The type of the file or an invalid file type in case of an error. + */ +static inline mode_t rtems_filesystem_location_type( + const rtems_filesystem_location_info_t *loc +) +{ + struct stat st; + + st.st_mode = 0; + (void) ( *loc->handlers->fstat_h )( loc, &st ); + + return st.st_mode; +} + /** @} */ #ifdef __cplusplus -- cgit v1.2.3