laforge has submitted this change. (
https://gerrit.osmocom.org/c/libosmocore/+/36076?usp=email )
Change subject: osmo_io: Add osmo_io_get_ioops() function
......................................................................
osmo_io: Add osmo_io_get_ioops() function
This function can be used by user code to obtain the currently-set io
operations, it's the inverse of osmo_io_set_ioops().
Change-Id: I03398c811b9534f50c6644b21eea89a04be29fb0
---
M include/osmocom/core/osmo_io.h
M src/core/libosmocore.map
M src/core/osmo_io.c
3 files changed, 22 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h
index dda9e6d..8a7e53a 100644
--- a/include/osmocom/core/osmo_io.h
+++ b/include/osmocom/core/osmo_io.h
@@ -109,3 +109,4 @@
void osmo_iofd_set_name(struct osmo_io_fd *iofd, const char *name);
int osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops);
+void osmo_iofd_get_ioops(struct osmo_io_fd *iofd, struct osmo_io_ops *ioops);
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map
index a50a9ed..72a6038 100644
--- a/src/core/libosmocore.map
+++ b/src/core/libosmocore.map
@@ -258,6 +258,7 @@
osmo_iofd_close;
osmo_iofd_free;
osmo_iofd_get_data;
+osmo_iofd_get_ioops;
osmo_iofd_get_fd;
osmo_iofd_get_name;
osmo_iofd_set_name;
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index b6b5908..7ea959b 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -896,6 +896,14 @@
return 0;
}
+/*! Get the osmo_io_ops for an iofd.
+ * \param[in] iofd Target iofd file descriptor
+ * \param[in] ioops caller-allocated osmo_io_ops structure to be filled */
+void osmo_iofd_get_ioops(struct osmo_io_fd *iofd, struct osmo_io_ops *ioops)
+{
+ *ioops = iofd->io_ops;
+}
+
/*! Notify the user if/when the socket is connected.
* When the socket is connected the write_cb will be called.
* \param[in] iofd the file descriptor */
--
To view, visit
https://gerrit.osmocom.org/c/libosmocore/+/36076?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I03398c811b9534f50c6644b21eea89a04be29fb0
Gerrit-Change-Number: 36076
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged