[FFmpeg-devel] setmode(fd, flag)

Ramiro Polla ramiro.polla
Tue Dec 16 13:52:46 CET 2008


Hi,

On Mon, Dec 15, 2008 at 3:28 PM, Marc Mason <mpeg.blue at free.fr> wrote:
> Hello,
>
> pipe_open() may call setmode()
>
> http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/file_8c-source.html#l00108
>
> #ifdef O_BINARY
>     setmode(fd, O_BINARY);
> #endif
>
> Which standard does setmode() come from ?
>
> It's not C89 or C99.
>
> It doesn't seem to be POSIX.
> http://www.opengroup.org/onlinepubs/000095399/idx/is.html
>
> I don't think it's from BSD.
> http://www.freebsd.org/cgi/man.cgi?query=setmode
>
> Is it from Win32 ?

Yes. You can find information about it in MSDN.

> I suppose O_BINARY remains undefined on a Linux platform ?

Yes. But it is defined in BeOS (IIRC) and setmode does something
completely different. So the code, as is, is not good.

It seems (from msdn [0]) that _setmode is preferred.

Patches welcome.

Ramiro Polla
[0] http://msdn.microsoft.com/en-us/library/tw4k6df8(VS.80).aspx




More information about the ffmpeg-devel mailing list