On Mon, May 15, 2006 at 03:33:43PM -0700, Jonathan Adams wrote:
> On Tue, May 16, 2006 at 12:00:32AM +0200, Roland Mainz wrote:
> >
> > Hi!
> >
> > ----
> >
> > This is slightly offtopic but due lack of a better list for this I am
> > asking this here:
> > Does Solaris have any C API (maybe something in libc ?) which works like
> > /usr/bin/clear but does not require a |fork()| (=expensive call) nor
> > uses libcurses/libncurses (e.g. adds another library dependicy) ?
>
> No. If you do:
> system("/usr/bin/clear");
> or
> system("exec /usr/bin/tput clear 2>/dev/null");
>
> you might avoid *some* of the expense (since, as of Solaris 10, system()
> uses vfork(), even on multi-threaded processes. So the "duplicating
> the address space just to tear it down at exec() time" cost is gone.
>
> On the other hand, you're still stopping all of the threads in the process
> until the forked thread reaches exec(). So there's a balance.
And, in any case, linking against libcurses is *much* cheaper.
Cheers,
- jonathan
--
Jonathan Adams, Solaris Kernel Development
_______________________________________________
opensolaris-discuss mailing list
[email protected]