Commit 69e3f52d authored by Frederic Weisbecker's avatar Frederic Weisbecker Committed by Ingo Molnar
Browse files

perf: Fix implicit declaration of getline in util.c

getline() is considered as undeclared in util/util.c because
it includes string.h, that in turn includes stdio.h, without
having defined _GNU_SOURCE.

But util.c also includes util.h that handles the _GNU_SOURCE and
all the needed inclusions already. Let's include only util.h
and sys/mman.h which is the only one header not handled by

This fixes the following build error:

 util/util.c: In function 'slow_copyfile':
 util/util.c:49: erreur: implicit declaration of function
 'getline' util/util.c:49: erreur: nested extern declaration of 'getline'
Signed-off-by: default avatarFrederic Weisbecker <>
Cc: Peter Zijlstra <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Paul Mackerras <>
LKML-Reference: <>
Signed-off-by: default avatarIngo Molnar <>
parent d6f962b5
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include "util.h"
#include <sys/mman.h>
int mkdir_p(char *path, mode_t mode)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment