qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 13/19] linux-user: Split out close, open, ope


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v3 13/19] linux-user: Split out close, open, openat, read, write
Date: Fri, 22 Jun 2018 10:39:03 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

On 06/22/2018 03:38 AM, Peter Maydell wrote:
>> +SYSCALL_IMPL(close)
>> +{
>> +    fd_trans_unregister(arg1);
>> +    return get_errno(close(arg1));
>> +}
>> +SYSCALL_DEF(close, ARG_DEC);
> 
> If in future we wanted to extend the set of information
> we had for each syscall in the SyscallDef struct, I guess
> we'd add parameters to the SYSCALL_DEF macro (or have
> more variant macros)? I can't offhand think of something I'd
> want to use that for, so it's a bit of an abstract question
> for the moment.

Yes, I imagine we'd extend the SYSCALL_DEF macro(s) in that case.

Another thought I've had is to define variant SYSCALL_IMPL<N> macros that would
allow us to put names to arguments, and help make the implementations clearer.
E.g.

SYSCALL_IMPL1(close, fd)
{
    fd_trans_unregister(fd);
    return get_errno(close(fd));
}


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]