요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_V2_GET_LINEINFO_IOCTL:
**************************
GPIO_V2_GET_LINEINFO_IOCTL
**************************
Name
====
GPIO_V2_GET_LINEINFO_IOCTL - Get the publicly available information for a line.
Synopsis
========
.. c:macro:: GPIO_V2_GET_LINEINFO_IOCTL
``int ioctl(int chip_fd, GPIO_V2_GET_LINEINFO_IOCTL, struct gpio_v2_line_info *info)``
Arguments
=========
``chip_fd``
The file descriptor of the GPIO character device returned by `open()`.
``info``
The :c:type:`line_info<gpio_v2_line_info>` to be populated, with the
``offset`` field set to indicate the line to be collected.
Description
===========
Get the publicly available information for a line.
This information is available independent of whether the line is in use.
.. note::
The line info does not include the line value.
The line must be requested using gpio-v2-get-line-ioctl.rst to access its
value.
Return Value
============
On success 0 and ``info`` is populated with the chip info.
On error -1 and the ``errno`` variable is set appropriately.
Common error codes are described in error-codes.rst.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름과 호출 형식
1-30`GPIO_V2_GET_LINEINFO_IOCTL`은 한 GPIO line에 관해 공개 가능한 정보를 가져옵니다. 호출 형식은 `int ioctl(int chip_fd, GPIO_V2_GET_LINEINFO_IOCTL, struct gpio_v2_line_info *info)`입니다.
`chip_fd`는 GPIO character device를 `open()`해 얻습니다. `info`는 kernel이 채울 `gpio_v2_line_info` 구조체이며, 조회할 line을 선택하도록 호출 전에 `offset` field를 설정합니다.
Offset으로 line을 선택하고 같은 구조체로 현재 정보를 받습니다.
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_V2_GET_LINEINFO_IOCTL:
**************************
GPIO_V2_GET_LINEINFO_IOCTL
**************************
Name
====
GPIO_V2_GET_LINEINFO_IOCTL - Get the publicly available information for a line.
Synopsis
========
.. c:macro:: GPIO_V2_GET_LINEINFO_IOCTL
``int ioctl(int chip_fd, GPIO_V2_GET_LINEINFO_IOCTL, struct gpio_v2_line_info *info)``
Arguments
=========
``chip_fd``
The file descriptor of the GPIO character device returned by `open()`.
``info``
The :c:type:`line_info<gpio_v2_line_info>` to be populated, with the
``offset`` field set to indicate the line to be collected.
조회 범위와 값 접근
31-43호출은 line이 현재 사용 중인지와 무관하게 해당 line의 공개 정보를 반환합니다. Line info에는 line 값이 포함되지 않습니다.
Line 값에 접근하려면 `gpio-v2-get-line-ioctl.rst`로 line을 요청해야 합니다.
Metadata와 value 접근은 분리되어 있습니다.
Description
===========
Get the publicly available information for a line.
This information is available independent of whether the line is in use.
.. note::
The line info does not include the line value.
The line must be requested using gpio-v2-get-line-ioctl.rst to access its
value.
반환값
44-50성공하면 0을 반환하고 `info`를 채웁니다. 원문은 chip info라고 표현하지만 인자와 본문 문맥상 조회한 line의 `gpio_v2_line_info`를 뜻합니다. 실패하면 -1을 반환하고 `errno`를 설정하며 공통 오류는 `error-codes.rst`를 따릅니다.
Return Value
============
On success 0 and ``info`` is populated with the chip info.
On error -1 and the ``errno`` variable is set appropriately.
Common error codes are described in error-codes.rst.
요약·해설
gpio-v2-get-lineinfo-ioctl.rst:1-50GPIO ABI v2 line metadata 조회와 실제 line 값 접근의 분리를 설명합니다.
원문의 ioctl/read prototype, struct, flag, errno, clock, buffer 규칙과 줄 좌표를 보존해 전문 번역했습니다.