SUMMARY: How to change SOLARIS libc

From: Matthew Donaldson (
Date: Tue Aug 22 1995 - 22:10:31 CDT

Hi all. A while ago I asked:

> For obscure reasons (like making netgroups work with files rather
> than NIS - grrrr why doesn't Sun EVER fix this?) I need to change the libc
> under Solaris 2.4. I know this is easy under SunOS, so on the Solaris box
> I go for the shlib.etc directory to find it is not there!
> I realise that most people do not need to change the libc anymore, but does
> anyone know how it might be done - either by getting hold of the modules that
> make it up (as per SunOS) or by linking in new .o files to replace selected
> functions?

Well, I got quite a good number of answers. The winning entry on how to change
libc came from Casper Dik <casper@Holland.Sun.COM>, who said:

> Look in /usr/lib/pics. There are all the objects needed for
> The right order of linking isn't given. (but can be reversed from
> Also link as:
> cc -dy -G <objects> -o -h -ldl
> link with "cc", not "ld".

The winner for telling me how to get netgroups working from files was
Chris Phillips <> who referred me to John DiMarco
( It would appear that Sun have implemented the front
end for netgroups properly, but have just not got around to producing a back
end that gets from from files. John DiMarco has written a shared library which
does this, so the libc does not have to be changed for this purpose. Copies
of his package can be obtained by mailing him, or from
in /pub/

Also, Dave Mitchell <> mentioned the use of the
LD_PRELOAD environment variable, which specifies .o files which are loaded
after your program but before any libraries.

Many thanks to all who replied:

"Chris Phillips" <> (Ernie Chan)
Ian MacPhedran <>
Leif Hedstrom <> (Ernie Chan) (Stephen Harris)
Todd Pfaff <todd@water.Eng.McMaster.CA> (Andy Feldt)
Dave Mitchell <>
Casper Dik <casper@Holland.Sun.COM>


| Matthew Donaldson Email: |
| Computer Science Department Phone: +61 8 303 5583 _ |
| University of Adelaide Fax: +61 8 303 4366 John / \/ |
| South Australia 5005 Telex: UNIVAD AA89141 3:16 \_/\ |

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:32 CDT