From e905914f96e11862b130dd229f73045dad9a34e8 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Sun, 25 Jun 2006 05:49:17 -0700 Subject: [PATCH] Implement kasprintf Implement kasprintf, a kernel version of asprintf. This allocates the memory required for the formatted string, including the trailing '\0'. Returns NULL on allocation failure. Signed-off-by: Jeremy Fitzhardinge Signed-off-by: Chris Wright Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 8c21aaa248b..3c5e4c2e517 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -117,6 +117,8 @@ extern int scnprintf(char * buf, size_t size, const char * fmt, ...) __attribute__ ((format (printf, 3, 4))); extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) __attribute__ ((format (printf, 3, 0))); +extern char *kasprintf(gfp_t gfp, const char *fmt, ...) + __attribute__ ((format (printf, 2, 3))); extern int sscanf(const char *, const char *, ...) __attribute__ ((format (scanf, 2, 3))); -- cgit v1.2.3