mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: Compatability: missing sys/vm86.h
Date: Thu, 12 Apr 2012 20:18:51 -0400	[thread overview]
Message-ID: <20120413001851.GG7281@brightrain.aerifal.cx> (raw)
In-Reply-To: <20120412165912.403fc411@newbook>

On Thu, Apr 12, 2012 at 04:59:12PM -0700, Isaac Dunham wrote:
> The version of Xvesa I'm dealing with also needs sys/io.h, I later
> realized.  Not sure whether that's needed for Xfbdev, though.

It shouldn't be needed by Xfbdev, but last I checked (mind you this
was 5+ years ago), Xfbdev was doing all kinds of idiotic things that
made it need root for no good reason... like reprogramming the
keyboard controller to minimum repeat rate rather than respecting the
preexisting setting.

With that said, I think the arguments for including this junk, despite
it being junk, are becoming compelling, and I'll probably just go
ahead and do it.

> This is the only way to access BIOS calls from Linux; unfortunately,
> using the BIOS is necessary for proper screen setup/resume on some machines.  

This should really be fixed at the driver level (writing the correct
driver code rather than calling out to potentially-buggy/dangerous
BIOS code that might even contain trojans installed when another OS
was running and flashed the BIOS secretly), but demanding that it be
fixed is outside the scope/authority of musl... :(

> I also noticed that it's using __uid_t & __gid_t, which appear to be
> replaced by uid_t & gid_t in musl.  It may be wrong/unportable to depend
> on implementation-specific stuff (__*), but I've seen these several
> times before (a LOT of stuff won't build without modification).  What's
> the proper approach here? Define the old types all the time (strictly
> speaking, it's in the implementation-reserved namespace), only if the
> proper macros are defined, or expect people to fix the code?

This is something I intend to stand firm on. Software using type names
in the reserved namespace is absolutely broken, has no excuse for
doing so, and needs to be fixed. Please file bug reports.

The reason glibc defines the __-prefixed type names is that,
sometimes, a header needs to prototype a function that requires an
argument of that type, or define a structure containing an element of
that type (usually a nonstandard extension element of the structure
whose name is itself __-prefixed), without exposing the name of the
type. These type names were never intended to be used by applications
whatsoever. If an application is trying to use uid_t or similar and
finding that it's not defined, that means either the application has
failed to include the right headers or define the right feature test
macros. (And since glibc defines almost everything by default when no
feature test macros are present, it almost surely just means the
application is not including the right header.) Of course, usually,
the right header has already been included and just fixing the type
name will make the application work without any further effort.

If this problem is as widespread as you say, it may be worthwhile to
write a utility that recursively runs sed on a source tree, fixing all
instances, and generates a patch to send upstream...

Rich


  reply	other threads:[~2012-04-13  0:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 20:00 Isaac Dunham
2012-04-12  2:35 ` Rich Felker
2012-04-12 23:59   ` Isaac Dunham
2012-04-13  0:18     ` Rich Felker [this message]
2012-04-13  2:45       ` sed unmacro Isaac Dunham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120413001851.GG7281@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

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).