요약·해설과 원문, 전문 번역을 서로 분리했습니다. 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-munmap:
************
DVB munmap()
************
Name
====
dmx-munmap - Unmap device memory
.. warning:: This API is still experimental.
Synopsis
========
.. code-block:: c
#include <unistd.h>
#include <sys/mman.h>
.. c:function:: int munmap( void *start, size_t length )
Arguments
=========
``start``
Address of the mapped buffer as returned by the
:c:func:`mmap()` function.
``length``
Length of the mapped buffer. This must be the same value as given to
:c:func:`mmap()`.
Description
===========
Unmaps a previously with the :c:func:`mmap()` function mapped
buffer and frees it, if possible.
Return Value
============
On success :c:func:`munmap()` returns 0, on failure -1 and the
``errno`` variable is set appropriately:
EINVAL
The ``start`` or ``length`` is incorrect, or no buffers have been
mapped yet.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름, 실험 상태와 호출 형식
1-25이 문서는 GFDL-1.1-no-invariants-or-later 라이선스와 `DTV.dmx` C namespace를 사용하며 DVB의 `munmap()` 인터페이스를 설명합니다.
`dmx-munmap`은 장치 메모리 매핑을 해제하며 이 API는 아직 실험적입니다.
사용자는 `unistd.h`와 `sys/mman.h`를 포함하며, 함수 원형은 `int munmap(void *start, size_t length)`입니다.
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: DTV.dmx
.. _dmx-munmap:
************
DVB munmap()
************
Name
====
dmx-munmap - Unmap device memory
.. warning:: This API is still experimental.
Synopsis
========
.. code-block:: c
#include <unistd.h>
#include <sys/mman.h>
.. c:function:: int munmap( void *start, size_t length )
인자와 매핑 해제
26-42`start`는 `mmap()`이 반환한 매핑 버퍼 주소입니다.
`length`는 매핑 버퍼의 길이이며 `mmap()`에 전달했던 값과 정확히 같아야 합니다.
이 함수는 앞서 `mmap()`으로 매핑한 버퍼의 매핑을 해제하고, 가능하면 그 버퍼를 해제합니다.
mmap 반환값과 같은 길이를 짝으로 사용합니다.
Arguments
=========
``start``
Address of the mapped buffer as returned by the
:c:func:`mmap()` function.
``length``
Length of the mapped buffer. This must be the same value as given to
:c:func:`mmap()`.
Description
===========
Unmaps a previously with the :c:func:`mmap()` function mapped
buffer and frees it, if possible.
반환값과 EINVAL
43-52성공하면 `munmap()`은 0을 반환하고, 실패하면 -1을 반환하며 `errno`를 적절히 설정합니다.
문서가 명시한 EINVAL 조건입니다.
Return Value
============
On success :c:func:`munmap()` returns 0, on failure -1 and the
``errno`` variable is set appropriately:
EINVAL
The ``start`` or ``length`` is incorrect, or no buffers have been
mapped yet.
요약·해설
dmx-munmap.rst:1-52munmap은 mmap이 반환한 시작 주소와 같은 length를 사용해 매핑을 해제하고 가능한 경우 버퍼 자원도 해제합니다.