Where or how can I find the correct C headers for inclusion in a C ++ program to get the declaration of C functions declared in a POSIX compatible environment?
I ask this because I need to use the open() system call in my C ++ program for my purposes, so I first tried to include the headers mentioned in the open() online documentation (in the SYNOPSIS section), which sys/stat.h and fcntl.h . However, when trying to compile, the compiler complained that open() not declared. After searching on google, I discovered that another possibility was unistd.h . I tried using this header and the program compiled. So I went back to the POSIX documentation to learn more about unistd.h , to check if open() was listed there, but I couldn't find anything about it.
What am I doing wrong? Why is there such a mismatch between the POSIX documentation and my GCC environment?
source share