ATT and UCB functions in the same program

Carl S. Gutekunst csg at pyramid.pyramid.com
Thu Dec 7 04:09:28 AEST 1989


In article <420 at massey.ac.nz> GEustace at massey.ac.nz (Glen Eustace) writes:
>I have just read a comment by Carl about 'att' programs using UCB
>networking?  How can you do this?

I *knew* I shouldn't have said that.

Mixing universes can be done either of two ways:

- Use the syscall(2) indirect system call to get the facility you want from
  the other universe. This works well for simple things, like flock(2) or
  gethostname(2).

- Separate your att and bsd needs into separate source files, compile them in
  their appropriate universes, and manually link in both libc.a's. This is the
  only reasonable way to do Berkeley networking, and was the technique used
  when we added BSD networking to HoneyDanBer UUCP.

The problem with mixing library modules *is* significant, and not for the weak
of heart. You (reasonably) can only have one of any given function. So things
that exist in both universe but are not compatible -- all of stdio, for exam-
ple -- will be accessible only to the source modules from one universe.

This actually worked out very well in adding BSD networking to HDB. tcpcall()
was excised from callers.c into its own source module, and compiled in the BSD
universe. It issued no stdio function calls, so it was very nearly a dropin. 

>We have wanted to use the x25 functions and the UCB socket functions in the
>same program. The x25 stuff is in the att libraries, the socket stuff in
>the ucb ones.

That's a bunch of rot. Just compile everything in the UCB universe. X.25 will
work just fine. (Actually, there is a problem with process groups that it does
do better in the att universe than the ucb universe. But unless you are making
unusually sophisticated use of signals and multitasking, you won't see it.)

<csg>



More information about the Comp.sys.pyramid mailing list