@AmigaBlitter
There is some support for unistd and other posixy things, but Amiga is not Posix so you should expect to do some work when porting posix code.
newlib doesn't have a pipe()
here is my replacement from perl (inherited from abc-shell)
unsigned int pipenum = 0;
int pipe(int filedes[2])
{
char pipe_name[1024];
// adebug("%s %ld \n",__FUNCTION__,__LINE__);
#ifdef USE_TEMPFILES
sprintf(pipe_name, "/T/%x.%08lx", pipenum++, IUtility->GetUniqueID());
#else
sprintf(pipe_name, "/PIPE/%x%08lx/4096/0", pipenum++,
IUtility->GetUniqueID());
#endif
/* printf("pipe: %s \n", pipe_name);*/
filedes[1] = open(pipe_name, O_WRONLY | O_CREAT);
filedes[0] = open(pipe_name, O_RDONLY);
if (filedes[0] == -1 || filedes[1] == -1)
{
if (filedes[0] != -1)
close(filedes[0]);
if (filedes[1] != -1)
close(filedes[1]);
return -1;
}
/* printf("filedes %d %d\n", filedes[0],
* filedes[1]);fflush(stdout);*/
return 0;
}
If you are lnking without -lunix then you will need to chnage the pipe paths to to amigaos versions.
newlib does not support sigprocmask()
sigprocmask() isn't guaranteed to be portable so there might well be a config.h entry for it, try editing that file by hand if it exists, ie if
#define HAVE_SIGPROCMASK 1
or similar exists comment it out.
Even with the supported set of functions signal handling is relatively limited whilst raise() can send almost any signal to it's own process kill() can only send SIG_TERM and SIG_QUIT IIRC to another process and they will both be emulated by SIGBREAKF_CTRL_C