Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Dec 2004 20:19:05 +0530
From:      Ravi Krishna <ravikrish@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   FreeBSD system call implementation
Message-ID:  <6669fd8604121506494c5afe65@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi !
I am new to bsd internals and was looking at the implementation of syscall
in sys/i386/i386/trap.c
here its seems we get the handler for the syscall by 
if (p->p_sysent->sv_mask)
                code &= p->p_sysent->sv_mask;

        if (code >= p->p_sysent->sv_size)
                callp = &p->p_sysent->sv_table[0];
        else
                callp = &p->p_sysent->sv_table[code];

and call using 

if (error == 0) {
                td->td_retval[0] = 0;
                td->td_retval[1] = frame.tf_edx;

                STOPEVENT(p, S_SCE, narg);

                PTRACESTOP_SC(p, td, S_PT_SCE);

                error = (*callp->sy_call)(td, args);
        }
My question is why we store the p->p_sysent->sv_table
for each process. What is the reason for keeping this per process?
Are there some situations where two processes can have different system calls
available?

Regards,
Ravi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6669fd8604121506494c5afe65>