Move to kernel style SPDX license identifiers
[lttng-ust.git] / libringbuffer / ring_buffer_frontend.c
index ce759ff18aa76ce638596b6f25d59d779a868edf..90459f006491e2e63512f6d1af3e407f6fca4ba5 100644 (file)
@@ -1,23 +1,8 @@
 /*
- * ring_buffer_frontend.c
+ * SPDX-License-Identifier: LGPL-2.1-only
  *
  * Copyright (C) 2005-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; only
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- *
  * Ring buffer wait-free buffer synchronization. Producer-consumer and flight
  * recorder (overwrite) modes. See thesis:
  *
@@ -51,7 +36,6 @@
  *   - put_subbuf
  */
 
-#define _GNU_SOURCE
 #define _LGPL_SOURCE
 #include <sys/types.h>
 #include <sys/mman.h>
@@ -61,6 +45,7 @@
 #include <signal.h>
 #include <time.h>
 #include <stdbool.h>
+#include <stdint.h>
 #include <urcu/compiler.h>
 #include <urcu/ref.h>
 #include <urcu/tls-compat.h>
@@ -804,6 +789,7 @@ void lib_ring_buffer_channel_switch_timer_start(struct channel *chan)
 
        lib_ring_buffer_setup_timer_thread();
 
+       memset(&sev, 0, sizeof(sev));
        sev.sigev_notify = SIGEV_SIGNAL;
        sev.sigev_signo = LTTNG_UST_RB_SIG_FLUSH;
        sev.sigev_value.sival_ptr = chan;
@@ -1022,11 +1008,11 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff
 
        /* Calculate the shm allocation layout */
        shmsize = sizeof(struct channel);
-       shmsize += offset_align(shmsize, __alignof__(struct lttng_ust_lib_ring_buffer_shmp));
+       shmsize += lttng_ust_offset_align(shmsize, __alignof__(struct lttng_ust_lib_ring_buffer_shmp));
        shmsize += sizeof(struct lttng_ust_lib_ring_buffer_shmp) * nr_streams;
        chansize = shmsize;
        if (priv_data_align)
-               shmsize += offset_align(shmsize, priv_data_align);
+               shmsize += lttng_ust_offset_align(shmsize, priv_data_align);
        shmsize += priv_data_size;
 
        /* Allocate normal memory for channel (not shared) */
@@ -1154,7 +1140,7 @@ void channel_release(struct channel *chan, struct lttng_ust_shm_handle *handle,
  * Call "destroy" callback, finalize channels, decrement the channel
  * reference count. Note that when readers have completed data
  * consumption of finalized channels, get_subbuf() will return -ENODATA.
- * They should release their handle at that point. 
+ * They should release their handle at that point.
  */
 void channel_destroy(struct channel *chan, struct lttng_ust_shm_handle *handle,
                int consumer)
This page took 0.024106 seconds and 4 git commands to generate.