Index: /trunk/include/iprt/nocrt/stdio.h
===================================================================
--- /trunk/include/iprt/nocrt/stdio.h	(revision 96090)
+++ /trunk/include/iprt/nocrt/stdio.h	(revision 96091)
@@ -31,5 +31,10 @@
 
 #include <iprt/stream.h>
-#include <iprt/nocrt/sys/types.h> /* errno_t, off_t */
+#include <iprt/nocrt/sys/types.h>   /* errno_t, off_t */
+#ifdef IPRT_NO_CRT_FOR_3RD_PARTY
+# include <iprt/nocrt/time.h>       /* file.h includes fs.h which includes time.h */
+# include <iprt/file.h>             /* for RTFILE_SEEK_XXX */
+# include <iprt/assertcompile.h>
+#endif
 
 typedef RTFOFF fpos_t;
@@ -41,4 +46,15 @@
  * check each printf and fprintf call as IPRT isn't 100% compatible...
  */
+
+/* These are also in unistd.h: */
+# undef  SEEK_SET
+# define SEEK_SET   RTFILE_SEEK_BEGIN
+# undef  SEEK_CUR
+# define SEEK_CUR   RTFILE_SEEK_CURRENT
+# undef  SEEK_END
+# define SEEK_END   RTFILE_SEEK_END
+AssertCompile(SEEK_SET == 0); AssertCompile(SEEK_CUR == 1); AssertCompile(SEEK_END == 2); /* Also in WDK header mmiscapi.h. */
+
+
 RT_C_DECLS_BEGIN
 
@@ -73,4 +89,5 @@
 int     RT_NOCRT(puts)(const char *psz);
 int     RT_NOCRT(fputc)(int, FILE *pFile);
+int     RT_NOCRT(putc)(int, FILE *pFile);
 size_t  RT_NOCRT(fread)(void *pvBuf, size_t cbItem, size_t cItems, FILE *pFile);
 int     RT_NOCRT(fgetc)(FILE *pFile);
Index: /trunk/include/iprt/nocrt/unistd.h
===================================================================
--- /trunk/include/iprt/nocrt/unistd.h	(revision 96090)
+++ /trunk/include/iprt/nocrt/unistd.h	(revision 96091)
@@ -31,12 +31,27 @@
 
 #include <iprt/nocrt/sys/types.h>
+#ifdef IPRT_NO_CRT_FOR_3RD_PARTY
+# include <iprt/nocrt/time.h>       /* file.h includes fs.h which includes time.h */
+# include <iprt/file.h>             /* for RTFILE_SEEK_XXX */
+# include <iprt/assertcompile.h>
+#endif
+
 
 #ifdef IPRT_NO_CRT_FOR_3RD_PARTY
 
 /* Flags for access: */
-#define F_OK    0
-#define X_OK    1
-#define W_OK    2
-#define R_OK    4
+# define F_OK       0
+# define X_OK       1
+# define W_OK       2
+# define R_OK       4
+
+/* These are also in stdio.h: */
+# undef  SEEK_SET
+# define SEEK_SET   RTFILE_SEEK_BEGIN
+# undef  SEEK_CUR
+# define SEEK_CUR   RTFILE_SEEK_CURRENT
+# undef  SEEK_END
+# define SEEK_END   RTFILE_SEEK_END
+AssertCompile(SEEK_SET == 0); AssertCompile(SEEK_CUR == 1); AssertCompile(SEEK_END == 2); /* Also in WDK header mmiscapi.h. */
 
 RT_C_DECLS_BEGIN
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 96090)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 96091)
@@ -1833,6 +1833,22 @@
   	r3/nocrt-tmpfile.cpp \
   	r3/nocrt-tmpfile_s.cpp \
+  	r3/nocrt-fileno.cpp \
   	r3/nocrt-fclose.cpp \
   	r3/nocrt-fflush.cpp \
+  	r3/nocrt-setvbuf.cpp \
+  	r3/nocrt-fseek.cpp \
+  	r3/nocrt-fseeko.cpp \
+  	r3/nocrt-ftell.cpp \
+  	r3/nocrt-ftello.cpp \
+  	r3/nocrt-fwrite.cpp \
+  	r3/nocrt-fputc.cpp \
+  	r3/nocrt-putc.cpp \
+  	r3/nocrt-fputs.cpp \
+  	r3/nocrt-puts.cpp \
+  	r3/nocrt-fread.cpp \
+  	r3/nocrt-fgetc.cpp \
+  	r3/nocrt-getc.cpp \
+  	r3/nocrt-clearerr.cpp \
+  	r3/nocrt-ferror.cpp \
 
   RuntimeR3_SOURCES.x86 = $(RuntimeBaseR3_SOURCES.x86) \
Index: /trunk/src/VBox/Runtime/r3/nocrt-clearerr.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-clearerr.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-clearerr.cpp	(revision 96091)
@@ -0,0 +1,43 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - clearerr().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/stream.h>
+
+
+#undef clearerr
+void RT_NOCRT(clearerr)(FILE *pFile)
+{
+    RTStrmClearError(pFile);
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(clearerr);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-ferror.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-ferror.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-ferror.cpp	(revision 96091)
@@ -0,0 +1,47 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - ferror().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef ferror
+int  RT_NOCRT(ferror)(FILE *pFile)
+{
+    int rc = RTStrmError(pFile);
+    if (RT_SUCCESS(rc))
+        return 0;
+    return 1;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(ferror);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fgetc.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fgetc.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fgetc.cpp	(revision 96091)
@@ -0,0 +1,51 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fgetc().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+/* Note! This is identical to the getc implemention. */
+#undef fgetc
+int RT_NOCRT(fgetc)(FILE *pFile)
+{
+    unsigned char ch;
+    int rc = RTStrmReadEx(pFile, &ch, 1, NULL);
+    if (RT_SUCCESS(rc))
+        return ch;
+    errno = RTErrConvertToErrno(rc);
+    return RT_NOCRT_EOF;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fgetc);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fileno.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fileno.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fileno.cpp	(revision 96091)
@@ -0,0 +1,51 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fileno().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/file.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef fileno
+int RT_NOCRT(fileno)(FILE *pFile)
+{
+    RTFILE hFile;
+    int rc = RTStrmQueryFileHandle(pFile, &hFile);
+    if (RT_SUCCESS(rc))
+        return (int)RTFileToNative(hFile);
+    errno = EINVAL;
+    return -1;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fileno);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fputc.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fputc.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fputc.cpp	(revision 96091)
@@ -0,0 +1,51 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fputc().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+/* Note! This is identical to the putc implemention. */
+#undef fputc
+int RT_NOCRT(fputc)(int iChar, FILE *pFile)
+{
+    unsigned char ch = (unsigned char)iChar;
+    int rc = RTStrmWriteEx(pFile, &ch, 1, NULL);
+    if (RT_SUCCESS(rc))
+        return ch;
+    errno = RTErrConvertToErrno(rc);
+    return RT_NOCRT_EOF;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fputc);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fputs.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fputs.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fputs.cpp	(revision 96091)
@@ -0,0 +1,53 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fputs().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/nocrt/limits.h>
+#include <iprt/nocrt/string.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef fputs
+int RT_NOCRT(fputs)(const char *psz, FILE *pFile)
+{
+    /* We're using RTStrmPutStr here for the benefit of console output optimization. */
+    size_t cch = strlen(psz);
+    int rc = RTStrmPutStr(pFile, psz);
+    if (RT_SUCCESS(rc))
+        return (int)RT_MIN(cch, (size_t)INT_MAX);
+    errno = RTErrConvertToErrno(rc);
+    return RT_NOCRT_EOF;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fputs);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fread.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fread.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fread.cpp	(revision 96091)
@@ -0,0 +1,53 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fread().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/assert.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef fread
+size_t RT_NOCRT(fread)(void *pvBuf, size_t cbItem, size_t cItems, FILE *pFile)
+{
+    size_t cbToRead = cbItem * cItems;
+    AssertReturnStmt(cbToRead >= cbItem && cbItem >= cItems, errno = ERANGE, 0);
+    size_t cbRead = 0;
+    int rc = RTStrmReadEx(pFile, pvBuf, cbToRead, &cbRead);
+    if (RT_SUCCESS(rc))
+        return cbRead;
+    errno = RTErrConvertToErrno(rc);
+    return 0;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fread);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fseek.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fseek.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fseek.cpp	(revision 96091)
@@ -0,0 +1,49 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fseek().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef fseek
+int RT_NOCRT(fseek)(FILE *pFile, long off, int iMethod)
+{
+    int rc = RTStrmSeek(pFile, off, (uint32_t)iMethod);
+    if (RT_SUCCESS(rc))
+        return 0;
+    errno = RTErrConvertToErrno(rc);
+    return -1;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fseek);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fseeko.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fseeko.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fseeko.cpp	(revision 96091)
@@ -0,0 +1,49 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fseeko().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef fseeko
+int RT_NOCRT(fseeko)(FILE *pFile, off_t off, int iMethod)
+{
+    int rc = RTStrmSeek(pFile, off, (uint32_t)iMethod);
+    if (RT_SUCCESS(rc))
+        return 0;
+    errno = RTErrConvertToErrno(rc);
+    return -1;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fseeko);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-ftell.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-ftell.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-ftell.cpp	(revision 96091)
@@ -0,0 +1,55 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - ftell().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/nocrt/limits.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef ftell
+long RT_NOCRT(ftell)(FILE *pFile)
+{
+    RTFOFF off = RTStrmTell(pFile);
+    if (off >= 0)
+    {
+        if (off < LONG_MAX)
+            return (long)off;
+        errno = EOVERFLOW;
+    }
+    else
+        errno = RTErrConvertToErrno((int)off);
+    return -1;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(ftell);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-ftello.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-ftello.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-ftello.cpp	(revision 96091)
@@ -0,0 +1,50 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - ftello().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef ftello
+off_t RT_NOCRT(ftello)(FILE *pFile)
+{
+    RTFOFF off = RTStrmTell(pFile);
+    AssertCompile(sizeof(off_t) == sizeof(off));
+    if (off >= 0)
+        return off;
+    errno = RTErrConvertToErrno((int)off);
+    return -1;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(ftello);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-fwrite.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-fwrite.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-fwrite.cpp	(revision 96091)
@@ -0,0 +1,53 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - fwrite().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/assert.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef fwrite
+size_t RT_NOCRT(fwrite)(void const *pvBuf, size_t cbItem, size_t cItems, FILE *pFile)
+{
+    size_t cbToWrite = cbItem * cItems;
+    AssertReturnStmt(cbToWrite >= cbItem && cbItem >= cItems, errno = ERANGE, 0);
+    size_t cbWritten = 0;
+    int rc = RTStrmWriteEx(pFile, pvBuf, cbToWrite, &cbWritten);
+    if (RT_SUCCESS(rc))
+        return cbWritten;
+    errno = RTErrConvertToErrno(rc);
+    return 0;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(fwrite);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-getc.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-getc.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-getc.cpp	(revision 96091)
@@ -0,0 +1,51 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - getc().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+/* Note! This is identical to the fgetc implemention. */
+#undef getc
+int RT_NOCRT(getc)(FILE *pFile)
+{
+    unsigned char ch;
+    int rc = RTStrmReadEx(pFile, &ch, 1, NULL);
+    if (RT_SUCCESS(rc))
+        return ch;
+    errno = RTErrConvertToErrno(rc);
+    return RT_NOCRT_EOF;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(getc);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-putc.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-putc.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-putc.cpp	(revision 96091)
@@ -0,0 +1,51 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - putc().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+/* Note! This is identical to the fputc implemention. */
+#undef putc
+int RT_NOCRT(putc)(int iChar, FILE *pFile)
+{
+    unsigned char ch = (unsigned char)iChar;
+    int rc = RTStrmWriteEx(pFile, &ch, 1, NULL);
+    if (RT_SUCCESS(rc))
+        return ch;
+    errno = RTErrConvertToErrno(rc);
+    return RT_NOCRT_EOF;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(putc);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-puts.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-puts.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-puts.cpp	(revision 96091)
@@ -0,0 +1,58 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - puts().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/nocrt/string.h>
+#include <iprt/nocrt/limits.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef puts
+int RT_NOCRT(puts)(const char *psz)
+{
+    /* We're using RTStrmPutStr here for the benefit of console output optimization. */
+    size_t cch = strlen(psz);
+    int rc = RTStrmPutStr(g_pStdOut, psz);
+    if (RT_SUCCESS(rc))
+    {
+        /** @todo This isn't entirely perfect wrt multithreading. */
+        rc = RTStrmPutStr(g_pStdOut, "\n");
+        if (RT_SUCCESS(rc))
+            return (int)RT_MIN(cch + 1, (size_t)INT_MAX);
+    }
+    errno = RTErrConvertToErrno(rc);
+    return RT_NOCRT_EOF;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(puts);
+
Index: /trunk/src/VBox/Runtime/r3/nocrt-setvbuf.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/nocrt-setvbuf.cpp	(revision 96091)
+++ /trunk/src/VBox/Runtime/r3/nocrt-setvbuf.cpp	(revision 96091)
@@ -0,0 +1,62 @@
+/* $Id$ */
+/** @file
+ * IPRT - No-CRT - setvbuf().
+ */
+
+/*
+ * Copyright (C) 2022 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*********************************************************************************************************************************
+*   Header Files                                                                                                                 *
+*********************************************************************************************************************************/
+#define IPRT_NO_CRT_FOR_3RD_PARTY
+#include "internal/nocrt.h"
+#include <iprt/nocrt/stdio.h>
+#include <iprt/nocrt/errno.h>
+#include <iprt/assert.h>
+#include <iprt/errcore.h>
+#include <iprt/stream.h>
+
+
+#undef setvbuf
+int RT_NOCRT(setvbuf)(FILE *pFile, char *pchBuf, int iBufferingType, size_t cbBuf)
+{
+    Assert(!pchBuf); /* ignored */
+    Assert(!cbBuf);  /* ignored */
+
+    RTSTRMBUFMODE enmBufMode;
+    switch (iBufferingType)
+    {
+        case _IOFBF: enmBufMode = RTSTRMBUFMODE_FULL; break;
+        case _IOLBF: enmBufMode = RTSTRMBUFMODE_LINE; break;
+        case _IONBF: enmBufMode = RTSTRMBUFMODE_UNBUFFERED; break;
+        default: AssertFailedReturnStmt(errno = EINVAL, -1);
+    }
+
+    int rc = RTStrmSetBufferingMode(pFile, enmBufMode);
+    if (RT_SUCCESS(rc))
+        return 0;
+    errno = RTErrConvertToErrno(rc);
+    return -1;
+}
+RT_ALIAS_AND_EXPORT_NOCRT_SYMBOL(setvbuf);
+
