F_SETPIPE_SZ uneclared
I have included the 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 also tried to use
#define _GNU_SOURCE
before #include <unistd.h>
, but that doesn't help either.
I'm trying to use fcntl
and pass it F_SETPIPE_SZ
as the second argument, but I keep getting this error message:
error: 'F_SETPIPE_SZ uneclared (use in this function first)
I actually found out that I don't need this, but I'm just wondering why I can't use it.
Thank.
So here's the solution, thanks to Chrono Kitsune: Placed
#define _GNU_SOURCE
before turning on.
So here, thanks to Chrono Kitsune :
Placed
#define _GNU_SOURCE
before turning on.
You should also pay attention to Chrono Kitsune's other comment .
F_SETPIPE_SZ / F_GETPIPE_SZ are relatively recent. Older kernels (like the 2.6.32 used in RHEL6) do not have them. If you look in /usr/include/linux/fcntl.h and those constants are undefined then this API won't work and you have to find a way around it in what you are building.