Lines Matching refs:buffer

1178        os.fspath() as an fd or buffer. */
1258 after removing support of non-bytes buffer objects. */
1580 NULL, 0, /* in buffer */
3104 char *buffer = (char *)PyMem_RawMalloc(size);
3105 if (buffer == NULL) {
3108 int ret = ttyname_r(fd, buffer, size);
3110 PyMem_RawFree(buffer);
3114 PyObject *res = PyUnicode_DecodeFSDefault(buffer);
3115 PyMem_RawFree(buffer);
3132 char buffer[L_ctermid];
3135 ret = ctermid_r(buffer);
3137 ret = ctermid(buffer);
3141 return PyUnicode_DecodeFSDefault(buffer);
3797 /* If the buffer is large enough, len does not include the
3798 terminating \0. If the buffer is too small, len includes
4501 wchar_t *buffer;
4506 buffer = (wchar_t*)PyMem_Malloc(sizeof(wchar_t) * (wcslen(path->wide) + 1));
4507 if (!buffer) {
4510 wcscpy(buffer, path->wide);
4511 for (wchar_t *p = wcschr(buffer, L'/'); p; p = wcschr(p, L'/')) {
4516 ret = PathCchSkipRoot(buffer, &end);
4520 } else if (end != buffer) {
4521 size_t rootLen = (size_t)(end - buffer);
4529 PyMem_Free(buffer);
4556 wchar_t *buffer = PyUnicode_AsWideCharString(path, &len);
4557 if (!buffer) {
4561 wchar_t *norm_path = _Py_normpath_and_size(buffer, len, &norm_len);
4563 PyMem_Free(buffer);
8710 char buffer[MAXPATHLEN+1];
8720 length = readlinkat(dir_fd, path->narrow, buffer, MAXPATHLEN);
8726 length = readlink(path->narrow, buffer, MAXPATHLEN);
8739 buffer[length] = '\0';
8742 return PyUnicode_DecodeFSDefaultAndSize(buffer, length);
8744 return PyBytes_FromStringAndSize(buffer, length);
8768 0, 0, /* in buffer */
8801 /* Our buffer is mutable, so this is okay */
9613 PyObject *buffer;
9622 buffer = PyBytes_FromStringAndSize((char *)NULL, length);
9623 if (buffer == NULL)
9626 n = _Py_read(fd, PyBytes_AS_STRING(buffer), length);
9628 Py_DECREF(buffer);
9633 _PyBytes_Resize(&buffer, n);
9635 return buffer;
9707 readv will transfer data into each buffer until it is full
9708 and then move on to the next buffer in the sequence to hold
9776 PyObject *buffer;
9782 buffer = PyBytes_FromStringAndSize((char *)NULL, length);
9783 if (buffer == NULL)
9789 n = pread(fd, PyBytes_AS_STRING(buffer), length, offset);
9795 Py_DECREF(buffer);
9799 _PyBytes_Resize(&buffer, n);
9800 return buffer;
9817 transfer data into each buffer until it is full and then move on to the next
9818 buffer in the sequence to hold the rest of the data. Its fourth argument,
10412 buffer: Py_buffer
10418 Write buffer to fd, starting at offset bytes from the beginning of
10424 os_pwrite_impl(PyObject *module, int fd, Py_buffer *buffer, Py_off_t offset)
10433 size = pwrite(fd, buffer->buf, (size_t)buffer->len, offset);
10458 buffer is written before proceeding to second, and so on. The operating system may
11994 char buffer[255];
11998 len = confstr(name, buffer, sizeof(buffer));
12009 if (len >= sizeof(buffer)) {
12020 result = PyUnicode_DecodeFSDefaultAndSize(buffer, len-1);
12918 PyObject *buffer = NULL;
12936 buffer = PyBytes_FromStringAndSize(NULL, buffer_size);
12937 if (!buffer)
12939 ptr = PyBytes_AS_STRING(buffer);
12951 Py_DECREF(buffer);
12960 _PyBytes_Resize(&buffer, result);
12965 return buffer;
13095 char *buffer = NULL;
13117 buffer = PyMem_Malloc(buffer_size);
13118 if (!buffer) {
13125 length = flistxattr(path->fd, buffer, buffer_size);
13127 length = listxattr(name, buffer, buffer_size);
13129 length = llistxattr(name, buffer, buffer_size);
13134 PyMem_Free(buffer);
13135 buffer = NULL;
13147 end = buffer + length;
13148 for (trace = start = buffer; trace != end; trace++) {
13171 if (buffer)
13172 PyMem_Free(buffer);