Loading...
--- Libc/Libc-1506.40.4/include/stdio.h
+++ Libc/Libc-1583.60.2/include/stdio.h
@@ -64,6 +64,8 @@
 #include <_stdio.h>
 
 #ifndef UNIFDEF_DRIVERKIT
+#include <sys/_types/_seek_set.h>
+
 __BEGIN_DECLS
 extern FILE *__stdinp;
 extern FILE *__stdoutp;
@@ -115,16 +117,6 @@
 #define	L_tmpnam	1024	/* XXX must be == PATH_MAX */
 #define	TMP_MAX		308915776
 
-#ifndef SEEK_SET
-#define	SEEK_SET	0	/* set file offset to offset */
-#endif
-#ifndef SEEK_CUR
-#define	SEEK_CUR	1	/* set file offset to current plus offset */
-#endif
-#ifndef SEEK_END
-#define	SEEK_END	2	/* set file offset to EOF plus offset */
-#endif
-
 #define	stdin	__stdinp
 #define	stdout	__stdoutp
 #define	stderr	__stderrp
@@ -199,7 +191,12 @@
 //End-Libc
 int	 getc(FILE *);
 int	 getchar(void);
+
+#if !defined(_POSIX_C_SOURCE)
+__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of gets(3), it is highly recommended that you use fgets(3) instead.")
+#endif
 char	*gets(char *);
+
 void	 perror(const char *) __cold;
 int	 printf(const char * __restrict, ...) __printflike(1, 2);
 int	 putc(int, FILE *);
@@ -211,7 +208,13 @@
 int	 scanf(const char * __restrict, ...) __scanflike(1, 2);
 void	 setbuf(FILE * __restrict, char * __restrict);
 int	 setvbuf(FILE * __restrict, char * __restrict, int, size_t);
-int	 sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3) __swift_unavailable("Use snprintf instead.");
+
+__swift_unavailable("Use snprintf instead.")
+#if !defined(_POSIX_C_SOURCE)
+__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
+#endif
+int	 sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
+
 int	 sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
 FILE	*tmpfile(void);
 
@@ -220,10 +223,16 @@
 __deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
 #endif
 char	*tmpnam(char *);
+
 int	 ungetc(int, FILE *);
 int	 vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
 int	 vprintf(const char * __restrict, va_list) __printflike(1, 0);
-int	 vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0) __swift_unavailable("Use vsnprintf instead.");
+
+__swift_unavailable("Use vsnprintf instead.")
+#if !defined(_POSIX_C_SOURCE)
+__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
+#endif
+int	 vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0);
 __END_DECLS
 
 
@@ -235,8 +244,9 @@
 #if __DARWIN_C_LEVEL >= 198808L
 #define	L_ctermid	1024	/* size for ctermid(); PATH_MAX */
 
-__BEGIN_DECLS
 #include <_ctermid.h>
+
+__BEGIN_DECLS
 
 #if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
 FILE	*fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
@@ -421,7 +431,7 @@
 int	 asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
 char	*ctermid_r(char *);
 char	*fgetln(FILE *, size_t *);
-__const char *fmtcheck(const char *, const char *);
+__const char *fmtcheck(const char *, const char *) __attribute__((format_arg(2)));
 int	 fpurge(FILE *);
 void	 setbuffer(FILE *, char *, int);
 int	 setlinebuf(FILE *);