Reputation: 37
I've been trying to work on this program to find the file size, and the way I'm going about it uses the open() function which requires a flag, but when I enter the correct flag it says it hasn't been declared yet. Here is the line and the imports I have.
# include <stdio.h>
# include <unistd.h>
# include <stdlib.h>
# include <string.h>
# include <sys/types.h>
# include <sys/stat.h>
int filedescriptor = open(filename, O_RDONLY);
I'm sure I'm missing something simple.
Upvotes: 0
Views: 136
Reputation: 1380
You are missining #include <fcntl.h>
Note that in man(3)
you are going to find POSIX specs, while in man(2)
system specific implementations, if any.
In fact man(3)
is the POSIX Programmer's Manual while man(2)
is Linux Programmer's Manual.
Note that this is not always true, but most of POSIX functions have also a man(2)
page.
Upvotes: 2