Roland Mainz <roland.mainz at nrubsig.org> wrote:

> Uhm... you are aware that this may break SMF's inetd services (inetd
> uses |libc::wordexp()| which uses a secret switch in Solaris's
> /usr/bin/ksh to do the word expansion. Unfortunately ksh93 does not
> support the "secret switch"-hack which causes |libc::wordexp()| to fail
> and this renderes inetd defunct. We have a solution in the
> ksh93-integration prototype004 tree which replaces the original
> |libc::wordexp()| function with a version which uses ksh93 instead...
> but that requires to replace your libc.so.1 libraries with the patched
> version...) ?

Did you find a way that allows to use wordexp() as a plain function with 
no system() call to ksh without the need to replace stdio by sfio?

Note that some time ago, I tried to find out how it might be possible to
let ksh93 use libfind. From our discussions at ODDEVCON, it turns out that
we would need two separate wrapper sourcefiles. One compiled against sfio
and the other compiled against stdio:

a.c:    (compiled against sfio)

int
b_find(int ac, char **av, void *xxx)
{
        int i, o, e;

        i = fileno(stdin);
        o = fileno(stdout);
        e = fileno(stderr);

        return xfind(ac, av, dup(i), dup(o), dup(e));
}

-----

b.c: (compiled against stdio)

int
xfind(int ac, char **av, int i, int o, int e)
{
        int     ret;
        FILE    *std[3];

        std[0] = fdopen(i, "r+");
        std[1] = fdopen(o, "w");
        std[2] = fdopen(e, "w+");
        ret = bfind(ac, av, std);       /* <----- real find call */
        fclose(std[0]);
        fclose(std[1]);
        fclose(std[2]);
        return (ret);
}

Note that I did explicitely omit other problems like the need for a wrapper
to catch interrupts in order to point to the sfio problem only.

J?rg

-- 
 EMail:joerg at schily.isdn.cs.tu-berlin.de (home) J?rg Schilling D-13353 Berlin
       js at cs.tu-berlin.de                (uni)  
       schilling at fokus.fraunhofer.de     (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

Reply via email to