projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests: lttngctl.py: allow the creation of per-pid buffers
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
fd-limit.cpp
diff --git
a/src/bin/lttng-sessiond/fd-limit.cpp
b/src/bin/lttng-sessiond/fd-limit.cpp
index 684332e9f6d88fd47e43a5676f97d6d058782f9c..ae63ccc06ad7c5b6bff887da22c13b44fe0a3cc0 100644
(file)
--- a/
src/bin/lttng-sessiond/fd-limit.cpp
+++ b/
src/bin/lttng-sessiond/fd-limit.cpp
@@
-6,13
+6,15
@@
*/
#define _LGPL_SOURCE
*/
#define _LGPL_SOURCE
-#include <urcu/uatomic.h>
-#include <sys/time.h>
-#include <sys/resource.h>
+#include "fd-limit.hpp"
+
+#include <common/compat/errno.hpp>
+#include <common/error.hpp>
+
#include <stdio.h>
#include <stdio.h>
-#include
"fd-limit.h"
-#include <
common/error
.h>
-#include <
common/compat/errno
.h>
+#include
<sys/resource.h>
+#include <
sys/time
.h>
+#include <
urcu/uatomic
.h>
/* total count of fd. */
static long fd_count;
/* total count of fd. */
static long fd_count;
@@
-35,21
+37,19
@@
int lttng_fd_get(enum lttng_fd_type type, unsigned int nr)
}
newval = uatomic_add_return(&fd_count, (long) nr);
}
newval = uatomic_add_return(&fd_count, (long) nr);
- if ((long) (newval * 100)
- - (long) (max_nr_fd * fd_threshold[type]) > 0) {
+ if ((long) (newval * 100) - (long) (max_nr_fd * fd_threshold[type]) > 0) {
uatomic_sub(&fd_count, (long) nr);
return -EPERM;
}
return 0;
}
uatomic_sub(&fd_count, (long) nr);
return -EPERM;
}
return 0;
}
-void lttng_fd_put(enum lttng_fd_type type __attribute__((unused)),
- unsigned int nr)
+void lttng_fd_put(enum lttng_fd_type type __attribute__((unused)), unsigned int nr)
{
uatomic_sub(&fd_count, (long) nr);
}
{
uatomic_sub(&fd_count, (long) nr);
}
-void lttng_fd_init(
void
)
+void lttng_fd_init()
{
struct rlimit rlim;
int ret;
{
struct rlimit rlim;
int ret;
This page took
0.024624 seconds
and
4
git commands to generate.