getw

Section: C Library Functions (3)
Updated: 2026-02-08
Index JM Home Page roff page
 

名前

getw, putw - ワード(int)の入出力  

ライブラリ

標準 C ライブラリ (libc,~-lc)  

書式

#include <stdio.h>

int getw(FILE *stream);
int putw(int w, FILE *stream);

glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):

getw(), putw():

    Since glibc 2.3.3:
        _XOPEN_SOURCE && ! (_POSIX_C_SOURCE >= 200112L)
            || /* glibc >= 2.19: */ _DEFAULT_SOURCE
            || /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
    Before glibc 2.3.3:
        _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
 

説明

getw() reads a word (that is, an int) from stream. It's provided for compatibility with SVr4. We recommend you use fread(3) instead.

putw() writes the word w (that is, an int) to stream. It is provided for compatibility with SVr4, but we recommend you use fwrite(3) instead.  

返り値

通常、 getw() は読み込んだワードを返し、 putw() は 0 を返す。 エラーが発生した場合、これらの関数は EOF を返す。  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース属性値
getw(), putw() Thread safetyMT-Safe
 

標準規格

なし。  

歴史

SVr4, SUSv2.  

バグ

エラーの時に返される値は、正しいデータとして返されることもある。 ferror(3) を用いると、この二つの場合を区別することが出来る。  

関連項目

ferror(3), fread(3), fwrite(3), getc(3), putc(3)


 

Index

名前
ライブラリ
書式
説明
返り値
属性
標準規格
歴史
バグ
関連項目

This document was created by man2html, using the manual pages.