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

Linux 6.18.37 · Userspace API / Media / V4L

V4L2 close()

V4L2 장치 descriptor를 닫을 때의 I/O 종료, 설정 유지와 오류를 설명합니다.

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

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

1. 요약·해설

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

요약·해설

func-close.rst:1-45

`close()`는 descriptor의 I/O와 resource를 끝내지만 장치의 format, input/output과 control 값은 그대로 유지합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _func-close:
5
6 ************
7 V4L2 close()
8 ************
9
10 Name
11 ====
12
13 v4l2-close - Close a V4L2 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 device. Any I/O in progress is terminated and resources
34 associated with the file descriptor are freed. However data format
35 parameters, current input or output, control values or other properties
36 remain unchanged.
37
38 Return Value
39 ============
40
41 The function returns 0 on success, -1 on failure and the ``errno`` is
42 set appropriately. Possible error codes:
43
44 EBADF
45 ``fd`` is not a valid open file descriptor.
46

3. 한국어 전문 번역

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

이름, 선언과 인자

1-29

`v4l2-close`는 열린 V4L2 장치를 닫습니다. `<unistd.h>`를 포함하고 `int close(int fd)`를 호출합니다. `fd`는 `open()`이 반환한 file descriptor입니다.

`close()` 인자
항목설명
`fd``open()`이 반환한 유효한 file descriptor

열린 장치 descriptor 하나를 받습니다.

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

.. _func-close:

************
V4L2 close()
************

Name
====

v4l2-close - Close a V4L2 device

Synopsis
========

.. code-block:: c

    #include <unistd.h>

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

Arguments
=========

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

종료 동작과 반환값

30-45

장치를 닫으면 진행 중인 모든 I/O가 종료되고 file descriptor에 연결된 resource가 해제됩니다. 그러나 data format parameter, 현재 input 또는 output, control value와 그 밖의 장치 속성은 바뀌지 않습니다.

성공하면 0, 실패하면 -1을 반환하고 `errno`를 설정합니다. `EBADF`는 `fd`가 유효하게 열린 file descriptor가 아님을 뜻합니다.

장치 닫기
진행 중 I/O 종료Descriptor 관련 resource 해제Format·input/output·control 값 유지성공 0 또는 실패 -1과 errno 반환

Descriptor 수명은 끝나지만 장치의 지속 설정은 유지됩니다.

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

Closes the device. Any I/O in progress is terminated and resources
associated with the file descriptor are freed. However data format
parameters, current input or output, control values or other properties
remain unchanged.

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

The function returns 0 on success, -1 on failure and the ``errno`` is
set appropriately. Possible error codes:

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