[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gets/puts anomaly
From: |
Rainer Weikusat |
Subject: |
gets/puts anomaly |
Date: |
09 Feb 2001 16:18:04 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 |
Possibly due to
------- libio.h (247) ------------
#ifndef _LIBC
#define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_))
#define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_))
#define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_))
#else
extern _IO_FILE *_IO_stdin;
extern _IO_FILE *_IO_stdout;
extern _IO_FILE *_IO_stderr;
#endif
----------------------------------
the following doesn't work
---------------------------
#include <stdio.h>
int main()
{
FILE *fp;
fp = fopen("/tmp/test", "w");
fclose(stdout);
stdout = fp;
puts("Test");
return 0;
}
----------------------------
but, according to the documentation, it should. This is from 2.1.3,
but if my guess at the cause is correct, it should also affect 2.2.
--
SIGSTOP
- gets/puts anomaly,
Rainer Weikusat <=