blob: eee144dc4abe9f9fa78948b0c51a1404dc77581f [file] [log] [blame]
From 241f423a015279cb29b7ad1a34386ef1c32007fc Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 9 Dec 2018 16:47:16 -0800
Subject: [PATCH] Define ulocked_{fgets|fread|fwrite} aliases
latest clang converts the normal calls to the unlocked variant
equivalents
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Andrea Adami <andrea.adami@gmail.com>
---
usr/klibc/fgets.c | 2 ++
usr/klibc/fread2.c | 2 ++
usr/klibc/fwrite2.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/usr/klibc/fgets.c b/usr/klibc/fgets.c
index dbf742c6..2e9fcb65 100644
--- a/usr/klibc/fgets.c
+++ b/usr/klibc/fgets.c
@@ -25,3 +25,5 @@ char *fgets(char *s, int n, FILE *f)
return s;
}
+char *fgets_unlocked(char *s, int n, FILE *f)
+ __alias("fgets");
diff --git a/usr/klibc/fread2.c b/usr/klibc/fread2.c
index 7dca56b1..5c234766 100644
--- a/usr/klibc/fread2.c
+++ b/usr/klibc/fread2.c
@@ -11,3 +11,5 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE * f)
{
return _fread(ptr, size * nmemb, f) / size;
}
+size_t fread_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f)
+ __alias("fread");
diff --git a/usr/klibc/fwrite2.c b/usr/klibc/fwrite2.c
index cebc017c..3e0bb57d 100644
--- a/usr/klibc/fwrite2.c
+++ b/usr/klibc/fwrite2.c
@@ -11,3 +11,5 @@ size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE * f)
{
return _fwrite(ptr, size * nmemb, f) / size;
}
+size_t fwrite_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f)
+ __alias("fwrite");
--
2.19.2