| * Copyright (C) 2006 Atmark Techno, Inc. |
| * This file is subject to the terms and conditions of the GNU General Public |
| * License. See the file "COPYING" in the main directory of this archive |
| #include <linux/string.h> |
| long strnlen_user(const char __user *src, long count) |
| #define __do_strncpy_from_user(dst, src, count, res) \ |
| strncpy(dst, src, count); \ |
| for (tmp = dst; *tmp && count > 0; tmp++, count--) \ |
| long __strncpy_from_user(char *dst, const char __user *src, long count) |
| __do_strncpy_from_user(dst, src, count, res); |
| long strncpy_from_user(char *dst, const char __user *src, long count) |
| if (access_ok(VERIFY_READ, src, 1)) |
| __do_strncpy_from_user(dst, src, count, res); |