Fix: cache the result of getpid() internally
[deliverable/lttng-ust.git] / liblttng-ust / lttng-context-vpid.c
index 7d8091be0351052e3db95602dd839bd7a5d95406..53fb314b8c0da1bdf353f00c59c953879b4ed150 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define _LGPL_SOURCE
 #include <sys/types.h>
 #include <unistd.h>
 #include <lttng/ust-events.h>
 #include <lttng/ust-tracer.h>
 #include <lttng/ringbuffer-config.h>
 
-#ifdef __linux__
-static inline
-pid_t wrapper_getpid(void)
-{
-       return getpid();
-}
-
-void lttng_context_vpid_reset(void)
-{
-}
-#else
 /*
  * We cache the result to ensure we don't trigger a system call for
  * each event.
@@ -59,7 +49,6 @@ void lttng_context_vpid_reset(void)
 {
        cached_vpid = 0;
 }
-#endif
 
 static
 size_t vpid_get_size(struct lttng_ctx_field *field, size_t offset)
This page took 0.024095 seconds and 5 git commands to generate.