xref: /llvm-project/libc/src/string/strlcpy.cpp (revision 5ff3ff33ff930e4ec49da7910612d8a41eb068cb)
1fc2c8b23SAlex Brachet //===-- Implementation of strlcpy -----------------------------------------===//
2fc2c8b23SAlex Brachet //
3fc2c8b23SAlex Brachet // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4fc2c8b23SAlex Brachet // See https://llvm.org/LICENSE.txt for license information.
5fc2c8b23SAlex Brachet // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6fc2c8b23SAlex Brachet //
7fc2c8b23SAlex Brachet //===----------------------------------------------------------------------===//
8fc2c8b23SAlex Brachet 
9fc2c8b23SAlex Brachet #include "src/string/strlcpy.h"
10*5ff3ff33SPetr Hosek #include "src/__support/macros/config.h"
11fc2c8b23SAlex Brachet #include "src/string/string_utils.h"
12fc2c8b23SAlex Brachet 
13fc2c8b23SAlex Brachet #include "src/__support/common.h"
14fc2c8b23SAlex Brachet 
15*5ff3ff33SPetr Hosek namespace LIBC_NAMESPACE_DECL {
16fc2c8b23SAlex Brachet 
17fc2c8b23SAlex Brachet LLVM_LIBC_FUNCTION(size_t, strlcpy,
18fc2c8b23SAlex Brachet                    (char *__restrict dst, const char *__restrict src,
19fc2c8b23SAlex Brachet                     size_t size)) {
20b1183305SAlex Brachet   return internal::strlcpy(dst, src, size);
21fc2c8b23SAlex Brachet }
22fc2c8b23SAlex Brachet 
23*5ff3ff33SPetr Hosek } // namespace LIBC_NAMESPACE_DECL
24