Skip to content
Advertisement

F_SETPIPE_SZ undeclared

I have included following headers:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>

I have also tried to use

#define _GNU_SOURCE

before #include <unistd.h>, but it also does not help.

I try to use fcntl and pass it F_SETPIPE_SZ as second argument, but I keep getting this error message:

error: ‘F_SETPIPE_SZ’ undeclared (first use in this function)

I actually found out that I don’t need this, but I’m just curious why I can’t use it.

Thank you.

So here’s solution, thanks to Chrono Kitsune: Put

 #define _GNU_SOURCE

before any includes.

Advertisement

Answer

So here’s the solution, thanks to Chrono Kitsune:

Put

#define _GNU_SOURCE

before any includes.

You should also pay attention to Chrono Kitsune’s other comment.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement