요약·해설과 원문, 전문 번역을 서로 분리했습니다. 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_fwrite:
========================
Digital TV demux write()
========================
Name
----
Digital TV demux write()
Synopsis
--------
.. c:function:: ssize_t write(int fd, const void *buf, size_t count)
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open()`.
``buf``
Buffer with data to be written
``count``
Number of bytes at the buffer
Description
-----------
This system call is only provided by the logical device
``/dev/dvb/adapter?/dvr?``, associated with the physical demux device that
provides the actual DVR functionality. It is used for replay of a
digitally recorded Transport Stream. Matching filters have to be defined
in the corresponding physical demux device, ``/dev/dvb/adapter?/demux?``.
The amount of data to be transferred is implied by count.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``EWOULDBLOCK``
- No data was written. This might happen if ``O_NONBLOCK`` was
specified and there is no more buffer space available (if
``O_NONBLOCK`` is not specified the function will block until buffer
space is available).
- - ``EBUSY``
- This error code indicates that there are conflicting requests. The
corresponding demux device is setup to receive data from the
front- end. Make sure that these filters are stopped and that the
filters with input set to ``DMX_IN_DVR`` are started.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름과 호출 형식
1-18이 문서는 GFDL-1.1-no-invariants-or-later 라이선스와 `DTV.dmx` C namespace를 사용하며 `dmx_fwrite` 참조 대상으로 Digital TV demux의 `write()`를 설명합니다.
함수 원형은 `ssize_t write(int fd, const void *buf, size_t count)`입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.dmx
.. _dmx_fwrite:
========================
Digital TV demux write()
========================
Name
----
Digital TV demux write()
Synopsis
--------
.. c:function:: ssize_t write(int fd, const void *buf, size_t count)
쓰기 인자
19-30`fd`는 앞선 `open()` 호출이 반환한 file descriptor입니다.
`buf`는 기록할 데이터가 든 버퍼이고, `count`는 그 버퍼에 있는 바이트 수입니다.
재생할 전송 스트림을 전달하는 세 인자입니다.
Arguments
---------
``fd``
File descriptor returned by a previous call to :c:func:`open()`.
``buf``
Buffer with data to be written
``count``
Number of bytes at the buffer
DVR 재생 데이터 경로
31-40이 시스템 호출은 실제 DVR 기능을 제공하는 물리 demux 장치와 연결된 논리 장치 `/dev/dvb/adapter?/dvr?`에서만 제공합니다.
디지털 방식으로 녹화한 Transport Stream을 재생할 때 사용하며, 대응하는 물리 demux 장치 `/dev/dvb/adapter?/demux?`에 일치하는 필터를 미리 정의해야 합니다.
전송할 데이터 양은 `count`로 정합니다.
DVR 입력과 물리 demux 필터를 함께 준비합니다.
Description
-----------
This system call is only provided by the logical device
``/dev/dvb/adapter?/dvr?``, associated with the physical demux device that
provides the actual DVR functionality. It is used for replay of a
digitally recorded Transport Stream. Matching filters have to be defined
in the corresponding physical demux device, ``/dev/dvb/adapter?/demux?``.
The amount of data to be transferred is implied by count.
반환값과 오류
41-70원문은 성공 시 0을 반환한다고 명시합니다. 함수 원형은 `ssize_t`이지만 반환 절의 문구는 수정하지 않고 그대로 옮깁니다.
오류가 발생하면 -1을 반환하고 `errno`를 적절히 설정합니다.
비차단 버퍼 부족과 상충하는 입력 구성을 구분합니다.
`O_NONBLOCK`을 지정하지 않았다면 버퍼 공간이 생길 때까지 함수가 차단됩니다.
`EBUSY`를 피하려면 front-end 입력을 사용하는 필터를 중지하고, 입력이 `DMX_IN_DVR`로 설정된 필터를 시작해야 합니다.
front-end 수신과 DVR 재생 입력의 충돌을 해소합니다.
그 밖의 공통 오류 코드는 `Generic Error Codes <gen-errors>` 장에서 설명합니다.
Return Value
------------
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
appropriately.
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- - ``EWOULDBLOCK``
- No data was written. This might happen if ``O_NONBLOCK`` was
specified and there is no more buffer space available (if
``O_NONBLOCK`` is not specified the function will block until buffer
space is available).
- - ``EBUSY``
- This error code indicates that there are conflicting requests. The
corresponding demux device is setup to receive data from the
front- end. Make sure that these filters are stopped and that the
filters with input set to ``DMX_IN_DVR`` are started.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
요약·해설
dmx-fwrite.rst:1-70write()는 DVR 논리 장치를 통한 녹화 TS 재생 경로입니다. 대응 demux 필터를 DMX_IN_DVR 입력으로 준비해야 front-end 수신 구성과 충돌하지 않습니다.