mkfifo and codewarrior

konan

Registered
The following code gives me the error that mkfifo is an undefined identifier. Searching the Codewarrior folder, I could find no file that contained the text mkfifo. Does anybody know how to use mkfifo with Codewarrior 8 Pro?

#include <iostream>
#include <types.h>
#include <sys/stat.h>


int main()
{
using namespace std;


/* set the umask explicitly, you don't know where it's been */
umask(0);

if (mkfifo("test_fifo", S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP))
{
perror("mkfifo");
exit(1);
}
}
 
Open a terminal window and do "man 2 mkfifo"

The problem is, it's a BSD routine, not a MSL routine, so you'll have to setup your project to use the BSD headers instead of the MSL headers. Use MacHeadersMach-O.h rather than MSL MacHeadersMach-O.h as your prefix file, remove MSL from the access paths, and remove the MSL libraries and add the BSD runtime libraries.



Wade
 
I was aftraid that the solution would be that drastic. I have since decided to use the Scrap Manager to achieve simple interapplication communication. Thank you for your answer.

Note: I cannot find any BSD related headers in my Codewarrior installation. Do I have to download the separately?

Konan
 
Back
Top