Searched defs:buffer (Results 1 - 25 of 69) sorted by relevance

123

/system/core/libsysutils/src/
H A DFrameworkClient.cpp34 char *buffer = (char *) alloca(bufflen); local
35 if (!buffer) {
39 snprintf(buffer, bufflen, "%s%s", msg, data);
40 return sendMsg(buffer);
/system/core/toolbox/
H A Ddmesg.c13 char buffer[KLOG_BUF_LEN + 1]; local
14 char *p = buffer;
24 n = klogctl(op, buffer, KLOG_BUF_LEN);
29 buffer[n] = '\0';
H A Dlog.c94 char buffer[4096]; local
130 buffer[0] = '\0';
133 strncat(buffer, argv[i], sizeof(buffer)-1);
134 strncat(buffer, " ", sizeof(buffer)-1);
137 if(buffer[0] == 0) {
141 __android_log_print(priority, tag, "%s", buffer);
H A Dinsmod.c18 void *buffer = NULL; local
31 buffer = malloc(size);
32 if (!buffer)
35 /* slurp it into our buffer */
36 ret = read(fd, buffer, size);
45 return buffer;
92 /* free the file buffer */
H A Duptime.c41 static void format_time(int time, char* buffer) { argument
52 sprintf(buffer, "%d days, %02d:%02d:%02d", days, hours, minutes, seconds);
54 sprintf(buffer, "%02d:%02d:%02d", hours, minutes, seconds);
/system/extras/tests/bionic/libc/common/
H A Dbench_stdio.c42 static char buffer[1024*1024]; variable
55 int totalSize = sizeof(buffer);
57 fread(buffer, 1, chunkSize, fp);
63 int totalSize = sizeof(buffer);
65 fwrite(buffer, 1, chunkSize, fp);
74 double bandwidth = sizeof(buffer)*1000./1024./time_ms; \
/system/netd/
H A Doem_iptables_hook.cpp33 char *buffer; local
42 asprintf(&buffer, "%s %s", IPTABLES_PATH, cmd);
43 res = system_nosh(buffer);
44 free(buffer);
H A DThrottleController.cpp44 char *buffer; local
54 asprintf(&buffer, "%s %s", TC_PATH, cmd);
55 res = system_nosh(buffer);
56 free(buffer);
H A DIdletimerController.cpp126 char *buffer; local
135 asprintf(&buffer, "%s %s", IPTABLES_PATH, cmd);
136 res = system_nosh(buffer);
137 ALOGV("%s #%d", buffer, res);
138 free(buffer);
149 char *buffer; local
150 asprintf(&buffer, "-t raw -F %s", LOCAL_RAW_PREROUTING);
151 res = runIpxtablesCmd(buffer);
152 free(buffer);
157 asprintf(&buffer, "
177 char *buffer; local
[all...]
/system/core/adb/
H A Dtest_track_devices.c57 char buffer[1024]; local
71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request );
72 if (unix_write(s, buffer, len) < 0)
76 if (unix_read(s, buffer, 4) != 4)
79 printf( "server answer: %.*s\n", 4, buffer );
91 if (unix_read(s, buffer, len) != len)
94 printf( "received header %.*s (%d bytes):\n%.*s", 4, head, len, len, buffer );
H A Dtest_track_jdwp.c57 char buffer[1024]; local
71 len = snprintf( buffer, sizeof buffer, "%04x%s", strlen(request), request );
72 if (unix_write(s, buffer, len) < 0)
76 if (unix_read(s, buffer, 4) != 4)
79 printf( "server answer: %.*s\n", 4, buffer );
91 if (unix_read(s, buffer, len) != len)
94 printf( "received header %.*s (%d bytes):\n%.*s", 4, head, len, len, buffer );
H A Dremount_service.c104 char buffer[200]; local
105 snprintf(buffer, sizeof(buffer), "remount failed: %s\n", strerror(errno));
106 write_string(fd, buffer);
/system/core/libcutils/
H A Ddebugger.c75 char buffer[4096]; local
77 while ((n = TEMP_FAILURE_RETRY(read(s, buffer, sizeof(buffer)))) > 0) {
78 if (TEMP_FAILURE_RETRY(write(fd, buffer, n)) != n) {
H A Dbuffer.c17 #define LOG_TAG "buffer"
24 #include "buffer.h"
28 Buffer* buffer = malloc(sizeof(Buffer)); local
29 if (buffer == NULL) {
32 buffer->capacity = capacity;
33 buffer->expected = 0;
34 buffer->data = malloc(capacity);
35 if (buffer->data == NULL) {
36 free(buffer);
39 return buffer;
42 bufferFree(Buffer* buffer) argument
48 Buffer* buffer = malloc(sizeof(Buffer)); local
60 bufferPrepareForRead(Buffer* buffer, size_t expected) argument
77 bufferRead(Buffer* buffer, int fd) argument
92 bufferPrepareForWrite(Buffer* buffer) argument
96 bufferWrite(Buffer* buffer, int fd) argument
[all...]
H A Duevent.c32 ssize_t uevent_kernel_multicast_recv(int socket, void *buffer, size_t length) argument
35 return uevent_kernel_multicast_uid_recv(socket, buffer, length, &user);
47 ssize_t uevent_kernel_multicast_uid_recv(int socket, void *buffer, argument
50 struct iovec iov = { buffer, length };
91 bzero(buffer, length);
H A Drecord_stream.c37 unsigned char *buffer; member in struct:RecordStream
55 ret->buffer = (unsigned char *)malloc (maxRecordLen + HEADER_SIZE);
57 ret->unconsumed = ret->buffer;
58 ret->read_end = ret->buffer;
59 ret->buffer_end = ret->buffer + maxRecordLen + HEADER_SIZE;
67 free(rs->buffer);
72 /* returns NULL; if there isn't a full record in the buffer */
102 /* one full line in the buffer */
134 /* is there one record already in the buffer? */
142 // if the buffer i
[all...]
/system/core/libdiskconfig/
H A Ddiskutils.c37 uint8_t buffer[2048]; local
62 if ((nr_bytes = read(src_fd, buffer, sizeof(buffer))) < 0) {
83 if ((tmp = write(dst_fd, buffer, nr_bytes)) < 0) {
/system/extras/ext4_utils/
H A Dsha1.h33 u_char buffer[64]; member in struct:__anon498
/system/vold/tests/
H A DVolumeManager_test.cpp38 char buffer[MD5_ASCII_LENGTH_PLUS_NULL]; local
39 char* dst = reinterpret_cast<char*>(&buffer);
44 EXPECT_TRUE(VolumeManager::asecHash(exp1, (char*)NULL, sizeof(buffer)) == NULL && errno == ESPIPE)
45 << "Should return NULL and set errno to ESPIPE when destination buffer is NULL";
47 << "Should return NULL and set errno to ESPIPE when destination buffer length is 0";
48 EXPECT_TRUE(VolumeManager::asecHash((const char*)NULL, dst, sizeof(buffer)) == NULL && errno == ESPIPE)
49 << "Should return NULL and set errno to ESPIPE when source buffer is NULL";
51 EXPECT_FALSE(VolumeManager::asecHash(src1, dst, sizeof(buffer)) == NULL)
58 EXPECT_FALSE(VolumeManager::asecHash(src2, dst, sizeof(buffer)) == NULL)
/system/bluetooth/brfpatch/
H A Dbrfpatch.c77 static void process_line(FILE *file_out, char *buf, char *buffer) { argument
78 FAILIF(strncmp(buf, "Send_", 5) != 0, "Not expecting: %s\n", buffer);
83 FAILIF(advance(&buf), "Could not find opcode in: %s\n", buffer); local
85 "Could not find opcode in: %s\n", buffer);
97 "Too much data: %s\n", buffer);
99 "Error parsing (%d): %s\n", __LINE__, buffer);
108 FAILIF(*buf != 'x', "Error parsing: %s\n", buffer);
120 "Error parsing (%d): %s\n", __LINE__, buffer);
126 "Error parsing (%d): %s\n", __LINE__, buffer);
132 "Error parsing (%d): %s\n", __LINE__, buffer);
177 char buffer[1024]; local
[all...]
/system/core/include/usbhost/
H A Dusbhost.h45 void* buffer; member in struct:usb_request
185 void* buffer,
194 void* buffer,
/system/vold/
H A Dvdc.c85 char *buffer = malloc(4096); local
103 free(buffer);
110 memset(buffer, 0, 4096);
111 if ((rc = read(sock, buffer, 4096)) <= 0) {
116 free(buffer);
126 if (buffer[i] == '\0') {
130 strncpy(tmp, buffer + offset, 3);
134 printf("%s\n", buffer + offset);
144 free(buffer);
/system/core/logwrapper/
H A Dlogwrapper.c50 char buffer[4096]; local
59 while ((sz = read(parent_read, &buffer[b], sizeof(buffer) - 1 - b)) > 0) {
64 if (buffer[b] == '\r') {
65 buffer[b] = '\0';
66 } else if (buffer[b] == '\n') {
67 buffer[b] = '\0';
68 ALOG(LOG_INFO, btag, "%s", &buffer[a]);
73 if (a == 0 && b == sizeof(buffer) - 1) {
74 // buffer i
[all...]
/system/core/toolbox/grep/
H A Dfile.c70 static unsigned char buffer[MAXBUFSIZ]; variable
83 bufpos = buffer;
88 nr = gzread(gzbufdesc, buffer, MAXBUFSIZ);
90 nr = BZ2_bzRead(&bzerr, bzbufdesc, buffer, MAXBUFSIZ);
109 nr = read(f->fd, buffer, MAXBUFSIZ);
117 nr = read(f->fd, buffer, MAXBUFSIZ);
147 /* Fill the buffer, if necessary */
157 /* Look for a newline in the remaining part of the buffer */
168 /* We have to copy the current buffered data to the line buffer */
215 /* Fill read buffer, als
[all...]
/system/extras/tests/sdcard/
H A Dtestcase.cpp98 char buffer[32000] = {0,}; local
99 char *str = buffer;
100 size_t size_left = sizeof(buffer);
110 write(mIpc[TestCase::WRITE_TO_PARENT], buffer, str - buffer);
131 char buffer[32000] = {0,}; local
132 while(read(mIpc[READ_FROM_CHILD], buffer, sizeof(buffer)) != 0)
134 printf("%s", buffer);
136 memset(buffer,
[all...]

Completed in 1814 milliseconds

123