Search code examples
cmakefileminix

Implementing Minix 3.3 system call as libc library call


I've been following this tutorial to create a system call in Minix.

http://homepages.cs.ncl.ac.uk/nick.cook/csc2025/minix/syscall-exercise1.html

I can use the system call correctly when I use _syscall and now I would like to create a libc library function to allow it to be easily used. However, following the last steps of the tutorial are not working for me. When I try to compile my code, I receive undefined reference to [my library function]. I've added the prototype to unistd.h, I think something is going wrong in my Makefile. All I did was add SRCS += myfile.c. Is there something more I need to do?


Solution

  • Ok, so I was putting SRCS+=... in libc/sys/Makefile.inc but this Makefile is mostly under a conditional which I just realized is false. I moved over to libc/misc and added everything there and it worked like a charm.