diff options
| author | riastradh <riastradh@NetBSD.org> | 2020-02-14 04:38:36 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2020-02-14 04:38:36 +0000 |
| commit | 9b4f83d02bf01fc47e1ef1bbd392c14a7dd4303d (patch) | |
| tree | d71a5660b092cb9663c9828262346f208d5204a5 /sys/external/bsd/common/include/linux | |
| parent | 55a17ff0f6d73059ccef8a4409aeb5d7e8106f63 (diff) | |
Implement (obsolete) simple_strtol stub; reduce diff.
Diffstat (limited to 'sys/external/bsd/common/include/linux')
| -rw-r--r-- | sys/external/bsd/common/include/linux/kernel.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/external/bsd/common/include/linux/kernel.h b/sys/external/bsd/common/include/linux/kernel.h index a01719d38af..88ddcf01060 100644 --- a/sys/external/bsd/common/include/linux/kernel.h +++ b/sys/external/bsd/common/include/linux/kernel.h @@ -1,4 +1,4 @@ -/* $NetBSD: kernel.h,v 1.23 2019/09/30 12:20:54 christos Exp $ */ +/* $NetBSD: kernel.h,v 1.24 2020/02/14 04:38:36 riastradh Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -196,6 +196,18 @@ kstrtol(const char *s, unsigned base, long *vp) return 0; } +static inline long +simple_strtol(const char *s, char **endp, unsigned base) +{ + long v; + + *endp = NULL; /* paranoia */ + v = strtoll(s, endp, base); + if (v < LONG_MIN || LONG_MAX < v) + return 0; + return v; +} + static __inline char * __printflike(2, 0) kvasprintf(gfp_t gfp, const char *fmt, va_list va) { |
