A few questions:
- Where are docs for how to use nv_*()?
- Does errormsg() produce non-local exits? (my experiments say "yes")
Are there docs for all ksh93 internals that builtin authors are
allowed to use? If so, where?
- Is there any way to write builtins portably to Bash and ksh93
equally?
- How would one go about integrating more Solaris-specific builtins?
I'm interested in integrating builtins for:
- event ports
- pipe(2)
- sockets
I have a webrev for Solaris event ports builtins right now, and it
works:
http://cr.opensolaris.org/~nico/onnv-ksh93-w-evport/
With this you can access the file event monitor facility directly from
the shell:
% builtin -f $ROOT/usr/lib/amd64/libshell.so.1 evport evport_create open
% close evport_assoc evport_dissoc evport_get stat date
% evport create p
% ev=(events=FILE_MODIFIED user=1234567 src=file fo_name=/tmp)
% nev=()
% evport assoc p ev
% evport get p nev
% print $nev
( fo_name=/tmp revents=FILE_MODIFIED src=PORT_SOURCE_FILE user=1234567 )
%
Alert, timers and user-defined event sources not yet supported. I doubt
I'd ever bother with MQ event sources, and AIO makes no sense in the
shell. (Also, the timeout handling is broken, so don't pass a timeout
to evport_get yet.)
Along the same lines one might add builtins for interfacing to libevent.
That would be portable, unlike the event port scheme, though it wouldn't
include a FEM interface (I think).
Nico
--