Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Aug 2014 17:32:55 -0600
From:      Chris Torek <torek@torek.net>
To:        Benjamin Kaduk <bjk@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Steven Stewart-Gallus <sstewartgallus00@mylangara.bc.ca>
Subject:   Re: Can anyone help clarify details about the FreeBSD system call interface?
Message-ID:  <201408292332.s7TNWtTr046045@elf.torek.net>
In-Reply-To: Your message of "Thu, 28 Aug 2014 16:35:44 -0400." <alpine.GSO.1.10.1408281618310.21571@multics.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
>>  int sys_sstk(int incr);
   [...]
>> Did sys_sstk use to do something in the past and is now just legacy?

>svn blame says that the whole implementation dates from r1541.  Looks like
>it was never implemented.  Some googling indicates that it was a planned
>routine to set the stack size, which was never implemented, anywhere.

It was the stack equivalent of sbrk().  Stacks always grew
automatically but could not be shrunk.  Before mmap/munmap, this
was supposed to let you pre-allocate the stack if you wanted, or
shrink it.

>>  int sys_vadvise(int anom);
  [...]
>> Did sys_vadvise use to do something in the past and is now just
>> legacy?

>The locking comments were added in r79224, but the implementation is
>otherwise from r1541, i.e., it was never implemented.

Again this is from the pre-mmap() days.  It actually did do
something once (in 4.1BSD), but when mmap() went in it was
replaced with madvise(), which is finer grained (per page rather
than entire process) and has more options.

(Franz Lisp used vadvise() when doing mark-and-sweep GC, if anyone
here remembers Franz Lisp from UCB. :-) Notifying the pager of
sequential behavior, where LRU is worst and you want MRU paging,
was helpful back when a VAX with 8 MB of RAM had a lot of memory.)

Chris



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