Closed Samuel-DEVULDER closed 5 years ago
for stdout Output()
from the dos.library is used. No idea what should be used instead.
With the version from amiga-gcc I build ~1yr ago (possibly gcc 6.4.1b or 6.4.0b... I don't remember) redirection was working.
I wonder if startup-code does, by chance, now reopen stdio: hence close the redirection and redirect everything onto the console since gcc 6.5.0.
Browsing https://github.com/bebbo/libnix/blob/master/sources/nix20/stdio/__initstdio.c, I've spotted stomething strange in function
static StdFileDes * stdfiledes(BPTR fh) {
StdFileDes *sfd = (StdFileDes *) malloc(sizeof(StdFileDes));
if (sfd) {
__stdfiledes[__stdfilesize] = sfd;
sfd->lx_pos = __stdfilesize++;
sfd->lx_fh = Input(); /// <=== HERE
sfd->lx_oflags = O_WRONLY;
_setup_file(sfd);
sfd->lx_flags |= LX_SYS;
}
return sfd;
}
The passed argument is not used, and it is Input() which is used instead. Does this explain the issue ?
Browsing https://github.com/bebbo/libnix/blob/master/sources/nix20/stdio/__initstdio.c, I've spotted stomething strange in function
static StdFileDes * stdfiledes(BPTR fh) { StdFileDes *sfd = (StdFileDes *) malloc(sizeof(StdFileDes)); if (sfd) { __stdfiledes[__stdfilesize] = sfd; sfd->lx_pos = __stdfilesize++; sfd->lx_fh = Input(); /// <=== HERE sfd->lx_oflags = O_WRONLY; _setup_file(sfd); sfd->lx_flags |= LX_SYS; } return sfd; }
The passed argument is not used, and it is Input() which is used instead. Does this explain the issue ?
good one - thanks :-)
see fe27f83af2038c69718295d49314e657a9532d70
Consider that piece of code:
Compile with:
m68k-amigaos-gcc tst.c -o tst -noixemul
And launch it in an amiga CLI like this:
Obviously the redirection to ram:output didn't work. The text is printed onto the console and though the redirection file is created, it remains empty.