mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Embed cocmd.com interpreter for system() / open()
This change lets you use system() in an easier and portable way. The problem with the call in the past has always been that bourne and cmd.com on Windows have less than nothing in common, so pretty much the only command system() could be used for across platforms was maybe echo. cmd.exe is also a security liability due to its escaping rules. Since cocmd.com implements 85% of what we need from bourne, in a really tiny way, it makes perfect sense to be embedded in these functionss. We get a huge performance boost too. Fixes #644
This commit is contained in:
parent
daca5499b9
commit
950a1b310b
9 changed files with 313 additions and 320 deletions
|
@ -1,17 +1,10 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_PATHS_H_
|
||||
#define COSMOPOLITAN_LIBC_PATHS_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const char *_PATH_BSHELL;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
||||
#define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
|
||||
#define _PATH_STDPATH "/bin:/usr/bin:/sbin:/usr/sbin"
|
||||
|
||||
#define _PATH_BSHELL _PATH_BSHELL
|
||||
#define _PATH_BSHELL "/bin/sh"
|
||||
#define _PATH_CONSOLE "/dev/console"
|
||||
#define _PATH_DEVNULL "/dev/null"
|
||||
#define _PATH_KLOG "/proc/kmsg"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue