Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 1996 11:32:38 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        kaleb@x.org (Kaleb S. KEITHLEY)
Cc:        terry@lambert.org, joerg_wunsch@uriah.heep.sax.de, chat@freebsd.org
Subject:   Re: Forgiving select() call.
Message-ID:  <199605281832.LAA11511@phaeton.artisoft.com>
In-Reply-To: <199605281759.NAA19371@exalt.x.org> from "Kaleb S. KEITHLEY" at May 28, 96 01:59:51 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > Solaris as of 2.3 implementes it as a system call.  I pointed out two
> > bugs in the library implementation:
> 
> I'm really not sure what you're talking about Terry. There's no select 
> in /usr/include/sys/syscall.h in Solaris 2.4 or 2.5. The only man page
> is in section 3C. A trivial program that calls select(), linked with 
> libc only, can be seen  to call poll when run in truss. nm dumps of the 
> shared libs reveal no functions named select or _select save the one in 
> libc. A nm dump of select.o from libc.a shows a reference to _poll.

It's a hidden call.  You have to compile in SunOS 4.x compatability
mode.


> Either you're refering to some secret undocumented system call that you
> know about by virtue of seeing the sources, or something that's an extra 
> cost add-on. But I suspect there is no such secret undocumented system
> call, if only because if there was one, Sun would be using it themselves;
> but they aren't, as a truss of /usr/openwin/bin/Xsun will show -- they
> call poll.

Nope.  It's in the 2.3 release notes about support for SunOS 4.x
statically linked binaries.  No source code viewing required, just a
bit of puttering around.  Like system call LKM's in SunOS 4.x.

> I guess that includes Solaris as one of those "silly non-SVID III 
> compliant" implementations. Unixware too. I wonder how Univel could 
> have made such an egregious mistake -- there's no reference to a select 
> system call in their "Programming with System Calls" reference. None
> in the AT&T book either. You'll have to point me to where in the SVID 
> it says that a particular library routine must make a call to the system 
> at all, much less to a system call with the same name, in order to be
> SVID compliant.

SVID III Volume 5: Real Time extensions, where select/getitimer/setitimer
and gettimeofday are defined.

I complained bitterly about UnixWare, even to the point of rewriting
the timer code and implementing the thing for them.

I complained once for Solaris, and they fixed it in their 6 month
guaranteed turnaround.  SunSoft is slow, but it's steady.


> If there's a secret undocumented select system call in Solaris, I'd
> like to know about it, with something more than anecdotal evidence!

1)	Build a static SunOS 4.1.3 binary that calls select(2).
2)	Run it on Solaris 2.2 (watch it ENOSYS).
3)	Run it on Solaris 2.3 (watch it work).


It's there.  But like the BSD 4.4 "HIDDEN" attribute for the "undelete"
and "whiteout" system calls, the calls do exist, even if the syscalls.h
doesn't openly admit it.

Use syscall( 93, ...) in place of a select(2) stub.  I'm not sure if
the magic number is significant; you may actually get select(2) if you
use /usr/ucb/cc (the compatability compiler).

Personally, except for threading, I develop for Solaris using SunOS.


					Regards,
					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605281832.LAA11511>