This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
FW: MIT shared memory extension
- From: "Ralf Habacker" <Ralf dot Habacker at freenet dot de>
- To: "Robert Collins" <robert dot collins at itdomain dot com dot au>,"Cygwin-Xfree" <cygwin-xfree at sources dot redhat dot com>
- Date: Thu, 9 May 2002 21:38:57 +0200
- Subject: FW: MIT shared memory extension
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
> }