Fix freebsd endian support
[lttng-ust.git] / liblttng-ust / compat.h
CommitLineData
b728d87e
MD
1#ifndef _UST_COMPAT_H
2#define _UST_COMPAT_H
3
4/*
5 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 *
7 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
8 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
9 *
10 * Permission is hereby granted to use or copy this program
11 * for any purpose, provided the above notices are retained on all copies.
12 * Permission to modify the code and to distribute modified code is granted,
13 * provided the above notices are retained, and a notice that the code was
14 * modified is included with the above copyright notice.
15 */
16
4c1ee94e 17#include <sys/syscall.h>
e4486ebc
MD
18
19#ifdef __UCLIBC__
e4486ebc
MD
20#define __getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
21static inline
22int sched_getcpu(void)
23{
24 int c, s;
25
26 s = __getcpu(&c, NULL, NULL);
27 return (s == -1) ? s : c;
28}
29#endif /* __UCLIBC__ */
b728d87e 30#endif /* _UST_COMPAT_H */
This page took 0.026252 seconds and 4 git commands to generate.