← Documents Documentation/userspace-api/media/cec/cec-func-close.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / CEC

CEC close()

CEC device descriptor를 닫을 때 해제되는 자원, 유지되는 설정과 EBADF 오류를 설명합니다.

Source pathDocumentation/userspace-api/media/cec/cec-func-close.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

cec-func-close.rst:1-43

`close(fd)`는 descriptor 관련 resource만 해제하고 CEC device configuration은 변경하지 않습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: CEC
3
4 .. _cec-func-close:
5
6 ***********
7 cec close()
8 ***********
9
10 Name
11 ====
12
13 cec-close - Close a cec device
14
15 Synopsis
16 ========
17
18 .. code-block:: c
19
20 #include <unistd.h>
21
22 .. c:function:: int close( int fd )
23
24 Arguments
25 =========
26
27 ``fd``
28 File descriptor returned by :c:func:`open()`.
29
30 Description
31 ===========
32
33 Closes the cec device. Resources associated with the file descriptor are
34 freed. The device configuration remain unchanged.
35
36 Return Value
37 ============
38
39 :c:func:`close()` returns 0 on success. On error, -1 is returned, and
40 ``errno`` is set appropriately. Possible error codes are:
41
42 ``EBADF``
43 ``fd`` is not a valid open file descriptor.
44

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

이름과 선언

1-21

`cec-close`는 CEC device를 닫는 함수입니다. C namespace는 `CEC`이며 `<unistd.h>`를 포함합니다.

함수 원형은 `int close(int fd)`입니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: CEC

.. _cec-func-close:

***********
cec close()
***********

Name
====

cec-close - Close a cec device

Synopsis
========

.. code-block:: c

    #include <unistd.h>

인자

22-27

`fd`는 `open()`이 반환한 file descriptor입니다.

.. c:function:: int close( int fd )

Arguments
=========

``fd``

동작

28-34

호출은 CEC device를 닫고 file descriptor에 연결된 resource를 해제합니다.

device configuration은 변경하지 않고 그대로 유지합니다.

CEC device 닫기
open()이 반환한 fdclose(fd)FD 관련 resource 해제device configuration 유지

descriptor 자원만 해제하며 adapter 설정은 유지합니다.

    File descriptor returned by :c:func:`open()`.

Description
===========

Closes the cec device. Resources associated with the file descriptor are
freed. The device configuration remain unchanged.

반환값

35-43

성공하면 `close()`는 0을 반환합니다. 오류이면 -1을 반환하고 `errno`를 적절히 설정합니다.

`EBADF`는 `fd`가 유효하게 열린 file descriptor가 아님을 뜻합니다.

close() 결과
항목설명
성공0
오류-1, errno 설정
EBADF유효한 open file descriptor가 아님

성공과 문서에 명시된 오류입니다.


Return Value
============

:c:func:`close()` returns 0 on success. On error, -1 is returned, and
``errno`` is set appropriately. Possible error codes are:

``EBADF``
    ``fd`` is not a valid open file descriptor.