This function indicates whether or not the stream is in
"CTF writer mode", that is, its trace parent was created by a
CTF writer object and it has an open file descriptor.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
end:
return name;
}
+
+int bt_ctf_stream_is_writer(struct bt_ctf_stream *stream)
+{
+ int ret = -1;
+
+ if (!stream) {
+ goto end;
+ }
+
+ ret = (stream->pos.fd >= 0);
+
+end:
+ return ret;
+}
*/
extern int bt_ctf_stream_flush(struct bt_ctf_stream *stream);
+extern int bt_ctf_stream_is_writer(struct bt_ctf_stream *stream);
+
/*
* bt_ctf_stream_get and bt_ctf_stream_put: increment and decrement the
* stream's reference count.