For the implementation of name-based apr_shm_create using shmget (i.e.
the filename != NULL case), I've got two questions:
1) why is APR_EXCL passed to the apr_file_open call? This is annoying
for Apache since if the server crashes, you have to remove the shmem
segment *and* the filename before restarting. Patch below OK?
2) why is the file used to store the segment size, rather than using the
shm_segsz member of the shmid_ds structure?
joe
Index: unix/shm.c
===================================================================
RCS file: /home/cvs/apr/shmem/unix/shm.c,v
retrieving revision 1.19
diff -u -r1.19 shm.c
--- unix/shm.c 20 Nov 2002 03:50:22 -0000 1.19
+++ unix/shm.c 13 Dec 2002 17:17:41 -0000
@@ -361,7 +361,7 @@
/* FIXME: APR_OS_DEFAULT is too permissive, switch to 600 I think. */
status = apr_file_open(&file, filename,
- APR_WRITE | APR_CREATE | APR_EXCL,
+ APR_WRITE | APR_CREATE | APR_TRUNCATE,
APR_OS_DEFAULT, pool);
if (status != APR_SUCCESS) {
return status;