Skip to content

Tag: filesystems

Linux filesystem nesting and syscall hooking

Using 2.6.32 linux kernel, I need to use a specific filesystem on a block device partition and I wan’t to hook open/write/read/close (and few others) syscalls to read/write, in an other fashion that the specific filesystem, what should be written on this partition. It would be only for this partition, o…

write(2)/read(2) atomicity between processes in linux

I have a case where there are two processes which act on the same file – one as a writer and one as a reader. The file is a one line text file and the writer re-writes the line in a loop. reader reads the line. The pseudo code looks like this: Writer Process Reader Process After a while of

Making a virtual file in Linux

I’m working with some existing software that I cannot change, and it loads its config data from a bunch of config files, all following the same naming scheme – let’s say, file_param1.conf, file_param2.conf, file_param3.conf etc. The difference between the content of the files is just param1 …

How do I create a file in FUSE in C?

For an assignment we have to build a FUSE file system using C. I am trying to create an empty file in the mountpoint directory that I have mounted when I start fuse but it’s not working. I tried placing the following inside my own implementation of the fuse init function: After I had done that, what hap…

Physical disk block size on POSIX using C/C++

I’m working on a high performance I/O program and I’m trying to find the best way to determine the _physical_ (and not the _logical_) byte size of a device’s disk blocks with C++. My research so far has led me to the following code snippet: The man pages says the following about st_blksize: …