I'm adding an example to explain my point.
Let's take the following simple C Program:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define LEN 2048
char command[LEN+1];
int main(int argc, char *argv[]) {
int i;
for (i = 1; i < argc; i++) {
strcat(command, argv[i]);
strcat(command, " ");
}
printf("Executing command = %s...\n", command);
system(command);
printf("Done!\n");
return 0;
}
Let's compile it both as Native Windows (exec_win) and as Cygwin-64 (exec_cyg) and let's run it from within Cygwin-64...
Maurizio@MMNASUS /cygdrive/c/smart/prog/provec
$ exec_win which ls
/usr/bin/ls
Executing command = which ls ...
Done!
Maurizio@MMNASUS /cygdrive/c/smart/prog/provec
$ exec_cyg which ls
Executing command = which ls ...
/usr/bin/ls
Done!
Maurizio@MMNASUS /cygdrive/c/smart/prog/provec
$ exec_win ls c:\\tmp
Executing command = ls c:\tmp ...
Done!
Maurizio@MMNASUS /cygdrive/c/smart/prog/provec
$ exec_cyg ls c:\\tmp
Executing command = ls c:\tmp ...
ls: cannot access 'c:tmp': No such file or directory
Done!