linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* tcgetattr() can set errno to 22 / EINVAL
@ 2025-11-03 12:45 Дилян Палаузов
  2025-11-03 13:20 ` Alejandro Colomar
  0 siblings, 1 reply; 4+ messages in thread
From: Дилян Палаузов @ 2025-11-03 12:45 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

Hello,

please amend the errors at https://man7.org/linux/man-pages/man3/tcgetattr.3p.html that the function tcgetattr() can set errno to EINVAL 22 Invalid argument for /dev/hidraw files.

Using kernel 6.6.60 on armv7l and libc 2.36 (where tcgetattr is implemented in termios/tcgetattr.c as ioctl(fd, TCGETS, …)), this program


#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <termios.h>

void main() {
  int fd = open("/dev/hidraw0", O_RDWR | O_NONBLOCK |O_NOCTTY);
  struct termios s;
  errno = 0;
  int ret = tcgetattr(fd, &s);
  printf("Returned fd is %i ret is %i errno is %i %m\n", fd, ret, errno);
}


puts:

Returned fd is 3 ret is -1 errno is 22 Invalid argument

Well at https://pubs.opengroup.org/onlinepubs/9799919799/functions/tcgetattr.html  Open Group Base Specifications Issue 8/year 2024 also says only EBADF and ENOTTY.


Kind regards
  Дилян

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tcgetattr() can set errno to 22 / EINVAL
  2025-11-03 12:45 tcgetattr() can set errno to 22 / EINVAL Дилян Палаузов
@ 2025-11-03 13:20 ` Alejandro Colomar
  2025-11-06 12:38   ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2025-11-03 13:20 UTC (permalink / raw)
  To: Дилян Палаузов
  Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 2440 bytes --]

Hi Дилян,

On Mon, Nov 03, 2025 at 02:45:06PM +0200, Дилян Палаузов wrote:
> Hello,
> 
> please amend the errors at https://man7.org/linux/man-pages/man3/tcgetattr.3p.html that the function tcgetattr() can set errno to EINVAL 22 Invalid argument for /dev/hidraw files.

You should file a bug to the Austin Group, which is the group
responsible for the POSIX standard.

That manual page is just a formatted copy of the POSIX standard.  See
the COPYRIGHT section:

COPYRIGHT
       Portions of this text are reprinted and reproduced in electronic
       form from IEEE Std 1003.1-2017, Standard for Information
       Technology -- Portable Operating System Interface (POSIX), The
       Open Group Base Specifications Issue 7, 2018 Edition, Copyright
       (C) 2018 by the Institute of Electrical and Electronics Engineers,
       Inc and The Open Group.  In the event of any discrepancy between
       this version and the original IEEE and The Open Group Standard,
       the original IEEE and The Open Group Standard is the referee
       document. The original Standard can be obtained online at
       http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page
       are most likely to have been introduced during the conversion of
       the source files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .

IEEE/The Open Group               2017                TCGETATTR(3POSIX)


Have a lovely day!
Alex

> Using kernel 6.6.60 on armv7l and libc 2.36 (where tcgetattr is implemented in termios/tcgetattr.c as ioctl(fd, TCGETS, …)), this program
> 
> 
> #include <errno.h>
> #include <fcntl.h>
> #include <stdio.h>
> #include <termios.h>
> 
> void main() {
>   int fd = open("/dev/hidraw0", O_RDWR | O_NONBLOCK |O_NOCTTY);
>   struct termios s;
>   errno = 0;
>   int ret = tcgetattr(fd, &s);
>   printf("Returned fd is %i ret is %i errno is %i %m\n", fd, ret, errno);
> }
> 
> 
> puts:
> 
> Returned fd is 3 ret is -1 errno is 22 Invalid argument
> 
> Well at https://pubs.opengroup.org/onlinepubs/9799919799/functions/tcgetattr.html  Open Group Base Specifications Issue 8/year 2024 also says only EBADF and ENOTTY.
> 
> 
> Kind regards
>   Дилян

-- 
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tcgetattr() can set errno to 22 / EINVAL
  2025-11-03 13:20 ` Alejandro Colomar
@ 2025-11-06 12:38   ` Florian Weimer
  2025-11-06 13:12     ` Дилян Палаузов
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2025-11-06 12:38 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: Дилян Палаузов,
	linux-man

* Alejandro Colomar:

> On Mon, Nov 03, 2025 at 02:45:06PM +0200, Дилян Палаузов wrote:
>> Hello,
>> 
>> please amend the errors at https://man7.org/linux/man-pages/man3/tcgetattr.3p.html that the function tcgetattr() can set errno to EINVAL 22 Invalid argument for /dev/hidraw files.
>
> You should file a bug to the Austin Group, which is the group
> responsible for the POSIX standard.

According to Andreas Schwab, it's a bug in the device driver.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: tcgetattr() can set errno to 22 / EINVAL
  2025-11-06 12:38   ` Florian Weimer
@ 2025-11-06 13:12     ` Дилян Палаузов
  0 siblings, 0 replies; 4+ messages in thread
From: Дилян Палаузов @ 2025-11-06 13:12 UTC (permalink / raw)
  To: Florian Weimer, Alejandro Colomar; +Cc: linux-man

Hello,

all I can do is to write at linux-input@vger.kernel.org : https://lore.kernel.org/linux-input/24eaed9105633d03eded13e11c5a994bd93a81aa.camel@aegee.org/ .

Writing a report in the Austing Group Mantis BT, requires an answer from the chair, that an account is created.

> According to Andreas Schwab, it's a bug in the device driver
… at https://sourceware.org/bugzilla/show_bug.cgi?id=33597 .

Greetings // Дилян

-----Original Message-----
From: Florian Weimer <fweimer@redhat.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: Дилян Палаузов <dilyan.palauzov@aegee.org>, linux-man@vger.kernel.org
Subject: Re: tcgetattr() can set errno to 22 / EINVAL
Date: 06/11/25 14:38:44

* Alejandro Colomar:

> On Mon, Nov 03, 2025 at 02:45:06PM +0200, Дилян Палаузов wrote:
>> Hello,
>> 
>> please amend the errors at https://man7.org/linux/man-pages/man3/tcgetattr.3p.html that the function tcgetattr() can set errno to EINVAL 22 Invalid argument for /dev/hidraw files.
>
> You should file a bug to the Austin Group, which is the group
> responsible for the POSIX standard.

According to Andreas Schwab, it's a bug in the device driver.

Thanks,
Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-06 13:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-03 12:45 tcgetattr() can set errno to 22 / EINVAL Дилян Палаузов
2025-11-03 13:20 ` Alejandro Colomar
2025-11-06 12:38   ` Florian Weimer
2025-11-06 13:12     ` Дилян Палаузов

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).