about summary refs log tree commit diff homepage
path: root/runtime/klee-libc/putchar.c
blob: bee2d2d75735dc4e865d354ac1cf7c4da622615c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*===-- putchar.c ---------------------------------------------------------===//
//
//                     The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===*/

#include <stdio.h>
#include <unistd.h>

/* Some header may #define putchar. */
#undef putchar

int putchar(int c) {
  char x = c;
  if (1 == write(1, &x, 1))
    return c;
  return EOF;
}