[lkml]   [2001]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: increase the number of system call parameters
    In article <>,
    =?iso-8859-1?Q?Roar_Thron=E6s?= <> writes:
    > Hi
    > (I am sorry if this question has been asked and answered before)

    > How do you increase the number of system call parameters, and how many
    > can you at most have?

    You can have upto 6 argument on i386. Each argument needs an register
    to pass and the i386 has only 8 and two are used for the stack pointer
    and the syscall number. This leaves you 6.
    Other architectures may not have that limitation.

    > Would up to 12 parameters be possible, and how?

    Yes. Just pass a pointer to an auxillary structure as the first argument
    and do a copy_from_user on that structure at the entry point. Put the
    arguments in that structure. In user space you can hide the structure in a

    Some system calls (mmap, old_select, socketcall) are in fact implemented
    like this because they were designed before the entry point supported
    6 arguments.

    A note on design: if you have a function call that needs 12 arguments you
    probably forgot some[1] (in short it is a strong cue for a broken design,
    you should probably split it in smaller calls)


    [1] unknown author
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:08    [W:0.023 / U:13.908 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site