요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_GET_LINEINFO_IOCTL:
***********************
GPIO_GET_LINEINFO_IOCTL
***********************
.. warning::
This ioctl is part of chardev_v1.rst and is obsoleted by
gpio-v2-get-lineinfo-ioctl.rst.
Name
====
GPIO_GET_LINEINFO_IOCTL - Get the publicly available information for a line.
Synopsis
========
.. c:macro:: GPIO_GET_LINEINFO_IOCTL
``int ioctl(int chip_fd, GPIO_GET_LINEINFO_IOCTL, struct gpioline_info *info)``
Arguments
=========
``chip_fd``
The file descriptor of the GPIO character device returned by `open()`.
``info``
The :c:type:`line_info<gpioline_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-get-linehandle-ioctl.rst or
gpio-get-lineevent-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-34`GPIO_GET_LINEINFO_IOCTL`은 한 GPIO line에 관해 공개 가능한 정보를 가져옵니다. 이 ioctl은 `chardev_v1.rst`의 ABI v1에 속하며 `gpio-v2-get-lineinfo-ioctl.rst`로 대체되었습니다.
호출 형식은 `int ioctl(int chip_fd, GPIO_GET_LINEINFO_IOCTL, struct gpioline_info *info)`입니다. `chip_fd`는 GPIO character device를 `open()`해 얻습니다. `info`는 kernel이 채울 `gpioline_info` 구조체이며, 조회할 line을 지정하도록 호출 전에 `offset` field를 설정해야 합니다.
입출력 구조체의 offset이 조회 대상을 선택합니다.
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_GET_LINEINFO_IOCTL:
***********************
GPIO_GET_LINEINFO_IOCTL
***********************
.. warning::
This ioctl is part of chardev_v1.rst and is obsoleted by
gpio-v2-get-lineinfo-ioctl.rst.
Name
====
GPIO_GET_LINEINFO_IOCTL - Get the publicly available information for a line.
Synopsis
========
.. c:macro:: GPIO_GET_LINEINFO_IOCTL
``int ioctl(int chip_fd, GPIO_GET_LINEINFO_IOCTL, struct gpioline_info *info)``
Arguments
=========
``chip_fd``
The file descriptor of the GPIO character device returned by `open()`.
``info``
The :c:type:`line_info<gpioline_info>` to be populated, with the
``offset`` field set to indicate the line to be collected.
조회 범위와 값 접근 제한
35-47호출은 한 line의 공개 정보를 가져오며, 해당 line이 현재 사용 중인지와 관계없이 조회할 수 있습니다.
Line info에는 line 값이 포함되지 않습니다. 값을 읽으려면 `gpio-get-linehandle-ioctl.rst` 또는 `gpio-get-lineevent-ioctl.rst`로 line을 먼저 요청해야 합니다.
Metadata 조회와 실제 값 접근은 서로 다른 ABI 경로입니다.
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-get-linehandle-ioctl.rst or
gpio-get-lineevent-ioctl.rst to access its value.
반환값
48-54성공하면 0을 반환하고 `info`를 채웁니다. 원문은 이 결과를 chip info라고 표현하지만, 인자와 본문 문맥상 조회한 line의 `gpioline_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-get-lineinfo-ioctl.rst:1-54ABI v1 line metadata 조회와 실제 line 값 접근의 차이 및 반환 규약을 설명합니다.
원문의 ioctl prototype, struct, flag, errno, source path와 줄 좌표를 보존해 전문 번역했습니다.