Andrew Geissler | 1548c07 | 2019-02-22 16:03:50 -0600 | [diff] [blame^] | 1 | From 241f423a015279cb29b7ad1a34386ef1c32007fc Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sun, 9 Dec 2018 16:47:16 -0800 |
| 4 | Subject: [PATCH] Define ulocked_{fgets|fread|fwrite} aliases |
| 5 | |
| 6 | latest clang converts the normal calls to the unlocked variant |
| 7 | equivalents |
| 8 | |
| 9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 10 | Cc: Andrea Adami <andrea.adami@gmail.com> |
| 11 | --- |
| 12 | usr/klibc/fgets.c | 2 ++ |
| 13 | usr/klibc/fread2.c | 2 ++ |
| 14 | usr/klibc/fwrite2.c | 2 ++ |
| 15 | 3 files changed, 6 insertions(+) |
| 16 | |
| 17 | diff --git a/usr/klibc/fgets.c b/usr/klibc/fgets.c |
| 18 | index dbf742c6..2e9fcb65 100644 |
| 19 | --- a/usr/klibc/fgets.c |
| 20 | +++ b/usr/klibc/fgets.c |
| 21 | @@ -25,3 +25,5 @@ char *fgets(char *s, int n, FILE *f) |
| 22 | |
| 23 | return s; |
| 24 | } |
| 25 | +char *fgets_unlocked(char *s, int n, FILE *f) |
| 26 | + __alias("fgets"); |
| 27 | diff --git a/usr/klibc/fread2.c b/usr/klibc/fread2.c |
| 28 | index 7dca56b1..5c234766 100644 |
| 29 | --- a/usr/klibc/fread2.c |
| 30 | +++ b/usr/klibc/fread2.c |
| 31 | @@ -11,3 +11,5 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE * f) |
| 32 | { |
| 33 | return _fread(ptr, size * nmemb, f) / size; |
| 34 | } |
| 35 | +size_t fread_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) |
| 36 | + __alias("fread"); |
| 37 | diff --git a/usr/klibc/fwrite2.c b/usr/klibc/fwrite2.c |
| 38 | index cebc017c..3e0bb57d 100644 |
| 39 | --- a/usr/klibc/fwrite2.c |
| 40 | +++ b/usr/klibc/fwrite2.c |
| 41 | @@ -11,3 +11,5 @@ size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE * f) |
| 42 | { |
| 43 | return _fwrite(ptr, size * nmemb, f) / size; |
| 44 | } |
| 45 | +size_t fwrite_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) |
| 46 | + __alias("fwrite"); |
| 47 | -- |
| 48 | 2.19.2 |
| 49 | |