tech-kern archive

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

Re: Proposal to obsolete SYS_pipe



In article <c8481ddb-d284-3dfd-1b79-5271e987d03d%gmx.com@localhost>,
Kamil Rytarowski  <n54%gmx.com@localhost> wrote:
>-=-=-=-=-=-
>-=-=-=-=-=-
>
>On 25.12.2017 16:37, Kamil Rytarowski wrote:
>> On 24.12.2017 22:25, Kamil Rytarowski wrote:
>>> I propose to deprecate SYS_pipe.
>>>
>>> It is a special syscall that returns two integers from one function
>>> call. Fanciness is not compatible with regular C syntax and it demands
>>> per-cpu assembly wrappers and rump-kernel workarounds. It's not easily
>>> usable with syscall(2).
>>>
>>> OpenBSD and FreeBSD already deprecated this traditional pipe(2) syscall
>>> replacing it with a more portable equivalent in C.
>>>
>>> Changes:
>>>  - I've marked pipe(2) as compat_80.
>>>  - I've removed generation of garbage in retval[2] from pipe2(2).
>>>  - I've reimplemented in C the pipe(2) syscall with pipe2(2).
>>>  - I've adjusted the surrounding code for the changes.
>>>
>>> http://netbsd.org/~kamil/patch-00039-obsolete-SYS_pipe.txt
>>>
>> 
>> I've extracted two patches from the above proposal.
>> 
>> In these patches SYS_pipe is not marked COMPAT_80 and not removed from
>> rump. I've left it as it is.
>> 
>> 1. Implement pipe() with pipe2(2) in libc:
>> 
>> New source code is now Machine Independent.
>> 
>> http://netbsd.org/~kamil/patch-00040-implement-pipe-with-pipe2-in-libc.txt
>> 
>> The generated code in libc for x86_64 is also simpler and shorter:
>> 
>> 000000000008b2a2 <_pipe>:
>>    8b2a2:       31 f6                   xor    %esi,%esi
>>    8b2a4:       e9 b7 f5 fa ff          jmpq   3a860 <pipe2@plt>
>> 
>> 2. Refactor pipe1() kernel-internal function to operate over int[2]
>> rather than register_t[2]. Stop returning garbage through retval[2] from
>> pipe2(2).
>> 
>
>http://netbsd.org/~kamil/patch-00041-refactor-pipe1.txt

That looks good too (the code is simpler).

christos



Home | Main Index | Thread Index | Old Index