summaryrefslogtreecommitdiffstats
path: root/adb/transport.h
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2015-02-24 21:26:58 -0800
committerDan Albert <danalbert@google.com>2015-02-25 15:07:57 -0800
commitcc731cc76786b6bdc58764aad9924c0d0c8d645f (patch)
tree57906636c803e1ae089c2fcf2905d82488b0ba72 /adb/transport.h
parenta035d5003ea593322ba565df9a4f4d0dd6647acf (diff)
downloadsystem_core-cc731cc76786b6bdc58764aad9924c0d0c8d645f.zip
system_core-cc731cc76786b6bdc58764aad9924c0d0c8d645f.tar.gz
system_core-cc731cc76786b6bdc58764aad9924c0d0c8d645f.tar.bz2
Test readx/writex (now renamed).
Renamed readx/writex to ReadFdExactly/WriteFdExactly respectively. These read/write a full fixed-size buffer. If the whole buffer cannot be read/written, these functions return an error. Rename write_string to WriteStringFully. Move the TEMP_FAILURE_RETRY definition in sysdeps.h out of the !Windows section. It seems Windows won't actually interrupt a call, but it's easier to just define it than to #ifdef each call. Change-Id: Ia8ddffa2a52764a2f9a281c96c937660e002b9b9
Diffstat (limited to 'adb/transport.h')
-rw-r--r--adb/transport.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/adb/transport.h b/adb/transport.h
index 9802b91..352bbe4 100644
--- a/adb/transport.h
+++ b/adb/transport.h
@@ -17,6 +17,7 @@
#ifndef __TRANSPORT_H
#define __TRANSPORT_H
+#include <stdbool.h>
#include <sys/types.h>
#include "adb.h"
@@ -25,13 +26,9 @@
extern "C" {
#endif
-/*
- * Convenience wrappers around read/write that will retry on
- * EINTR and/or short read/write. Returns 0 on success, -1
- * on error or EOF.
- */
-int readx(int fd, void *ptr, size_t len);
-int writex(int fd, const void *ptr, size_t len);
+#if ADB_TRACE
+void dump_hex(const unsigned char* ptr, size_t len);
+#endif
/*
* Obtain a transport from the available transports.