Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | --- stdio.3 2004-11-25 11:38:35.000000000 -0800 +++ stdio.3.edit 2006-09-06 16:18:21.000000000 -0700 @@ -45,6 +45,20 @@ .Vt FILE *stdin ; .Vt FILE *stdout ; .Vt FILE *stderr ; +.Pp +Note: +The current implementation does not allow these variables +to be evaluated at C compile/link time. +That is, a runtime calculation must be performed, such as: +.Bd -literal -offset indent +#include <stdio.h> + +static FILE *var; + +int main() { + var = stdout; +} +.Ed .Sh DESCRIPTION The standard .Tn I/O @@ -232,11 +246,21 @@ .Dv putchar_unlocked exist and will be used if the macro definitions are explicitly removed. +.Sh LEGACY SYNOPSIS +The -D_NONSTD_SOURCE flag can be used +to allow stdin, stdout, and/or stderr +to be evaluated at compile/link time, as: +.Bd -literal -offset indent +#include <stdio.h> + +static FILE *var = stdout; +.Ed .Sh SEE ALSO .Xr close 2 , .Xr open 2 , .Xr read 2 , -.Xr write 2 +.Xr write 2 , +.Xr compat 5 .Sh BUGS The standard buffered functions do not interact well with certain other library and system functions, especially @@ -250,7 +274,9 @@ .Bl -column "Description" .It Sy "Function Description" .It "asprintf formatted output conversion" +.It "" .It "clearerr check and reset stream status" +.It "" .It "fclose close a stream" .It "fdopen stream open functions" .It "feof check and reset stream status" @@ -282,15 +308,18 @@ .It "fwopen open a stream" .It "fwprintf formatted wide character output conversion" .It "fwrite binary stream input/output" +.It "" .It "getc get next character or word from input stream" .It "getchar get next character or word from input stream" .It "gets get a line from a stream" .It "getw get next character or word from input stream" .It "getwc get next wide character from input stream" .It "getwchar get next wide character from input stream" +.It "" .It "mkdtemp create unique temporary directory" .It "mkstemp create unique temporary file" .It "mktemp create unique temporary file" +.It "" .It "perror system error messages" .It "printf formatted output conversion" .It "putc output a character or word to a stream" @@ -299,8 +328,10 @@ .It "putw output a character or word to a stream" .It "putwc output a wide character to a stream" .It "putwchar output a wide character to a stream" +.It "" .It "remove remove directory entry" .It "rewind reposition a stream" +.It "" .It "scanf input format conversion" .It "setbuf stream buffering operations" .It "setbuffer stream buffering operations" @@ -313,11 +344,14 @@ .It "swprintf formatted wide character output conversion" .It "sys_errlist system error messages" .It "sys_nerr system error messages" +.It "" .It "tempnam temporary file routines" .It "tmpfile temporary file routines" .It "tmpnam temporary file routines" +.It "" .It "ungetc un-get character from input stream" .It "ungetwc un-get wide character from input stream" +.It "" .It "vasprintf formatted output conversion" .It "vfprintf formatted output conversion" .It "vfscanf input format conversion" @@ -329,5 +363,6 @@ .It "vsscanf input format conversion" .It "vswprintf formatted wide character output conversion" .It "vwprintf formatted wide character output conversion" +.It "" .It "wprintf formatted wide character output conversion" .El |