1 //===-- GPU Implementation of fputs ---------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "src/stdio/fputs.h"
10 #include "src/__support/CPP/string_view.h"
11 #include "src/errno/libc_errno.h"
12 #include "src/stdio/gpu/file.h"
16 namespace LIBC_NAMESPACE
{
18 LLVM_LIBC_FUNCTION(int, fputs
,
19 (const char *__restrict str
, ::FILE *__restrict stream
)) {
20 cpp::string_view
str_view(str
);
21 auto written
= file::write(stream
, str
, str_view
.size());
22 if (written
!= str_view
.size())
27 } // namespace LIBC_NAMESPACE