user170942
user170942

Reputation:

Reason for mutliple syscall in Linux

I was wondering, what is the reason for having _syscall0 to _syscall6 in Linux to handle different number of parameters. Are there any security/performance issues with having just _syscall6 alone and letting calling code pass in null values for unused parameters?

Upvotes: 1

Views: 131

Answers (1)

osgx
osgx

Reputation: 94165

It is needed to decrease number of needed register copy and improve performance.

Each parameter needs to be moved form user's ABI into parameter-passing convention inside the kernel.

Also, some of such syscalls behaves differently with address parameters. But such conversion is needed on little number of archs.

Upvotes: 1

Related Questions