summaryrefslogtreecommitdiff
path: root/static/unix-v10/man3/getchr.3
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/unix-v10/man3/getchr.3
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/unix-v10/man3/getchr.3')
-rw-r--r--static/unix-v10/man3/getchr.355
1 files changed, 55 insertions, 0 deletions
diff --git a/static/unix-v10/man3/getchr.3 b/static/unix-v10/man3/getchr.3
new file mode 100644
index 00000000..8a41ae69
--- /dev/null
+++ b/static/unix-v10/man3/getchr.3
@@ -0,0 +1,55 @@
+.th GETCHAR III 4/7/73
+.sh NAME
+getchar \*- read character
+.sh SYNOPSIS
+.ft B
+getchar( )
+.br
+.ft R
+.sh DESCRIPTION
+.it Getchar
+provides the simplest means of reading characters from
+the standard input for C programs.
+It returns successive characters until end-of-file,
+when it returns ``\\0''.
+.s3
+Associated with this routine is an external variable
+called \fIfin\fR, which is a structure containing
+a buffer such as described under \fIgetc\fR (III).
+.s3
+Normally input via \fIgetchar\fR is unbuffered,
+but if the file-descriptor (first) word of
+.it fin
+is non-zero,
+.it getchar
+calls
+.it getc
+with
+.it fin
+as
+argument.
+This means that
+.s3
+ fin = open(...)
+.s3
+makes
+.it getchar
+return (buffered) input from
+the opened file; also
+.s3
+ fin = dup(0);
+.s3
+causes the standard input to be buffered.
+.s3
+Generally speaking,
+.it getchar
+should be used only for the simplest applications;
+.it getc
+is better when there are multiple input files.
+.sh "SEE ALSO"
+getc (III)
+.sh DIAGNOSTICS
+Null character returned on EOF or error.
+.sh BUGS
+\*-1 should be
+returned on EOF; null is a legitimate character.