summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/include/rtems/libio_.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-13 10:11:46 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-15 07:48:03 +0200
commit856ede4f91a76a1a681ceac24ddb18d3a438dffb (patch)
tree969faa830fdcc9815a4335567e10b4f949e7e942 /cpukit/libcsupport/include/rtems/libio_.h
parentlibio: rtems_libio_check_permissions_with_error() (diff)
downloadrtems-856ede4f91a76a1a681ceac24ddb18d3a438dffb.tar.bz2
libio: Add iop set/clear flags
Update #3132.
Diffstat (limited to 'cpukit/libcsupport/include/rtems/libio_.h')
-rw-r--r--cpukit/libcsupport/include/rtems/libio_.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/cpukit/libcsupport/include/rtems/libio_.h b/cpukit/libcsupport/include/rtems/libio_.h
index ba6866e5a4..ed5cd27c31 100644
--- a/cpukit/libcsupport/include/rtems/libio_.h
+++ b/cpukit/libcsupport/include/rtems/libio_.h
@@ -90,6 +90,46 @@ extern rtems_filesystem_mount_table_entry_t rtems_filesystem_null_mt_entry;
extern rtems_filesystem_global_location_t rtems_filesystem_global_location_null;
/**
+ * @brief Sets the specified flags in the iop.
+ *
+ * @param[in] iop The iop.
+ * @param[in] set The flags to set.
+ *
+ * @return The previous flags.
+ */
+static inline uint32_t rtems_libio_iop_flags_set(
+ rtems_libio_t *iop,
+ uint32_t set
+)
+{
+ uint32_t flags;
+
+ flags = iop->flags;
+ iop->flags = flags | set;
+ return flags;
+}
+
+/**
+ * @brief Clears the specified flags in the iop.
+ *
+ * @param[in] iop The iop.
+ * @param[in] clear The flags to clear.
+ *
+ * @return The previous flags.
+ */
+static inline uint32_t rtems_libio_iop_flags_clear(
+ rtems_libio_t *iop,
+ uint32_t clear
+)
+{
+ uint32_t flags;
+
+ flags = iop->flags;
+ iop->flags = flags & ~clear;
+ return flags;
+}
+
+/**
* @brief Maps a file descriptor to the iop.
*
* The file descriptor must be a valid index into the iop table.