요약·해설, 영어 원문, 전체 번역을 구분해 실었습니다. API 이름, 코드 심벌, 소스 경로는 원문 표기를 유지합니다.
1. 요약·해설
원문의 핵심 내용을 정리하고 커널 프로그래밍에 필요한 설명을 덧붙였습니다. 아래의 전체 번역과는 별도로 작성한 해설입니다.
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. 한국어 전문 번역
영어 원문의 문단 순서와 의미에 맞춰 전체 내용을 번역했습니다. 코드, 함수명, 코드 심벌, 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됩니다.