summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/include/rtems/libio_.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-12-21 20:12:28 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-01-22 07:52:40 +0100
commitc625a641218fbda23582354b3cfc7a7c7a4e4287 (patch)
tree82853d039ebb88fb4e7afe0b572c1d072a3f4d00 /cpukit/libcsupport/include/rtems/libio_.h
parentpowerpc: Fix AltiVec VSCR save/restore (diff)
downloadrtems-c625a641218fbda23582354b3cfc7a7c7a4e4287.tar.bz2
Filesystem: Delete node type operation
Use the fstat handler instead.
Diffstat (limited to '')
-rw-r--r--cpukit/libcsupport/include/rtems/libio_.h35
1 files changed, 20 insertions, 15 deletions
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
@@ -206,21 +206,6 @@ void rtems_filesystem_location_clone(
);
/**
- * @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.
*
* This function may block on a mutex and may complete an unmount process.
@@ -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