Lines Matching refs:buf

107 static char *ps_files_path_create(char *buf, size_t buflen, ps_files *data, const zend_string *key)  in ps_files_path_create()  argument
119 memcpy(buf, ZSTR_VAL(data->basedir), ZSTR_LEN(data->basedir)); in ps_files_path_create()
121 buf[n++] = PHP_DIR_SEPARATOR; in ps_files_path_create()
123 buf[n++] = *p++; in ps_files_path_create()
124 buf[n++] = PHP_DIR_SEPARATOR; in ps_files_path_create()
126 memcpy(buf + n, FILE_PREFIX, sizeof(FILE_PREFIX) - 1); in ps_files_path_create()
128 memcpy(buf + n, ZSTR_VAL(key), ZSTR_LEN(key)); in ps_files_path_create()
130 buf[n] = '\0'; in ps_files_path_create()
132 return buf; in ps_files_path_create()
154 char buf[MAXPATHLEN]; in ps_files_open() local
173 if (!ps_files_path_create(buf, sizeof(buf), data, key)) { in ps_files_open()
182 data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY | O_NOFOLLOW, data->filemode); in ps_files_open()
186 …if(PG(open_basedir) && lstat(buf, &sbuf) == 0 && S_ISLNK(sbuf.st_mode) && php_check_open_basedir(b… in ps_files_open()
189 data->fd = VCWD_OPEN_MODE(buf, O_CREAT | O_RDWR | O_BINARY, data->filemode); in ps_files_open()
222 …php_error_docref(NULL, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf, strerror(errno), errno); in ps_files_open()
251 char *buf = ZSTR_VAL(val); in ps_files_write() local
255 wrote = _write(data->fd, buf, to_write); in ps_files_write()
258 buf = wrote > -1 ? buf + wrote : 0; in ps_files_write()
285 char buf[MAXPATHLEN]; in ps_files_cleanup_dir() local
304 memcpy(buf, ZSTR_VAL(dirname), ZSTR_LEN(dirname)); in ps_files_cleanup_dir()
305 buf[ZSTR_LEN(dirname)] = PHP_DIR_SEPARATOR; in ps_files_cleanup_dir()
315 memcpy(buf + ZSTR_LEN(dirname) + 1, entry->d_name, entry_len); in ps_files_cleanup_dir()
318 buf[ZSTR_LEN(dirname) + entry_len + 1] = '\0'; in ps_files_cleanup_dir()
321 if (VCWD_STAT(buf, &sbuf) == 0 && in ps_files_cleanup_dir()
323 VCWD_UNLINK(buf); in ps_files_cleanup_dir()
337 char buf[MAXPATHLEN]; in ps_files_key_exists() local
340 if (!key || !ps_files_path_create(buf, sizeof(buf), data, key)) { in ps_files_key_exists()
343 if (VCWD_STAT(buf, &sbuf)) { in ps_files_key_exists()
498 char *buf = ZSTR_VAL(*val); in PS_READ_FUNC() local
502 read_in = _read(data->fd, buf, to_read); in PS_READ_FUNC()
505 buf = read_in > -1 ? buf + read_in : 0; in PS_READ_FUNC()
564 char buf[MAXPATHLEN]; in PS_UPDATE_TIMESTAMP_FUNC() local
568 if (!ps_files_path_create(buf, sizeof(buf), data, key)) { in PS_UPDATE_TIMESTAMP_FUNC()
573 ret = VCWD_UTIME(buf, NULL); in PS_UPDATE_TIMESTAMP_FUNC()
595 char buf[MAXPATHLEN]; in PS_DESTROY_FUNC() local
598 if (!ps_files_path_create(buf, sizeof(buf), data, key)) { in PS_DESTROY_FUNC()
605 if (VCWD_UNLINK(buf) == -1) { in PS_DESTROY_FUNC()
608 if (!VCWD_ACCESS(buf, F_OK)) { in PS_DESTROY_FUNC()