mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 22:54:14 +08:00
Addition of tcdrain() from Eric Norum.
This commit is contained in:
@@ -64,6 +64,8 @@ struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);
|
||||
extern void _wrapup_reent(struct _reent *);
|
||||
extern void _reclaim_reent(struct _reent *);
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
libc_wrapup(void)
|
||||
{
|
||||
@@ -86,6 +88,16 @@ libc_wrapup(void)
|
||||
#endif
|
||||
_REENT = &libc_global_reent;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to drain output buffers.
|
||||
*
|
||||
* Should this be changed to do *all* file streams?
|
||||
* _fwalk (_REENT, fclose);
|
||||
*/
|
||||
fclose (stdin);
|
||||
fclose (stdout);
|
||||
fclose (stderr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -64,6 +64,8 @@ struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);
|
||||
extern void _wrapup_reent(struct _reent *);
|
||||
extern void _reclaim_reent(struct _reent *);
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
libc_wrapup(void)
|
||||
{
|
||||
@@ -86,6 +88,16 @@ libc_wrapup(void)
|
||||
#endif
|
||||
_REENT = &libc_global_reent;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to drain output buffers.
|
||||
*
|
||||
* Should this be changed to do *all* file streams?
|
||||
* _fwalk (_REENT, fclose);
|
||||
*/
|
||||
fclose (stdin);
|
||||
fclose (stdout);
|
||||
fclose (stderr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,4 +37,10 @@ tcsetattr(int fd, int opt, struct termios *tp)
|
||||
return __rtems_ioctl(fd,RTEMS_IO_SET_ATTRIBUTES,tp);
|
||||
}
|
||||
|
||||
int
|
||||
tcdrain(int fd)
|
||||
{
|
||||
return __rtems_ioctl(fd,RTEMS_IO_TCDRAIN,0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -64,6 +64,8 @@ struct _reent libc_global_reent = _REENT_INIT(libc_global_reent);
|
||||
extern void _wrapup_reent(struct _reent *);
|
||||
extern void _reclaim_reent(struct _reent *);
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void
|
||||
libc_wrapup(void)
|
||||
{
|
||||
@@ -86,6 +88,16 @@ libc_wrapup(void)
|
||||
#endif
|
||||
_REENT = &libc_global_reent;
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to drain output buffers.
|
||||
*
|
||||
* Should this be changed to do *all* file streams?
|
||||
* _fwalk (_REENT, fclose);
|
||||
*/
|
||||
fclose (stdin);
|
||||
fclose (stdout);
|
||||
fclose (stderr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user