Forum Discussion
4 Replies
- Altera_Forum
Honored Contributor
OK the prototypes for the alt_open.c file are in alt_sys_wrappers.h
But I have searched my entire harddrive for the flag definitions and found nothing (O_RDWR, WR_ONLY etc.). Also the example code uses open like you would fopen (with only 2 parameters). - Altera_Forum
Honored Contributor
It seems my installation was corrupted and I was missing some library files. A reinstall seems to have fixed everything.
However it does still appear to need <fctrl.h> included, even though the documentation doesn't specify this. - Altera_Forum
Honored Contributor
Whenever 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:
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, - slackerSYNOPSIS # 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); - Altera_Forum
Honored Contributor
Also another resource I've found: just google the function name... I usually wind up at a site such as http://www.cplusplus.com/ref/indexr.html (http://www.cplusplus.com/ref/indexr.html) which tells me all sorts of useful things about the routine I'm interested in, including header files, in a pretty non-man-page format.