Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stdin/stdout



This is the "pre-standards" behavior for these globals. FreeBSD has since gone to the "linux way" below (which is also part of the UNIX03 spec) and MacOSX will at some point probably follow suit.

- Jordan

On May 22, 2004, at 9:03 PM, Steve Checkoway wrote:

I was attempting to compile the latest version of flex, 2.5.31, when it failed with three errors. All three had to do with invalid lvalues so I opened up filter.c (the offending file) and checked the lines. They were of the form:
if ((stdin = fdopen(0, "r") == NULL)

Since I had just successfully compiled this version on linux, I decided to open /usr/include/stdio.h to see just how stdin and stdout were defined. Here is what I found:
#define stdin (&__sF[0])
#define stdout (&__sF[1])
#define stderr (&__sF[2])

I checked the stdio.h file on the linux computer to see what it contained. It had:
extern FILE *stdin; /* Standard input stream. */
extern FILE *stdout; /* Standard output stream. */
extern FILE *stderr; /* Standard error output stream. */

--
Jordan K. Hubbard
Engineering Manager, BSD technology group
Apple Computer
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >stdin/stdout (From: Steve Checkoway <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.