Re:Apple's libc shells out to Perl to implement wordexp
by mrpippy on Tuesday February 10, 2015 @02:29AM
(#9025838)
The current one is a derivative of NetBSD's implementation (where it shells out to use a sh builtin)
[ Parent
| on HN ]
Re:Apple's libc shells out to Perl to implement wordexp
by lloeki on Tuesday February 10, 2015 @03:24AM
(#9025956)
License-wise:
- this piece of code is 2BSD-licensed
- it calls out to /bin/sh
- on OS X, /bin/sh is hardlinked to /bin/bash
- OS X's bash is GPLv2
Forking to shell is the only way to reuse bash's code. More often than not I really wish sh were not bash.
Re:Apple's libc shells out to Perl to implement wordexp
by _ZeD_ on Tuesday February 10, 2015 @05:55AM
(#9026430)
"Forking to shell is the only way to reuse bash's code."
well, the other obvius way is to license this piece of code as GPLv2.
Re:Apple's libc shells out to Perl to implement wordexp
by yetihehe on Tuesday February 10, 2015 @06:20AM
(#9026506)
AFAIK this is THE reason for GPL. So that you either release your code and contribute to open source or suffer from slower access methods.
Re:Apple's libc shells out to Perl to implement wordexp
by feld on Tuesday February 10, 2015 @08:57AM
(#9027078)
The BSDs doesn't ship with bash and their wordexp shelling out to /bin/sh doesn't suffer, so I don't see how this is a reason for the GPL.
Re:Apple's libc shells out to Perl to implement wordexp
by yetihehe on Tuesday February 10, 2015 @11:50AM
(#9028288)
Probably I've written it not clearly enough: "Reason for GPL not allowing you to use code in your own programs, but allowing use through exec: you either release your code and contribute to open source or suffer from slower access methods."
Re:Apple's libc shells out to Perl to implement wordexp
by feld on Tuesday February 10, 2015 @03:40PM
(#9029752)
ahh, ok; that's clearer
Re:Apple's libc shells out to Perl to implement wordexp
by tedunangst on Tuesday February 10, 2015 @07:36AM
(#9026735)
Which would require libc to be GPL, something not even glibc does.
Re:Apple's libc shells out to Perl to implement wordexp
by dxq on Tuesday February 10, 2015 @02:34AM
(#9025849)
Judging by both the source code and its placement in the repository (gen/FreeBSD/wordexp.c), I'm thinking it's a derivative of the FreeBSD implementation (which may itself be a derivative of the NetBSD implementation, or perhaps the other way around).
Re:Apple's libc shells out to Perl to implement wordexp
by JoachimS on Tuesday February 10, 2015 @04:25AM
(#9026132)
Yes, the OSX code seems to come from FreeBSD. Here is the FreeBSD version of the source:
https://github.com/freebsd/freebsd/blob/master/lib/libc/gen/...
It looks very similar to the current OSX file posted in an earlier comment. Calls /bin/sh too.