Reputation: 3585
I am implementing a program to run in user space as often as possible. So I am trying to call functions which enter and leave kernel space as less as possible. For example, I use some DMA API which read/write but bypass the kernel.
I don't know how to tell a function needs to enter kernel space or not. For example, I want to call getenv()
to get environment variables set by the host, but worrying it may pass my program and enter the kernel space. I cannot find this imformation from man pages. Here is the man page of getenv()
.
Upvotes: 1
Views: 169
Reputation: 440
Have you run your program through strace? That will let you know where you are making system calls that will enter kernel space
Upvotes: 4
Reputation: 196
I thinks most IO functions will cause your program to the kernel? Maybe you should check the system APIs that used by you
Upvotes: 0