Unable to exec scripts from Linuxator

Dmitry Sivachenko trtrmitya at gmail.com
Tue Apr 5 08:24:23 UTC 2016


Hello,

I have a C program which uses system() to execute another program.  Program is compiled under Linux and I run it on fresh FreeBSD-10 using Linuxator.

system() fails if it tries to execute a script, not a binary:

$ cat test.c 
#include <stdlib.h>
#include <stdio.h>

void main() {
  int i = system("/tmp/t.sh");
  printf("i=%d\n", i);
}
$ cat /tmp/t.sh
#!/usr/bin/env bash

echo "OK"
$

Compile test.c on Linux and run on FreeBSD:

$ ./a.out 
/compat/linux/usr/bin/env: h: No such file or directory
i=32512
$


More information about the freebsd-emulation mailing list