core: Add function to update osmo_io_ops field for osmo_io_fd

Added, because the field 'io_ops' of 'struct osmo_io_fd' is not a
reference, so subsequent changes to the osmo_io_ops structure that was
used to set it up aren't automatically reflected in the osmo_io_fd
structure that got its copy.

Change-Id: Ie45402ad8e86e3cecf75ad78a512c17e61e68b19
This commit is contained in:
arehbein 2023-05-14 21:43:11 +02:00
parent 03590fcee4
commit 0c374c68a1
3 changed files with 11 additions and 0 deletions

View File

@ -88,3 +88,5 @@ void osmo_iofd_set_priv_nr(struct osmo_io_fd *iofd, unsigned int priv_nr);
int osmo_iofd_get_fd(const struct osmo_io_fd *iofd);
const char *osmo_iofd_get_name(const struct osmo_io_fd *iofd);
void osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops);

View File

@ -267,6 +267,7 @@ osmo_iofd_register;
osmo_iofd_sendto_msgb;
osmo_iofd_set_alloc_info;
osmo_iofd_set_data;
osmo_iofd_set_ioops;
osmo_iofd_set_priv_nr;
osmo_iofd_setup;
osmo_iofd_txqueue_clear;

View File

@ -599,4 +599,12 @@ const char *osmo_iofd_get_name(const struct osmo_io_fd *iofd)
return iofd->name;
}
/*! Set the osmo_io_ops for an iofd
* \param[in] iofd Target iofd file descriptor
* \param[in] ioops osmo_io_ops structure to be set */
void osmo_iofd_set_ioops(struct osmo_io_fd *iofd, const struct osmo_io_ops *ioops)
{
iofd->io_ops = *ioops;
}
#endif /* defined(__linux__) */