[squid-users] SIGBUS attempting to use rock
Antonio SJ Musumeci
trapexit at spawn.link
Fri Oct 18 14:25:06 UTC 2019
On 10/18/2019 9:49 AM, Alex Rousskov wrote:
> Actually, the location of shared memory segments is chosen by the OS.
> Not all OSes do what Linux does. The code dealing with [naming] shared
> memory segments is more complicated than you probably imagine. However,
> let's not spend time arguing about these low-level specifics here: If
> you can contribute an improvement, please post a plan on squid-dev.
> Otherwise, let's leave these low-level details to those contributing
You don't need to know where the OS put the file (though /dev/shm is a
well known location and easily could be checked explicitly).
$ man fstatvfs
The attached example seems to work fine and could be incorporated into
I'd be happy to post this on squid-dev / submit a pull request.
-------------- next part --------------
$ gcc -o shm_statvfs shm_statvfs.c -lrt
const char FILENAME = "statvfs.test.tmp";
struct statvfs vfs;
fd = shm_open(FILENAME,O_CREAT|O_RDWR,S_IRUSR|S_IWUSR);
rv = fstatvfs(fd,&vfs);
printf("fstatvfs(%d,%p) = %d\n",fd,&vfs,rv);
if(rv == -1)
"total avail: %ld\n",
More information about the squid-users