- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do I use them? The HAL manual says to include <unistd.h> but this doesn't work. The example code says to include <stdio.h> but never mentions unistd.h. Neither of these work for me. I can't find where the alt_open.c declartion is declared in any header.
Why is the documentation so wrong? How do I use open.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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).- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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:
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page