summaryrefslogtreecommitdiffstats
path: root/liblog
diff options
context:
space:
mode:
authorColin Cross2013-07-23 18:59:20 -0500
committerColin Cross2013-07-24 14:32:39 -0500
commit9227bd385504ace739d4451a6c5dc3d777b5bf21 (patch)
tree355484e01ff5efa0be976905767fc7126a678cb6 /liblog
parent87bc464a9f62f026fd841d3b54cfb1a5d57d83a3 (diff)
downloadplatform-system-core-9227bd385504ace739d4451a6c5dc3d777b5bf21.tar.gz
platform-system-core-9227bd385504ace739d4451a6c5dc3d777b5bf21.tar.xz
platform-system-core-9227bd385504ace739d4451a6c5dc3d777b5bf21.zip
Move liblog headers to system/core/include/log
Move the liblog headers to log/ instead of cutils/ to complete the separation of libcutils and liblog. cutils/log.h still exists and includes log/log.h in order to support the many existing modules that use cutils/log.h. Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
Diffstat (limited to 'liblog')
-rw-r--r--liblog/Android.mk3
-rw-r--r--liblog/event_tag_map.c4
-rw-r--r--liblog/fake_log_device.c2
-rw-r--r--liblog/logd_write.c6
-rw-r--r--liblog/logprint.c4
-rw-r--r--liblog/uio.c76
6 files changed, 87 insertions, 8 deletions
diff --git a/liblog/Android.mk b/liblog/Android.mk
index be5cec261..6bfb11966 100644
--- a/liblog/Android.mk
+++ b/liblog/Android.mk
@@ -36,6 +36,9 @@ ifndef WITH_MINGW
36 liblog_sources += \ 36 liblog_sources += \
37 logprint.c \ 37 logprint.c \
38 event_tag_map.c 38 event_tag_map.c
39else
40 liblog_sources += \
41 uio.c
39endif 42endif
40 43
41liblog_host_sources := $(liblog_sources) fake_log_device.c 44liblog_host_sources := $(liblog_sources) fake_log_device.c
diff --git a/liblog/event_tag_map.c b/liblog/event_tag_map.c
index e70754e17..f3d1e2fe2 100644
--- a/liblog/event_tag_map.c
+++ b/liblog/event_tag_map.c
@@ -13,8 +13,8 @@
13 * See the License for the specific language governing permissions and 13 * See the License for the specific language governing permissions and
14 * limitations under the License. 14 * limitations under the License.
15 */ 15 */
16#include "cutils/event_tag_map.h" 16#include <log/event_tag_map.h>
17#include "cutils/log.h" 17#include <log/log.h>
18 18
19#include <stdlib.h> 19#include <stdlib.h>
20#include <string.h> 20#include <string.h>
diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c
index df4329921..528361986 100644
--- a/liblog/fake_log_device.c
+++ b/liblog/fake_log_device.c
@@ -19,7 +19,7 @@
19 * passed on to the underlying (fake) log device. When not in the 19 * passed on to the underlying (fake) log device. When not in the
20 * simulator, messages are printed to stderr. 20 * simulator, messages are printed to stderr.
21 */ 21 */
22#include "cutils/logd.h" 22#include <log/logd.h>
23 23
24#include <stdlib.h> 24#include <stdlib.h>
25#include <string.h> 25#include <string.h>
diff --git a/liblog/logd_write.c b/liblog/logd_write.c
index 3613d25f2..fff7cc4dd 100644
--- a/liblog/logd_write.c
+++ b/liblog/logd_write.c
@@ -27,9 +27,9 @@
27#include <sys/types.h> 27#include <sys/types.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
29 29
30#include <cutils/logger.h> 30#include <log/logger.h>
31#include <cutils/logd.h> 31#include <log/logd.h>
32#include <cutils/log.h> 32#include <log/log.h>
33 33
34#define LOG_BUF_SIZE 1024 34#define LOG_BUF_SIZE 1024
35 35
diff --git a/liblog/logprint.c b/liblog/logprint.c
index 6fac84b46..508c82565 100644
--- a/liblog/logprint.c
+++ b/liblog/logprint.c
@@ -26,8 +26,8 @@
26#include <assert.h> 26#include <assert.h>
27#include <arpa/inet.h> 27#include <arpa/inet.h>
28 28
29#include <cutils/logd.h> 29#include <log/logd.h>
30#include <cutils/logprint.h> 30#include <log/logprint.h>
31 31
32typedef struct FilterInfo_t { 32typedef struct FilterInfo_t {
33 char *mTag; 33 char *mTag;
diff --git a/liblog/uio.c b/liblog/uio.c
new file mode 100644
index 000000000..cfa4cb122
--- /dev/null
+++ b/liblog/uio.c
@@ -0,0 +1,76 @@
1/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef HAVE_SYS_UIO_H
18
19#include <log/uio.h>
20#include <unistd.h>
21
22int readv( int fd, struct iovec* vecs, int count )
23{
24 int total = 0;
25
26 for ( ; count > 0; count--, vecs++ ) {
27 const char* buf = vecs->iov_base;
28 int len = vecs->iov_len;
29
30 while (len > 0) {
31 int ret = read( fd, buf, len );
32 if (ret < 0) {
33 if (total == 0)
34 total = -1;
35 goto Exit;
36 }
37 if (ret == 0)
38 goto Exit;
39
40 total += ret;
41 buf += ret;
42 len -= ret;
43 }
44 }
45Exit:
46 return total;
47}
48
49int writev( int fd, const struct iovec* vecs, int count )
50{
51 int total = 0;
52
53 for ( ; count > 0; count--, vecs++ ) {
54 const char* buf = (const char*)vecs->iov_base;
55 int len = (int)vecs->iov_len;
56
57 while (len > 0) {
58 int ret = write( fd, buf, len );
59 if (ret < 0) {
60 if (total == 0)
61 total = -1;
62 goto Exit;
63 }
64 if (ret == 0)
65 goto Exit;
66
67 total += ret;
68 buf += ret;
69 len -= ret;
70 }
71 }
72Exit:
73 return total;
74}
75
76#endif /* !HAVE_SYS_UIO_H */