/* Create a buffer. This is creating a temporary file and then
* immediately unlinking it so we do not leave traces in the system. */intcreate_buffer(int64_tsize){staticchartemplate[]="/tmp/plasmaXXXXXX";charfile_name[32];strncpy(file_name,template,32);intfd=mkstemp(file_name);if(fd<0)return-1;FILE*file=fdopen(fd,"a+");if(!file){close(fd);return-1;}if(unlink(file_name)!=0){LOG_ERR("unlink error");return-1;}if(ftruncate(fd,(off_t)size)!=0){LOG_ERR("ftruncate error");return-1;}returnfd;}