LWN.net Logo

Heise reports from SCO Forum

Heise reports from SCO Forum

Posted Aug 19, 2003 15:24 UTC (Tue) by rfunk (subscriber, #4054)
In reply to: Heise reports from SCO Forum by BrucePerens
Parent article: Heise reports from SCO Forum

Well, the Lions book contains all of the Unix v6 kernel code, and it
wasn't quite legal until Caldera blessed it in 1995-1996-ish, after which
it was officialy published.

The book is divided into two parts -- the bare code listing, and the
commentary. This code appear in line 2522, sheet 25 of the code listing.
The commentary is on page 5-2.


(Log in to post comments)

Heise reports from SCO Forum

Posted Aug 19, 2003 15:30 UTC (Tue) by rfunk (subscriber, #4054) [Link]

As it appears in the Lions book:
 
/* 
 * Allocate size units from the given 
 * map. Return the base of the allocated 
 * space. 
 * Algorithm is first fit. 
 */ 
malloc(mp, size) 
struct map *mp; 
{ 
   register int a; 
   register struct map *bp; 
 
   for (bp = mp; bp->m_size; bp++) { 
           if (bp->m_size >= size) { 
                   a = bp->m_addr; 
                   bp->m_addr =+ size; 
                   if ((bp->m_size =- size) == 0) 
                       do { 
                           bp++; 
                           (bp-1)->m_addr = bp->m_addr; 
                       while((bp-1)->m_size = bp->m_size); 
                   return(a); 
           } 
   } 
   return(0); 
} 

Heise reports from SCO Forum

Posted Aug 19, 2003 18:03 UTC (Tue) by rfunk (subscriber, #4054) [Link]

Oops, I missed a closing brace in this line:
 
                       while((bp-1)->m_size = bp->m_size); 
Should be:
 
                       } while((bp-1)->m_size = bp->m_size); 

Heise reports from SCO Forum

Posted Aug 19, 2003 15:32 UTC (Tue) by rfunk (subscriber, #4054) [Link]

Oops, it was the Santa Cruz Operation that blessed it, not Caldera.
Caldera didn't get the rights until later, then they opened it all under
the BSD-style license.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds