On Thu, Mar 04, 2010 at 04:17:25PM -0500, David Korn wrote: > > A few questions: > > > > - Where are docs for how to use nv_*()? > It should be in man/man3/nval.3.
Oh dear, I don't find that in pkg.opensolaris.org. I suspect we never packaged it :( Perhaps it the interfaces for builtins were not ARCed as Public interfaces? If so, where would I find the sources so I can read the manpages there? > > - Does errormsg() produce non-local exits? (my experiments say "yes") > Not if ERROR_warn(0) is used. Otherwise, it will do a siglongjmp() > down to an earlier context. Ah, thanks. > > Are there docs for all ksh93 internals that builtin authors are > > allowed to use? If so, where? > The man/man3/shell.3 and man/man3/nval.3 document all the currently > advertized interfaces. You can also use ast library calls and many > C library calls. I don't think we document an AST interfaces either. Where would I find sources? > You can't fork/exec process and wait for children. Actually... one could, using forkx(2), a Solaris extension that allows you to fork child processes whose death will not trigger SIGCHLD and which cannot be waited for using wait(), waitid(P_ALL), or waitid(P_PGID). (IMO Linux, *BSD, ought to grow a forkx(2) as well.) > > - Is there any way to write builtins portably to Bash and ksh93 > > equally? > I don't know what bash has for this. The ksh93 interface has been > available for around 15 years (with several small changes). Ok. Bash does have a builtin interface that's not too unlike Ksh93's, I think. > > With this you can access the file event monitor facility directly from > > the shell: > > > > [...] > > You might also consider adding some of these as object orient interfaces > create an Event type and having callback functions associated with > each event. Interesting. I might. But simple is good. I'm writing a simulator for a project of mine that involves simulating a network. It's very simple and uses Roland's poll() interface. If I had pipe(2) and/or socket interfaces I'd make use of them too. Thanks, Nico --