Subject: Re: sigreturn()
To: None <brezak@apollo.hp.com, mycroft@gnu.ai.mit.edu>
From: None <mycroft@gnu.ai.mit.edu>
List: port-i386
Date: 01/11/1994 16:43:25
   I'd like to keep the sel== 0 check for now until I determine if this is a Wine
   or Windows problem.

It's possible that WINE uses null selectors.  But we should not allow
them for either cs or ds.

   The intent was to check these things:

Well, your code definitely doesn't get that right.

      Shouldn't there also be a way for (e.g.) WINE to remove a selector?
      Currently there is not.

   [...]  I didn't find this API function in Mach or Linux though.

They may simply allow setting a LDT entry with the present bit off.  We
really don't need an extra function.

   You can't add a LDT entry unless it the present bit is checked.

It doesn't matter.  You can still try to use an empty LDT slot, in which
case you (once again) panic.  The chip is not happy loading segments with
the present bit off.


BTW, also note that if you allow removing selectors, you need to check if
the selector is in use by the process and either fail the syscall or set
the segment registers to the null selector.

(But again, if it's cs or ss, you need to trap.)


------------------------------------------------------------------------------