Re: wordexp() implementation without fork()
Sebastian Huber <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
On 05/08/2020 17:35, Joel Sherrill wrote: > Hi > > Having a single process wordexp() implementation has been on the RTEMS > POSIX wishlist for a while. I haven't been able to find one. The POSIX > method description > seems to hint that this implementation strategy is possible and the Linux > man page > uses the phrase "shell-like expansion". > > Does anyone know of an implementation that doesn't use fork()? Or an > implementation > strategy based around some open source wildcard evaluation? > > Or is this a POSIX method that is just unimplementable without multiple > processes? Can't you re-use parts of the shell implementation, e.g. freebsd_wordexpcmd() in https://github.com/freebsd/freebsd/blob/master/bin/sh/expand.c#L1507