Blame src/internal/ntux_ntaio_impl.c

26e14f
/***********************************************************/
26e14f
/*  ntux: native translation und extension                 */
14ffae
/*  Copyright (C) 2016--2021  SysDeer Technologies, LLC    */
26e14f
/*  Released under GPLv2 and GPLv3; see COPYING.NTUX.      */
26e14f
/***********************************************************/
26e14f
26e14f
#include <psxabi/sys_sysapi.h>
26e14f
#include <psxabi/sys_errno.h>
26e14f
471bb0
#include <psxxfi/xfi_base.h>
471bb0
#include <psxxfi/xfi_acl.h>
471bb0
471bb0
#include <ntapi/nt_memory.h>
471bb0
#include <ntapi/nt_file.h>
471bb0
#include <ntapi/nt_process.h>
26e14f
26e14f
int ntux_sprintf(char * str, const char * fmt, ...)
26e14f
{
26e14f
	int     ret;
26e14f
	va_list ap;
26e14f
26e14f
	va_start(ap, fmt);
471bb0
	ret = __xfi_vsprintf(str, fmt, ap);
26e14f
	va_end(ap);
26e14f
26e14f
	return ret;
26e14f
}
26e14f
26e14f
int ntux_snprintf(char * str, size_t n, const char * fmt, ...)
26e14f
{
26e14f
	int     ret;
26e14f
	va_list ap;
26e14f
26e14f
	va_start(ap, fmt);
471bb0
	ret = __xfi_vsnprintf(str, n, fmt, ap);
26e14f
	va_end(ap);
26e14f
26e14f
	return ret;
26e14f
}
26e14f
26e14f
int ntux_isatty(int fildes)
26e14f
{
471bb0
	return __xfi_get_runtime_data_file_type(fildes) == NT_FILE_TYPE_PTY;
26e14f
}