+static
+int metadata_file_append(struct ust_registry_session *session,
+ const char *str, size_t len)
+{
+ ssize_t written;
+
+ if (session->metadata_fd < 0) {
+ return 0;
+ }
+ /* Write to metadata file */
+ written = lttng_write(session->metadata_fd, str, len);
+ if (written != len) {
+ return -1;
+ }
+ return 0;
+}
+