Forum Discussion
Altera_Forum
Honored Contributor
21 years agoWhenever I come upon a question of what headers to include, I hop onto a computer with a "real" OS (i.e.: *not* Windows!) and view the manpage of the function in question. In this case the top part of the manpage for "open", returns:
SYNOPSIS
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
int open(const char *pathname, int flags);
int open(const char *pathname, int flags, mode_t mode);
int creat(const char *pathname, mode_t mode); This tends to save me time and, since Windows documentation is a complete mess, it's much easier to find things on UNIX (or UNIX-like) OSs. If the documentation is wrong, it should certainly be updated, but I believe this little bit of info. to "common" knowledge... The two manpages I looked at (on Linux and Solaris) both had identical information. Cheers, - slacker