요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.dmx
.. _DMX_SET_FILTER:
==============
DMX_SET_FILTER
==============
Name
----
DMX_SET_FILTER
Synopsis
--------
.. c:macro:: DMX_SET_FILTER
``int ioctl(int fd, DMX_SET_FILTER, struct dmx_sct_filter_params *params)``
Arguments
---------
``fd``
File descriptor returned by :c:func:`open()`.
``params``
Pointer to structure containing filter parameters.
Description
-----------
This ioctl call sets up a filter according to the filter and mask
parameters provided. A timeout may be defined stating number of seconds
to wait for a section to be loaded. A value of 0 means that no timeout
should be applied. Finally there is a flag field where it is possible to
state whether a section should be CRC-checked, whether the filter should
be a "one-shot" filter, i.e. if the filtering operation should be
stopped after the first section is received, and whether the filtering
operation should be started immediately (without waiting for a
:ref:`DMX_START` ioctl call). If a filter was previously set-up, this
filter will be canceled, and the receive buffer will be flushed.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름과 호출 형식
1-20이 문서는 GFDL-1.1-no-invariants-or-later 라이선스와 `DTV.dmx` C namespace를 사용하며 `DMX_SET_FILTER` ioctl을 설명합니다.
호출 형식은 `int ioctl(int fd, DMX_SET_FILTER, struct dmx_sct_filter_params *params)`입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.dmx
.. _DMX_SET_FILTER:
==============
DMX_SET_FILTER
==============
Name
----
DMX_SET_FILTER
Synopsis
--------
.. c:macro:: DMX_SET_FILTER
``int ioctl(int fd, DMX_SET_FILTER, struct dmx_sct_filter_params *params)``
section 필터 매개변수와 플래그
21-44`fd`는 `open()`이 반환한 file descriptor이고, `params`는 필터 매개변수가 든 구조체를 가리킵니다.
이 ioctl은 제공된 filter와 mask 매개변수에 따라 section 필터를 구성합니다.
timeout에는 section이 적재되기를 기다릴 초 수를 지정할 수 있고, 0은 제한 시간을 적용하지 않는다는 뜻입니다.
flag 필드에서는 section CRC 검사 여부, 첫 section을 받은 뒤 필터링을 멈추는 one-shot 여부, 별도의 `DMX_START`를 기다리지 않고 즉시 시작할지를 지정할 수 있습니다.
이미 설정된 필터가 있으면 기존 필터를 취소하고 receive buffer를 비웁니다.
section 필터에서 선택할 수 있는 동작입니다.
기존 필터가 있는 fd에 새 구성을 적용하는 과정입니다.
Arguments
---------
``fd``
File descriptor returned by :c:func:`open()`.
``params``
Pointer to structure containing filter parameters.
Description
-----------
This ioctl call sets up a filter according to the filter and mask
parameters provided. A timeout may be defined stating number of seconds
to wait for a section to be loaded. A value of 0 means that no timeout
should be applied. Finally there is a flag field where it is possible to
state whether a section should be CRC-checked, whether the filter should
be a "one-shot" filter, i.e. if the filtering operation should be
stopped after the first section is received, and whether the filtering
operation should be started immediately (without waiting for a
:ref:`DMX_START` ioctl call). If a filter was previously set-up, this
filter will be canceled, and the receive buffer will be flushed.
반환값
45-55성공하면 0을 반환합니다.
오류가 발생하면 -1을 반환하고 `errno`를 적절히 설정합니다. 공통 오류 코드는 `Generic Error Codes <gen-errors>` 장에서 설명합니다.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
요약·해설
dmx-set-filter.rst:1-55DMX_SET_FILTER는 section의 filter/mask, timeout, CRC·one-shot·즉시 시작 플래그를 설정합니다. 기존 필터는 취소되고 receive buffer는 flush됩니다.