Searched refs:buf (Results 1 - 25 of 150) sorted by relevance

123456

/system/extras/tests/bionic/libc/common/
H A Dtest_strptime.c27 char buf[255]; local
33 strftime(buf, sizeof(buf), "%H:%M", &tm);
34 puts(buf);
35 puts(!strcmp(buf, "11:14") ? "OK" : "FAILED");
39 strftime(buf, sizeof(buf), "%H:%M:%S", &tm);
40 puts(buf);
41 puts(!strcmp(buf, "09:41:53") ? "OK" : "FAILED");
/system/core/libcutils/
H A Dpartition_utils.c25 static int only_one_char(char *buf, int len, char c) argument
31 if (buf[i] != c) {
41 char buf[4096]; local
48 ret = read(fd, buf, sizeof(buf));
51 if (ret != sizeof(buf)) {
56 if (only_one_char(buf, sizeof(buf), 0)) {
61 if (only_one_char(buf, sizeof(buf),
[all...]
H A Dklog.c54 char buf[LOG_BUF_MAX]; local
62 vsnprintf(buf, LOG_BUF_MAX, fmt, ap);
63 buf[LOG_BUF_MAX - 1] = 0;
65 write(klog_fd, buf, strlen(buf));
H A Dfs.c91 char buf[BUF_SIZE]; local
92 if (TEMP_FAILURE_RETRY(read(fd, buf, BUF_SIZE)) == -1) {
96 if (sscanf(buf, "%d", out_value) != 1) {
122 char buf[BUF_SIZE]; local
123 int len = snprintf(buf, BUF_SIZE, "%d", value) + 1;
128 if (TEMP_FAILURE_RETRY(write(fd, buf, len)) < len) {
157 char* buf = strdup(path); local
159 if (*buf != '/') {
160 ALOGE("Relative paths are not allowed: %s", buf);
171 char* segment = buf
[all...]
/system/core/libsuspend/
H A Dautosuspend_wakeup_count.c43 char buf[80]; local
54 strerror_r(errno, buf, sizeof(buf));
55 ALOGE("Error reading from %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
67 strerror_r(errno, buf, sizeof(buf));
68 ALOGE("Error waiting on semaphore: %s\n", buf);
75 strerror_r(errno, buf, sizeof(buf));
76 ALOGE("Error writing to %s: %s\n", SYS_POWER_WAKEUP_COUNT, buf);
98 char buf[80]; local
117 char buf[80]; local
142 char buf[80]; local
[all...]
H A Dautosuspend_autosleep.c38 char buf[80]; local
45 strerror_r(errno, buf, sizeof(buf));
46 ALOGE("Error writing to %s: %s\n", SYS_POWER_AUTOSLEEP, buf);
60 char buf[80]; local
67 strerror_r(errno, buf, sizeof(buf));
68 ALOGE("Error writing to %s: %s\n", SYS_POWER_AUTOSLEEP, buf);
88 char buf[80]; local
92 strerror_r(errno, buf, sizeo
[all...]
H A Dautosuspend_earlysuspend.c51 char buf; local
55 err = read(fd, &buf, 1);
66 char buf; local
70 err = read(fd, &buf, 1);
80 char buf[80]; local
107 char buf[80]; local
114 strerror_r(errno, buf, sizeof(buf));
115 ALOGE("Error writing to %s: %s\n", EARLYSUSPEND_SYS_POWER_STATE, buf);
137 char buf[8 local
172 char buf[80]; local
200 char buf[80]; local
[all...]
/system/core/libsparse/
H A Dsparse_crc32.h19 uint32_t sparse_crc32(uint32_t crc, const void *buf, size_t size);
/system/core/libutils/tests/
H A DBlobCache_test.cpp47 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
49 ASSERT_EQ(size_t(4), mBC->get("abcd", 4, buf, 4));
50 ASSERT_EQ('e', buf[0]);
51 ASSERT_EQ('f', buf[1]);
52 ASSERT_EQ('g', buf[2]);
53 ASSERT_EQ('h', buf[3]);
57 char buf[2] = { 0xee, 0xee }; local
60 ASSERT_EQ(size_t(2), mBC->get("ab", 2, buf, 2));
61 ASSERT_EQ('c', buf[0]);
62 ASSERT_EQ('d', buf[
69 char buf[6] = { 0xee, 0xee, 0xee, 0xee, 0xee, 0xee }; local
81 char buf[3] = { 0xee, 0xee, 0xee }; local
95 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
106 char buf[MAX_VALUE_SIZE+1] = { 0xee, 0xee, 0xee, 0xee }; local
118 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
131 char buf[MAX_VALUE_SIZE+1]; local
285 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
351 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
368 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
387 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
406 char buf[4] = { 0xee, 0xee, 0xee, 0xee }; local
[all...]
/system/extras/tests/bionic/libc/glibc/assert/
H A Dtest-assert.c15 char buf[160]; variable
75 fgets (buf, 160, stderr);
76 if (!strstr (buf, "1 == 2"))
79 fgets (buf, 160, stderr);
80 if (strstr (buf, "1 == 1"))
83 fgets (buf, 160, stderr);
84 if (strstr (buf, "2 == 3"))
/system/core/liblinenoise/
H A Dlinenoise.c187 static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_t pos, size_t cols) { argument
192 buf++;
205 if (write(fd,buf,len) == -1) return;
214 static int linenoisePrompt(int fd, char *buf, size_t buflen, const char *prompt) { argument
221 buf[0] = '\0';
250 memmove(buf+pos-1,buf+pos,len-pos);
253 buf[len] = '\0';
254 refreshLine(fd,prompt,buf,len,pos,cols);
259 int aux = buf[po
364 linenoiseRaw(char *buf, size_t buflen, const char *prompt) argument
388 char buf[LINENOISE_MAX_LINE]; local
[all...]
/system/core/liblog/
H A Duio.c27 const char* buf = vecs->iov_base; local
31 int ret = read( fd, buf, len );
41 buf += ret;
54 const char* buf = (const char*)vecs->iov_base; local
58 int ret = write( fd, buf, len );
68 buf += ret;
/system/core/libutils/
H A DString8.cpp62 SharedBuffer* buf = SharedBuffer::alloc(1); local
63 char* str = (char*)buf->data();
65 gEmptyStringBuf = buf;
81 SharedBuffer* buf = SharedBuffer::alloc(len+1); local
82 ALOG_ASSERT(buf, "Unable to allocate shared buffer");
83 if (buf) {
84 char* str = (char*)buf->data();
104 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); local
105 ALOG_ASSERT(buf, "Unable to allocate shared buffer");
106 if (!buf) {
126 SharedBuffer* buf = SharedBuffer::alloc(bytes+1); local
330 char* buf = lockBuffer(oldLength + n); local
344 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) local
359 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) local
377 SharedBuffer* buf = SharedBuffer::bufferFromData(mString) local
416 char* buf = lockBuffer(len); local
440 char* buf = lockBuffer(len); local
475 char* buf = lockBuffer(len); local
491 const char*const buf = mString; local
516 const char* buf = str; local
606 char* buf = lockBuffer(len+1+newlen); local
629 char * buf = lockBuffer(len); local
[all...]
H A DSharedBuffer.cpp61 SharedBuffer* buf = const_cast<SharedBuffer*>(this); local
62 if (buf->mSize == newSize) return buf;
63 buf = (SharedBuffer*)realloc(buf, sizeof(SharedBuffer) + newSize);
64 if (buf != NULL) {
65 buf->mSize = newSize;
66 return buf;
/system/extras/ext4_utils/
H A Dsetup_fs.c14 char buf[256], path[128]; local
32 snprintf(buf, sizeof(buf), "/sys/fs/ext4/%s", blockdev);
33 if (access(buf, F_OK) == 0) {
37 snprintf(buf, sizeof(buf), "/dev/block/%s", blockdev);
39 if (!partition_wiped(buf)) {
52 execl(mkfs, mkfs, buf, NULL);
/system/core/libzipfile/
H A Dcentraldir.c22 read_le_int(const unsigned char* buf) argument
24 return buf[0] | (buf[1] << 8) | (buf[2] << 16) | (buf[3] << 24);
28 read_le_short(const unsigned char* buf) argument
30 return buf[0] | (buf[1] << 8);
34 read_central_dir_values(Zipfile* file, const unsigned char* buf, int len) argument
43 file->disknum = read_le_short(&buf[
64 read_central_directory_entry(Zipfile* file, Zipentry* entry, const unsigned char** buf, ssize_t* len) argument
185 const unsigned char* buf = file->buf; local
[all...]
H A Dprivate.h23 const unsigned char *buf; member in struct:Zipfile
41 unsigned int read_le_int(const unsigned char* buf);
42 unsigned int read_le_short(const unsigned char* buf);
/system/extras/fatblock/
H A Dread.c28 static int buffer_read(char *buf, offset_t buf_len, char *out, argument
31 assert(buf);
47 memcpy(out, buf + off, len);
72 static int file_read(struct file *f, char *buf, offset_t off, offset_t len) argument
79 assert(buf);
114 ret = read(fd, buf, (size_t)len);
126 static int dir_read(struct dir *d, char *buf, offset_t off, offset_t len) argument
129 assert(buf);
131 return buffer_read((char*)d->entries, d->size, buf, off, len);
134 static int extent_read(struct fs *fs, struct extent *e, char *buf, argument
161 fs_read(struct fs *fs, char *buf, offset_t start, offset_t len) argument
[all...]
/system/core/libsysutils/src/
H A DSocketClient.cpp58 char *buf; local
63 ret = asprintf(&buf, "%d %d %s (%s)", code, getCmdNum(), msg, strerror(errno));
65 ret = asprintf(&buf, "%d %s (%s)", code, msg, strerror(errno));
69 ret = asprintf(&buf, "%d %d %s", code, getCmdNum(), msg);
71 ret = asprintf(&buf, "%d %s", code, msg);
76 ret = sendMsg(buf);
77 free(buf);
86 char buf[8]; local
88 snprintf(buf, 4, "%.3d", code);
91 memcpy(buf
105 char buf[4]; local
[all...]
/system/core/toolbox/
H A Dstart.c10 char buf[1024]; local
H A Dstop.c8 char buf[1024]; local
/system/core/libpixelflinger/codeflinger/tinyutils/
H A DSharedBuffer.cpp63 SharedBuffer* buf = const_cast<SharedBuffer*>(this); local
64 if (buf->mSize == newSize) return buf;
65 buf = (SharedBuffer*)realloc(buf, sizeof(SharedBuffer) + newSize);
66 if (buf != NULL) {
67 buf->mSize = newSize;
68 return buf;
/system/extras/libublock/include/ublock/
H A Dublock.h28 int (*read)(char *buf, uint64_t length, uint64_t offset);
29 int (*write)(const char *buf, uint64_t length, uint64_t offset);
/system/core/adb/
H A Dservices.c62 char buf[100]; local
66 snprintf(buf, sizeof(buf), "adbd is already running as root\n");
67 writex(fd, buf, strlen(buf));
72 snprintf(buf, sizeof(buf), "adbd cannot run as root in production builds\n");
73 writex(fd, buf, strlen(buf));
79 snprintf(buf, sizeo
87 char buf[100]; local
107 char buf[100]; local
117 char buf[100]; local
541 char buf[4096]; local
[all...]
H A Dlog_service.c31 void write_log_entry(int fd, struct logger_entry *buf);
45 unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1] __attribute__((aligned(4))); local
46 struct logger_entry *entry = (struct logger_entry *) buf;
87 void write_log_entry(int fd, struct logger_entry *buf) argument
89 size_t size = sizeof(struct logger_entry) + buf->len;
91 writex(fd, buf, size);

Completed in 277 milliseconds

123456