perf tools: Add writen function
authorJiri Olsa <jolsa@redhat.com>
Thu, 28 Nov 2013 10:30:16 +0000 (11:30 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 2 Dec 2013 12:22:46 +0000 (09:22 -0300)
commitbc3a502bc2bc78d03526d6abcc5697aab18d5ae9
tree9811125522636d12b6c2bb67d8ef4e8c69f6511c
parent838d14520267769648fb2fc2a637107a1d102590
perf tools: Add writen function

Adding 'writen' function as a synchronous wrapper for write syscall with
following prototype:

  ssize_t writen(int fd, void *buf, size_t n)

Returns the number of bytes written on success or -1 in case of err.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Requested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1385634619-8129-5-git-send-email-jolsa@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/util.c
tools/perf/util/util.h