Thread (9 messages) 9 messages, 3 authors, 2011-04-27

Re: [PATCH] Applying inappropriate ioctl operation on socket should return ENOTTY

From: Eric Dumazet <hidden>
Date: 2011-04-27 06:57:45
Also in: lkml

Possibly related (same subject, not in this thread)

Le mercredi 27 avril 2011 à 14:37 +0800, Lifeng Sun a écrit :
On 07:58 Wed 04/27/11 Apr, Eric Dumazet wrote:
quoted
Really ?

EINVAL is ok too : Request or argp is not valid.
I'm afraid not. SUSv4 specifies, say,

  int tcsetattr(int fildes, int optional_actions,
         const struct termios *termios_p);

 ERROR:
  [EINVAL]
      The optional_actions argument is not a supported value, or an
      attempt was made to change an attribute represented in the
      termios structure to an unsupported value.

  [ENOTTY]
      The file associated with fildes is not a terminal.

which means when we apply tcsetattr (implemented by ioctl) to _any_
non-terminal file descriptor, it should set errno to ENOTTY rather
than EINVAL.
You quote manpage for a library call, not a system call.

If you feel your glibc doesnt implement well this, please complain to
glibc maintainer.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help