요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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>
.. c:function:: int close( int fd )
Arguments
=========
``fd``
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.
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.
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은 변경하지 않고 그대로 유지합니다.
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가 아님을 뜻합니다.
성공과 문서에 명시된 오류입니다.
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.
요약·해설
cec-func-close.rst:1-43`close(fd)`는 descriptor 관련 resource만 해제하고 CEC device configuration은 변경하지 않습니다.