Is there a limitation on wrapper function arguments in Unix?

Updated to clarify:

The Wrapper function is defined as a user-mode function that initiates system calls (in kernel mode). For example open or printf.

I'm wondering if there is any limit to the number of arguments that a wrapper function can receive?

My intuition is that there should be six because of the number of registers, but I'm not sure. I know that the system call is limited to six arguments. (I'm talking about 32bit and 64bit, where more registers exist).

thank

+3


source to share


1 answer


The Wrapper function is defined as a user-mode function that initiates system calls (in kernel mode). For example, open, or printf.

By your own definition, there is no limit to the number of arguments they can receive. printf

should have told you right away. (But note that open

it is itself a system call and has a limit on the number of arguments)

But when it comes to system calls such as open

, write

etc., Linux-x86 has a limit of 6 arguments . Read here why and how this is done.



Here is another SO post covering this in depth

What are the calling conventions for UNIX and Linux system calls on x86-64

0


source







All Articles