mailing list of musl libc
 help / color / mirror / Atom feed
* [musl] MUSL not including <sys/ttydefaults.h> in <sys/ioctl.h>
@ 2020-01-29 12:50 Petr Vorel
  2020-01-29 15:49 ` Rich Felker
  2020-01-29 15:55 ` Szabolcs Nagy
  0 siblings, 2 replies; 3+ messages in thread
From: Petr Vorel @ 2020-01-29 12:50 UTC (permalink / raw)
  To: musl

Hi,

Glibc is including <sys/ttydefaults.h> in <sys/ioctl.h> with following comment:

/* On a Unix system, the system <sys/ioctl.h> probably defines some of
   the symbols we define in <sys/ttydefaults.h> (usually with the same
   values).  The code to generate <bits/ioctls.h> has omitted these
   symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>
   to define them, so we must include <sys/ttydefaults.h> here.  */

I guess glibc is (as usual) wrong and therefore users who needs these
definitions should load also <sys/ttydefaults.h> explicitly.

Kind regards,
Petr

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

* Re: [musl] MUSL not including <sys/ttydefaults.h> in <sys/ioctl.h>
  2020-01-29 12:50 [musl] MUSL not including <sys/ttydefaults.h> in <sys/ioctl.h> Petr Vorel
@ 2020-01-29 15:49 ` Rich Felker
  2020-01-29 15:55 ` Szabolcs Nagy
  1 sibling, 0 replies; 3+ messages in thread
From: Rich Felker @ 2020-01-29 15:49 UTC (permalink / raw)
  To: musl

On Wed, Jan 29, 2020 at 01:50:12PM +0100, Petr Vorel wrote:
> Hi,
> 
> Glibc is including <sys/ttydefaults.h> in <sys/ioctl.h> with following comment:
> 
> /* On a Unix system, the system <sys/ioctl.h> probably defines some of
>    the symbols we define in <sys/ttydefaults.h> (usually with the same
>    values).  The code to generate <bits/ioctls.h> has omitted these
>    symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>
>    to define them, so we must include <sys/ttydefaults.h> here.  */
> 
> I guess glibc is (as usual) wrong and therefore users who needs these
> definitions should load also <sys/ttydefaults.h> explicitly.

ioctl.h isn't governed by any current standard, so we could include
sys/ttydefaults.h here, but I don't think it makes sense to. These
macros logically have nothing to do with the ioctl interface; rather
they go with termios. Programs that want them should probably be
including the header explicitly, or better yet not using them at all.

I also found a couple small issues in that header I'm fixing now.

Rich

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

* Re: [musl] MUSL not including <sys/ttydefaults.h> in <sys/ioctl.h>
  2020-01-29 12:50 [musl] MUSL not including <sys/ttydefaults.h> in <sys/ioctl.h> Petr Vorel
  2020-01-29 15:49 ` Rich Felker
@ 2020-01-29 15:55 ` Szabolcs Nagy
  1 sibling, 0 replies; 3+ messages in thread
From: Szabolcs Nagy @ 2020-01-29 15:55 UTC (permalink / raw)
  To: musl

* Petr Vorel <pvorel@suse.cz> [2020-01-29 13:50:12 +0100]:
> Hi,
> 
> Glibc is including <sys/ttydefaults.h> in <sys/ioctl.h> with following comment:
> 
> /* On a Unix system, the system <sys/ioctl.h> probably defines some of
>    the symbols we define in <sys/ttydefaults.h> (usually with the same
>    values).  The code to generate <bits/ioctls.h> has omitted these
>    symbols to avoid the conflict, but a Unix program expects <sys/ioctl.h>
>    to define them, so we must include <sys/ttydefaults.h> here.  */
> 
> I guess glibc is (as usual) wrong and therefore users who needs these
> definitions should load also <sys/ttydefaults.h> explicitly.

at some point i did some sys/ioctl.h cleanup
and i don't remember how conciously i omitted
the sys/ttydefaults.h include. (they are both
non-standard headers so in principle including
is ok)

sys/ttydefaults.h is more related to termios.h:
several TTYDEF_* macros depend on termios.h and
termios.h includes it on both glibc and bsd in
non-standard mode i think (termios.h is standard
header). it is weird to include things into
ioctl.h that don't work without termios.h.

i don't think bsd sys/ioctl.h includes it, but
ioctl is very os specific.

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

end of thread, other threads:[~2020-01-29 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 12:50 [musl] MUSL not including <sys/ttydefaults.h> in <sys/ioctl.h> Petr Vorel
2020-01-29 15:49 ` Rich Felker
2020-01-29 15:55 ` Szabolcs Nagy

mailing list of musl libc

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/musl

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 musl musl/ http://inbox.vuxu.org/musl \
		musl@inbox.vuxu.org
	public-inbox-index musl

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/musl/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git