[PATCH] linux: Add generic ioctl implementation

Adhemerval Zanella adhemerval.zanella@linaro.org
Mon Nov 22 12:53:34 GMT 2021



On 19/11/2021 21:11, Stafford Horne wrote:
> On Fri, Nov 19, 2021 at 04:58:52PM -0300, Adhemerval Zanella wrote:
>> The powerpc is refactor to use the default implementation.
>> ---
>>  sysdeps/unix/sysv/linux/internal-ioctl.h      | 23 +++++++
>>  sysdeps/unix/sysv/linux/ioctl.c               | 49 +++++++++++++
>>  .../unix/sysv/linux/powerpc/internal-ioctl.h  | 46 +++++++++++++
>>  sysdeps/unix/sysv/linux/powerpc/ioctl.c       | 68 -------------------
>>  4 files changed, 118 insertions(+), 68 deletions(-)
>>  create mode 100644 sysdeps/unix/sysv/linux/internal-ioctl.h
>>  create mode 100644 sysdeps/unix/sysv/linux/ioctl.c
>>  create mode 100644 sysdeps/unix/sysv/linux/powerpc/internal-ioctl.h
>>  delete mode 100644 sysdeps/unix/sysv/linux/powerpc/ioctl.c
>>
>> diff --git a/sysdeps/unix/sysv/linux/internal-ioctl.h b/sysdeps/unix/sysv/linux/internal-ioctl.h
>> new file mode 100644
>> index 0000000000..697b086703
>> --- /dev/null
>> +++ b/sysdeps/unix/sysv/linux/internal-ioctl.h
>> @@ -0,0 +1,23 @@
>> +/* Linux internal definitions for ioctl.
>> +   Copyright (C) 2021 Free Software Foundation, Inc.
>> +   This file is part of the GNU C Library.
>> +
>> +   The GNU C Library is free software; you can redistribute it and/or
>> +   modify it under the terms of the GNU Lesser General Public
>> +   License as published by the Free Software Foundation; either
>> +   version 2.1 of the License, or (at your option) any later version.
>> +
>> +   The GNU C Library is distributed in the hope that it will be useful,
>> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> +   Lesser General Public License for more details.
>> +
>> +   You should have received a copy of the GNU Lesser General Public
>> +   License along with the GNU C Library.  If not, see
>> +   <https://www.gnu.org/licenses/>.  */
>> +
> 
> Should we have a comment here explaining why this is needed.
> 
> Something like:
> 
> /* Architecture ports may choose to override this default implementation
>   to provide architecture specific ioctl support.  For example see powerpc.  */

Sounds reasonable, I will update the patch.


More information about the Libc-alpha mailing list