簡體   English   中英

如何在我的系統(Mac OS)上找到 C getchar() 的實現?

[英]how to find the implementation of C getchar() on my system (Mac OS)?

我知道int getchar(void)是一個 C 庫 function。

如何在我當前的 Mac OS 上找到它的實現? 僅供參考,使用來自終端的“man getchar”我得到:

GETC(3)                  BSD Library Functions Manual                  GETC(3)

NAME
     fgetc, getc, getc_unlocked, getchar, getchar_unlocked, getw -- get next character or word from input stream

LIBRARY
     Standard C Library (libc, -lc)

SYNOPSIS
     #include <stdio.h>

     int
     fgetc(FILE *stream);

     int
     getc(FILE *stream);

     int
     getc_unlocked(FILE *stream);

     int
     getchar(void);

     int
     getchar_unlocked(void);

     int
     getw(FILE *stream);

如果你想看看 Apple 的實現,你必須看看他們的開源部分:

https://opensource.apple.com/source/Libc/Libc-1272.250.1/stdio/FreeBSD/getchar.c.auto.ZFC35FDC70D5FC69D263988A3

您可以在以下位置找到所有開源代碼:opensource.apple.com

除非,通過實施我們的意思是:

> nm /usr/lib/libcupscgi.dylib | grep "getchar"
U _getchar

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM