[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
> improvements.

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

#include <fcntl.h>
#include <stdio.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <unistd.h>

const char FILENAME[] = "statvfs.test.tmp";

main(int   argc,
     char *argv)
  int rv;
  int fd;
  struct statvfs vfs;


  rv = fstatvfs(fd,&vfs);
  printf("fstatvfs(%d,%p) = %d\n",fd,&vfs,rv);
  if(rv == -1)
    return 1;

  printf("frsize: %ld\n"
         "bavail: %ld\n"
         "total avail: %ld\n",



  return 0;

More information about the squid-users mailing list