| 157 | #endif |
| 158 | |
| 159 | static SLONG get_key(const TEXT* filename) |
| 160 | { |
| 161 | /************************************* |
| 162 | * |
| 163 | * g e t _ k e y |
| 164 | * |
| 165 | ************************************* |
| 166 | * |
| 167 | * Functional description |
| 168 | * Find the semaphore/shared memory key for a file. |
| 169 | * |
| 170 | ************************************/ |
| 171 | TEXT expanded_filename[128], hostname[64]; |
| 172 | |
| 173 | #ifdef NOHOSTNAME |
| 174 | strcpy(expanded_filename, filename); |
| 175 | #else |
| 176 | sprintf(expanded_filename, filename, ISC_get_host(hostname, sizeof(hostname))); |
| 177 | #endif |
| 178 | |
| 179 | // Produce shared memory key for file |
| 180 | |
| 181 | return ftok(expanded_filename, FTOK_KEY); |
| 182 | } |
| 183 | |
| 184 | |
| 185 | #ifndef HAVE_MMAP |
no test coverage detected