FW: MIT shared memory extension
Ralf Habacker
Ralf.Habacker@freenet.de
Thu May 9 12:39:00 GMT 2002
Ups, there were some wrong usages of path/buf in the last code example. Sorry.
> key_t
> ftok(const char *path, int id)
> {
> struct stat statbuf;
> // call stat() only as file existing check
> if (stat(path, &statbuf))
> {
> /* stat set the appropriate errno for us */
> return (key_t) -1;
> }
> #ifdef CASE1
> char buf[MAX_PATH];
> sprintf(buf,"%s%08x",path,id);
> return hash_path_name(0,buf);
> #else /* CASE2 */
> return hash_path_name(id,path);
> #endif
> }
More information about the Cygwin-xfree
mailing list