This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Link is breaking for setbuffer()


On Thu, 15 Jul 1999, farshad mahjoubi wrote:

> >HI
> >
> >I am trying to port  our Application to WinNT. My link is breaking with
> >this ERROR that complaines about function setbuffer().

For good reason -- it's non-standard and the runtime library does not
provide it.

> >
> >Setbuffer() is being called from a C Source code and I see that it is
> >been declared in stdio.h 

The prototype is a mistake/bug in the header. It's not implemented in 
the runtime library.

> >
> >Does anyone know which library in /cygnus/cygwin contains the setbbuffer()
> >
> >why the standard libraries I am linking (which
> >_should_ contain the setbuffer function) don't do so... ?

Because it's non-standard. Please at least look up the standard (ANSI
and POSIX) before suggesting why a standard library does not provide 
some function.

Here's a trivial implementation straight out of a Linux man page using
ANSI standard setvbuf:
  
  #define setbuffer(stream,buf,size) \
     setvbuf((stream),  (buf),  (buf)  ? _IOFBF : _IONBF, (size))

I'll send a patch to Cygwin team.

Regards,
Mumit



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]