Mail Archives: djgpp-workers/2000/09/17/13:47:37
In src/libc/posix/unistd/write.c I find this:
ssize_t
write(int handle, const void* buffer, size_t count)
{
const char *buf = (const char *)buffer;
int bytes_in_tb = 0;
int offset_into_buf = 0;
__dpmi_regs r;
ssize_t rv;
__FSEXT_Function *func = __FSEXT_get_function(handle);
/* termios special hook */
if (__libc_write_termios_hook != NULL)
if (__libc_write_termios_hook(handle, buffer, count, &rv) != 0)
return rv;
if (count == 0)
return 0; /* POSIX.1 requires this */
if(__file_handle_modes[handle] & O_BINARY)
return _write(handle, buf, count);
/* Let's handle FSEXT_write ! */
if(func && /* if handler is installed, ...*/
func(__FSEXT_write, &rv, &handle)) /* ... call extension ... */
return rv; /* ... and exit if handled. */
This seems to mean that if a file is open()ed with O_BINARY, the FSEXT
won't be called.
Am I missing something? Perhaps __file_handle_modes isn't what I
thought it is?
Right,
MartinS
- Raw text -