getchar.c (d1d015864103b253b3fcb2f72a0da5b0cfeb31b6) getchar.c (25070501c638474bf35d30c744d449fdfee787e7)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 35 unchanged lines hidden (view full) ---

44#include "un-namespace.h"
45#include "local.h"
46#include "libc_private.h"
47
48#undef getchar
49#undef getchar_unlocked
50
51int
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Chris Torek.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 35 unchanged lines hidden (view full) ---

44#include "un-namespace.h"
45#include "local.h"
46#include "libc_private.h"
47
48#undef getchar
49#undef getchar_unlocked
50
51int
52getchar()
52getchar(void)
53{
54 int retval;
55 FLOCKFILE(stdin);
56 /* Orientation set by __sgetc() when buffer is empty. */
57 /* ORIENT(stdin, -1); */
58 retval = __sgetc(stdin);
59 FUNLOCKFILE(stdin);
60 return (retval);
61}
62
63int
64getchar_unlocked(void)
65{
66
67 return (__sgetc(stdin));
68}
53{
54 int retval;
55 FLOCKFILE(stdin);
56 /* Orientation set by __sgetc() when buffer is empty. */
57 /* ORIENT(stdin, -1); */
58 retval = __sgetc(stdin);
59 FUNLOCKFILE(stdin);
60 return (retval);
61}
62
63int
64getchar_unlocked(void)
65{
66
67 return (__sgetc(stdin));
68}