2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
17 #include <sys/types.h>
19 #include <sys/systm.h>
20 #include <sys/errno.h>
23 copyinstr(const char *src
, char *dst
, size_t max_len
, size_t *copied
)
25 return (copystr(src
, dst
, max_len
, copied
));
29 copystr(const char *src
, char *dst
, size_t max_len
, size_t *outlen
)
34 return (ENAMETOOLONG
);
36 copied
= strlcpy(dst
, src
, max_len
) + 1;
37 if (copied
>= max_len
)
38 return (ENAMETOOLONG
);
47 ovbcopy(const void *src
, void *dst
, size_t len
)
49 (void) memmove(dst
, src
, len
);