[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 20/22] Implement shmctl(2)
From: |
Karim Taha |
Subject: |
Re: [PATCH 20/22] Implement shmctl(2) |
Date: |
Sat, 09 Sep 2023 04:59:31 +0300 |
Richard Henderson <richard.henderson@linaro.org> wrote:
> On 8/19/23 02:48, Karim Taha wrote:
>> + switch (cmd) {
>> + case IPC_STAT:
>> + case IPC_SET:
>> + if (target_to_host_shmid_ds(&dsarg, buff)) {
>> + return -TARGET_EFAULT;
>> + }
>> + ret = get_errno(shmctl(shmid, cmd, &dsarg));
>> + if (host_to_target_shmid_ds(buff, &dsarg)) {
>> + return -TARGET_EFAULT;
>> + }
>> + break;
>
> IPC_STAT treats buff as output, IPC_SET treats buff as input,
> so these cases can't be combined.
>
>
> r~
I think they can be combined:
1- we marshal the struct `buff` from target to host
2- call `shmctl`
3- marshal the results back.
--
Karim Taha
- Re: [PATCH 20/22] Implement shmctl(2),
Karim Taha <=