2

In MINIX 3.2.1, I want to create a new system call in VFS server which will be given a filename as a parameter and will print this certain file's inode number.

So in order to retrieve the inode of the file by its name I want to use the default system call:

int stat(char *name,struct stat *buffer)

http://minix1.woodhull.com/manpages/man2/stat.2.html

in the body of my new system call handler which is

int mycall_1(void);

inside `/usr/src/servers/vfs/misc.c

But when I test the new system call, at the point where the stat system call should be invoked, it actually won't and instead it's printing the message:

sys_call: ipc mask denied SENDREC from 1 to 1

After some research, I found that this possibly happens because the VFS server tries to send a message to itself, as stat is actually implemented inside VFS server, and so ipc mask denied this sendrec() call. So I have to edit some configuration file in order to give the right permission for this communication to happen.

But I'm not sure if what I have understood is right and also do not know which file should Ι edit to give the appropriate permissions. So, if someone could enlighten me on this issue, I would be grateful.

Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
thomas_p
  • 97
  • 1
  • 14

1 Answers1

1

You understood it correctly. But the solution is not to continue "fixing the permissions" which are here just to prevent to shot yourself in the foot: it would only allow the system to more badly brocken. Rather, you need to perform the steps that VFS do when it services a STAT request, starting after it cracked the message.

AntoineL
  • 888
  • 4
  • 25
  • Well, I indeed solved that issue by studying the way `do_stat` works (inside /usr/src/servers/vfs/stat.c). Thanks for pointing out anyway. Another problem I encountered later in that project was that `VFS` cannot access the `inode` struct table, neither fuctions such as `get_inode`, because they 're all implemented inside `MFS` server and not `VFS`. So I had to create a new system call inside `MFS` which I invoked from the inside of `VFS`. Some info in order to create a system call to `MFS` server properly are provided here: http://www.manio.org/blog/how-to-add-new-system-calls-to-minix-3-1-8/ – thomas_p Jun 13 '16 at 20:17