/* stdio on a Mach device port.
Translates \n to \r\n on output, echos and translates \r to \n on input.
- Copyright (C) 1992-2012 Free Software Foundation, Inc.
+ Copyright (C) 1992-2019 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#include <device/device.h>
#include <errno.h>
#include <string.h>
+#include <libioP.h>
static ssize_t
static int
dealloc_ref (void *cookie)
{
- if (mach_port_deallocate (mach_task_self (), (mach_port_t) cookie))
+ if (__mach_port_deallocate (mach_task_self (), (mach_port_t) cookie))
{
errno = EINVAL;
return -1;
return NULL;
}
- stream = fopencookie ((void *) dev, mode,
- (cookie_io_functions_t) { write: devstream_write,
- read: devstream_read,
- close: dealloc_ref });
+ stream = _IO_fopencookie ((void *) dev, mode,
+ (cookie_io_functions_t) { write: devstream_write,
+ read: devstream_read,
+ close: dealloc_ref });
if (stream == NULL)
{
- mach_port_deallocate (mach_task_self (), dev);
+ __mach_port_deallocate (mach_task_self (), dev);
return NULL;
}