solotim
solotim

Reputation: 1866

Does Solaris have a problem with popen?

Please have a look on this code:

#include <unistd.h>
#include <stdlib.h>    
#include <stdio.h>
int main() {
    FILE *process_fp = popen("make -f -", "w");
    if (process_fp == NULL) {
        printf("[ERR] make not found!\n");
    } else {
        char txt[1024] = "all:\n\t@echo Hello World!\n";
        fwrite(txt, sizeof(char), strlen(txt), process_fp);
        pclose(process_fp);
    }
}

This program will print "Hello World!". It works on the Linux platform, but failed on Solaris, where it complains: make: *** fopen (temporary file): No such file or directory. Stop..

How can I solve this problem?

Upvotes: 0

Views: 573

Answers (1)

Aaron Digulla
Aaron Digulla

Reputation: 328594

Try to run make -f - manually; it probably doesn't work on Solaris. Try gmake (for GNU make) instead.

Upvotes: 3

Related Questions