* system now passes a bytevector to ik_system.

This commit is contained in:
Abdulaziz Ghuloum 2007-05-18 22:15:52 -04:00
parent 862871a787
commit b54cc9a762
5 changed files with 10 additions and 2 deletions

Binary file not shown.

View File

@ -672,7 +672,12 @@ ikp ik_close(ikp fd){
ikp ikp
ik_system(ikp str){ ik_system(ikp str){
return fix(system(string_data(str))); if(tagof(str) == bytevector_tag){
return fix(system((char*)str+off_bytevector_data));
} else {
fprintf(stderr, "bug in ik_system\n");
exit(-1);
}
} }
static char* static char*

Binary file not shown.

View File

@ -30,7 +30,8 @@
(lambda (x) (lambda (x)
(unless (string? x) (unless (string? x)
(error 'system "~s is not a string" x)) (error 'system "~s is not a string" x))
(let ([rv (foreign-call "ik_system" x)]) (let ([rv (foreign-call "ik_system"
(string->utf8-bytevector x))])
(if (fx= rv -1) (if (fx= rv -1)
(error 'system "failed") (error 'system "failed")
rv)))) rv))))

View File

@ -467,6 +467,8 @@
[immediate? i] [immediate? i]
[pointer-value i] [pointer-value i]
[system i]
[installed-libraries i] [installed-libraries i]
[compile-core-expr-to-port $boot] [compile-core-expr-to-port $boot]
[current-primitive-locations $boot] [current-primitive-locations $boot]