about summary refs log tree commit diff homepage
path: root/runtime/klee-libc/putchar.c
blob: 497402a648daf148b28a2a861fad660a88ea6b4f (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;
}