This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 
> }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]