Fix: check channel subbuf size against page size
[lttng-tools.git] / src / bin / lttng-sessiond / main.c
index 445485b417d5d0b0e0cd6f1de4eaab41336baaf5..9527371380e02c45011ad60a0f806872e194a861 100644 (file)
@@ -232,6 +232,9 @@ static enum consumerd_state kernel_consumerd_state;
  */
 static int app_socket_timeout;
 
+/* Set in main() with the current page size. */
+long page_size;
+
 static
 void setup_consumerd_path(void)
 {
@@ -4038,6 +4041,13 @@ int main(int argc, char **argv)
 
        setup_consumerd_path();
 
+       page_size = sysconf(_SC_PAGESIZE);
+       if (page_size < 0) {
+               PERROR("sysconf _SC_PAGESIZE");
+               page_size = LONG_MAX;
+               WARN("Fallback page size to %ld", page_size);
+       }
+
        /* Parse arguments */
        progname = argv[0];
        if ((ret = parse_args(argc, argv)) < 0) {
This page took 0.024014 seconds and 5 git commands to generate.