Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 231) sorted by relevance

12345678910

/php-src/ext/pcre/pcre2lib/sljit/allocator_src/
H A DsljitProtExecAllocatorPosix.c55 int fd; in create_tempfile() local
69 return fd; in create_tempfile()
103 if (fd != -1) in create_tempfile()
104 return fd; in create_tempfile()
124 close(fd); in create_tempfile()
128 return fd; in create_tempfile()
134 int fd; in alloc_chunk() local
141 close(fd); in alloc_chunk()
148 close(fd); in alloc_chunk()
156 close(fd); in alloc_chunk()
[all …]
/php-src/ext/standard/tests/file/
H A Dphp_fd_wrapper_03.phpt2 php://fd wrapper: bad syntax
5 fopen("php://fd", "w");
6 fopen("php://fd/", "w");
7 fopen("php://fd/-2", "w");
8 fopen("php://fd/1/", "w");
15 Warning: fopen(php://fd): Failed to open stream: operation failed in %s on line 2
17 Warning: fopen(php://fd/): Failed to open stream: php://fd/ stream must be specified in the form ph…
19 Warning: fopen(php://fd/-2): Failed to open stream: The file descriptors must be non-negative numbe…
21 Warning: fopen(php://fd/1/): Failed to open stream: php://fd/ stream must be specified in the form …
H A Duserstreams_003.phpt31 function test($name, $fd, $return_value, $func, $args, $expected_option, $expected_value) {
33 $data = stream_get_meta_data($fd);
43 $fd = fopen("test://foo","r");
46 test("stream_set_blocking - 1", $fd, true, "stream_set_blocking", array($fd,0), STREAM_OPTION_BLOCK…
47 test("stream_set_blocking - 2", $fd, false, "stream_set_blocking", array($fd,1), STREAM_OPTION_BLOC…
48 test("stream_set_blocking - 3", $fd, "foo", "stream_set_blocking", array($fd,0), STREAM_OPTION_BLOC…
51 test("stream_set_write_buffer - 1", $fd, true, "stream_set_write_buffer", array($fd,0), STREAM_OPTI…
52 test("stream_set_write_buffer - 2", $fd, true, "stream_set_write_buffer", array($fd,4096), STREAM_O…
53 test("stream_set_write_buffer - 3", $fd, false, "stream_set_write_buffer", array($fd,8192), STREAM_…
55 test("stream_set_timeout - 1", $fd, true, "stream_set_timeout", array($fd,10,11), STREAM_OPTION_REA…
[all …]
H A Dbug44607.phpt11 $fd = fopen($tempnam, 'r');
12 var_dump(strlen(stream_get_line($fd, 15000, $eol)));
13 var_dump(strlen(stream_get_line($fd, 15000, $eol)));
14 fseek($fd, 1, SEEK_SET);
15 var_dump(strlen(stream_get_line($fd, 15000, $eol)));
16 var_dump(strlen(stream_get_line($fd, 15000, $eol)));
17 fclose($fd);
/php-src/ext/standard/tests/streams/
H A Dbug64166_3.phpt7 $fd = fopen('php://temp', 'w+');
8 $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array(
12 fwrite($fd, $data);
13 rewind($fd);
15 var_dump(stream_get_contents($fd, -1, 0));
19 rewind($fd);
20 stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_WRITE, array(
24 fwrite($fd, $data);
25 rewind($fd);
26 var_dump(stream_get_contents($fd, -1, 0));
[all …]
H A Dbug64166.phpt7 $fd = fopen('php://temp', 'w+');
8 fwrite($fd, $data);
9 rewind($fd);
11 $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array(
15 var_dump(stream_get_contents($fd, -1, 0));
19 rewind($fd);
20 stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array(
24 var_dump(stream_get_contents($fd, -1, 0));
26 fclose($fd);
H A Dbug64166_2.phpt7 $fd = fopen('php://temp', 'w+');
8 fwrite($fd, $data);
9 rewind($fd);
11 $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array(
16 while(($c = fread($fd, 1))!= "") $str .= $c;
21 rewind($fd);
22 stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ, array(
27 while(($c = fread($fd, 1))!= "") $str .= $c;
30 fclose($fd);
H A Dbug65483.phpt8 $fd = fopen('php://temp', 'w+');
9 fwrite($fd, $data);
10 rewind($fd);
12 $res = stream_filter_append($fd, 'convert.quoted-printable-encode', STREAM_FILTER_READ);
13 var_dump(stream_get_contents($fd, -1, 0));
15 fclose($fd);
H A Dbug63240.phpt5 $fd = fopen('php://temp', 'r+');
8 fwrite($fd, $str);
9 rewind($fd);
10 $line = stream_get_line($fd, 9000, $delimiter);
12 $line = stream_get_line($fd, 9000, $delimiter);
/php-src/sapi/phpdbg/
H A Dphpdbg_out.h39 PHPDBG_API int phpdbg_print(int severity, int fd, const char *strfmt, ...) PHP_ATTRIBUTE_FORMAT(pri…
40 PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
41 PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
43 …fmt, ...) phpdbg_print(P_ERROR , PHPDBG_G(io)[PHPDBG_STDOUT].fd, strfmt, ##__VA_ARGS…
44 …rfmt, ...) phpdbg_print(P_NOTICE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, strfmt, ##__VA_ARGS…
45 …trfmt, ...) phpdbg_print(P_WRITELN, PHPDBG_G(io)[PHPDBG_STDOUT].fd, strfmt, ##__VA_ARGS…
46 …fmt, ...) phpdbg_print(P_WRITE , PHPDBG_G(io)[PHPDBG_STDOUT].fd, strfmt, ##__VA_ARGS…
48 #define phpdbg_log(fmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, …
49 #define phpdbg_out(fmt, ...) phpdbg_out_internal(PHPDBG_G(io)[PHPDBG_STDOUT].fd, …
57 # define phpdbg_debug(strfmt, ...) phpdbg_log_internal(PHPDBG_G(io)[PHPDBG_STDERR].fd, strfmt, ##__…
[all …]
H A Dphpdbg_io.c73 PHPDBG_API int phpdbg_mixed_read(int fd, char *ptr, int len, int tmo) { in phpdbg_mixed_read() argument
77 ret = read(fd, ptr, len); in phpdbg_mixed_read()
83 static int phpdbg_output_pager(int fd, const char *ptr, int len) { in phpdbg_output_pager() argument
92 bytes += write(fd, ptr + bytes, (p - ptr) - bytes); in phpdbg_output_pager()
101 zend_quiet_write(fd, "\r", 1); in phpdbg_output_pager()
106 bytes += write(fd, ptr + bytes, len - bytes); in phpdbg_output_pager()
108 bytes += write(fd, ptr, len); in phpdbg_output_pager()
113 PHPDBG_API int phpdbg_mixed_write(int fd, const char *ptr, int len) { in phpdbg_mixed_write() argument
115 && PHPDBG_G(io)[PHPDBG_STDOUT].fd == fd in phpdbg_mixed_write()
117 return phpdbg_output_pager(fd, ptr, len); in phpdbg_mixed_write()
[all …]
H A Dphpdbg_out.c50 phpdbg_mixed_write(fd, ZEND_STRL("\n")); in phpdbg_process_print()
62 phpdbg_mixed_write(fd, ZEND_STRL("\n")); in phpdbg_process_print()
97 phpdbg_mixed_write(fd, msg, msglen); in phpdbg_process_print()
116 phpdbg_mixed_write(fd, msgout, msgoutlen); in phpdbg_process_print()
139 PHPDBG_G(err_buf).fd = fd; in phpdbg_vprint()
149 len = phpdbg_process_print(fd, type, msg, msglen); in phpdbg_vprint()
203 len = phpdbg_vprint(type, fd, strfmt, args); in phpdbg_print()
209 PHPDBG_API int phpdbg_log_internal(int fd, const char *fmt, ...) { in phpdbg_log_internal() argument
219 len = phpdbg_mixed_write(fd, buffer, buflen); in phpdbg_log_internal()
225 PHPDBG_API int phpdbg_out_internal(int fd, const char *fmt, ...) { in phpdbg_out_internal() argument
[all …]
/php-src/sapi/fpm/fpm/events/
H A Dpoll.c85 pollfds[i].fd = -1; in fpm_event_poll_init()
154 … && q->ev->index >= 0 && q->ev->index < npollfds && q->ev->fd == active_pollfds[q->ev->index].fd) { in fpm_event_poll_wait()
184 if (pollfds[next_free_slot].fd == -1) { in fpm_event_poll_add()
186 pollfds[next_free_slot].fd = ev->fd; in fpm_event_poll_add()
199 if (pollfds[i].fd != -1) { in fpm_event_poll_add()
205 pollfds[i].fd = ev->fd; in fpm_event_poll_add()
216 zlog(ZLOG_ERROR, "poll: not enough space to add event (fd=%d)", ev->fd); in fpm_event_poll_add()
229 if (ev->index >= 0 && ev->index < npollfds && pollfds[ev->index].fd == ev->fd) { in fpm_event_poll_remove()
234 pollfds[ev->index].fd = -1; in fpm_event_poll_remove()
246 if (pollfds[i].fd != ev->fd) { in fpm_event_poll_remove()
[all …]
H A Dselect.c115 if (FD_ISSET(q->ev->fd, &current_fds)) { in fpm_event_select_wait()
140 if (ev->fd >= FD_SETSIZE) { in fpm_event_select_add()
146 if (!FD_ISSET(ev->fd, &fds)) { in fpm_event_select_add()
147 FD_SET(ev->fd, &fds); in fpm_event_select_add()
148 ev->index = ev->fd; in fpm_event_select_add()
161 if (FD_ISSET(ev->fd, &fds)) { in fpm_event_select_remove()
162 FD_CLR(ev->fd, &fds); in fpm_event_select_remove()
H A Depoll.c166 e.data.fd = ev->fd; in fpm_event_epoll_add()
174 if (epoll_ctl(epollfd, EPOLL_CTL_ADD, ev->fd, &e) == -1) { in fpm_event_epoll_add()
175 zlog(ZLOG_ERROR, "epoll: unable to add fd %d", ev->fd); in fpm_event_epoll_add()
180 ev->index = ev->fd; in fpm_event_epoll_add()
194 e.data.fd = ev->fd; in fpm_event_epoll_remove()
202 if (epoll_ctl(epollfd, EPOLL_CTL_DEL, ev->fd, &e) == -1) { in fpm_event_epoll_remove()
203 zlog(ZLOG_ERROR, "epoll: unable to remove fd %d", ev->fd); in fpm_event_epoll_remove()
/php-src/ext/gd/libgd/
H A Dgd_gif_in.c117 gdIOCtx *fd = gdNewFileCtx(fdFile); in gdImageCreateFromGif() local
120 im = gdImageCreateFromGifCtx(fd); in gdImageCreateFromGif()
122 fd->gd_free(fd); in gdImageCreateFromGif()
155 if (! ReadOK(fd,buf,6)) { in gdImageCreateFromGifCtx()
170 if (! ReadOK(fd,buf,7)) { in gdImageCreateFromGifCtx()
194 if (! ReadOK(fd,&c,1)) { in gdImageCreateFromGifCtx()
202 if (! ReadOK(fd,&c,1)) { in gdImageCreateFromGifCtx()
215 if (! ReadOK(fd,buf,9)) { in gdImageCreateFromGifCtx()
250 ReadImage(im, fd, width, height, in gdImageCreateFromGifCtx()
337 if (! ReadOK(fd,&count,1)) { in GetDataBlock_()
[all …]
/php-src/ext/bz2/tests/
H A D004.phpt9 var_dump(bzerror($fd));
10 var_dump(bzerrstr($fd));
11 var_dump(bzerrno($fd));
18 var_dump(bzread($fd, 10));
19 var_dump(bzerror($fd));
20 var_dump(bzerrstr($fd));
21 var_dump(bzerrno($fd));
28 var_dump(bzread($fd));
29 var_dump(bzerror($fd));
30 var_dump(bzerrstr($fd));
[all …]
H A D003-mb.phpt8 $fd = bzopen(__DIR__."/003私はガラスを食べられます.txt.bz2","r");
9 var_dump(bzread($fd, 0));
12 var_dump(bzread($fd, -10));
17 var_dump(bzread($fd, 1));
18 var_dump(bzread($fd, 2));
19 var_dump(bzread($fd, 100000));
H A D003.phpt8 $fd = bzopen(__DIR__."/003.txt.bz2","r");
9 var_dump(bzread($fd, 0));
12 var_dump(bzread($fd, -10));
17 var_dump(bzread($fd, 1));
18 var_dump(bzread($fd, 2));
19 var_dump(bzread($fd, 100000));
/php-src/main/
H A Dphp_network.h133 php_socket_t fd; member
173 static inline int php_pollfd_for(php_socket_t fd, int events, struct timeval *timeouttv) in php_pollfd_for() argument
178 p.fd = fd; in php_pollfd_for()
191 static inline int php_pollfd_for_ms(php_socket_t fd, int events, int timeout) in php_pollfd_for_ms() argument
196 p.fd = fd; in php_pollfd_for_ms()
234 # define PHP_SAFE_FD_SET(fd, set) FD_SET(fd, set) argument
235 # define PHP_SAFE_FD_CLR(fd, set) FD_CLR(fd, set) argument
236 # define PHP_SAFE_FD_ISSET(fd, set) FD_ISSET(fd, set) argument
239 # define PHP_SAFE_FD_SET(fd, set) do { if (fd < FD_SETSIZE) FD_SET(fd, set); } while(0) argument
240 # define PHP_SAFE_FD_CLR(fd, set) do { if (fd < FD_SETSIZE) FD_CLR(fd, set); } while(0) argument
[all …]
H A Dphp_open_temporary_file.c108 int fd = -1; in php_do_open_temporary_file() local
209 fd = mkstemp(opened_path); in php_do_open_temporary_file()
217 if (fd != -1 && opened_path_p) { in php_do_open_temporary_file()
222 if (fd != -1 && opened_path_p) { in php_do_open_temporary_file()
228 return fd; in php_do_open_temporary_file()
319 int fd; in php_open_temporary_fd_ex() local
348 if (fd == -1) { in php_open_temporary_fd_ex()
355 return fd; in php_open_temporary_fd_ex()
368 if (fd == -1) { in php_open_temporary_file()
372 fp = fdopen(fd, "r+b"); in php_open_temporary_file()
[all …]
/php-src/ext/session/
H A Dmod_files.c98 int fd; member
141 if (data->fd != -1) { in ps_files_close()
147 close(data->fd); in ps_files_close()
148 data->fd = -1; in ps_files_close()
192 if (data->fd != -1) { in ps_files_open()
203 close(data->fd); in ps_files_open()
204 data->fd = -1; in ps_files_open()
235 if (data->fd < 0) { in ps_files_write()
414 data->fd = -1; in PS_OPEN_FUNC()
474 if (data->fd < 0) { in PS_READ_FUNC()
[all …]
/php-src/ext/random/
H A Dcsprng.c151 int fd = zend_atomic_int_load_ex(&random_fd); in php_random_bytes_ex()
154 if (fd < 0) { in php_random_bytes_ex()
156 fd = open("/dev/urandom", O_RDONLY); in php_random_bytes_ex()
157 if (fd < 0) { in php_random_bytes_ex()
168 if (fstat(fd, &st) != 0 || in php_random_bytes_ex()
175 close(fd); in php_random_bytes_ex()
185 close(fd); in php_random_bytes_ex()
187 fd = expected; in php_random_bytes_ex()
270 int fd = zend_atomic_int_exchange(&random_fd, -1); in php_random_csprng_shutdown() local
271 if (fd != -1) { in php_random_csprng_shutdown()
[all …]
/php-src/ext/standard/tests/filters/
H A Dbug46164-2.phpt17 $fd = fopen('php://memory','w');
18 $filter = stream_filter_append($fd, 'user_filter');
19 fwrite($fd, "foo");
20 fflush($fd);
21 var_dump(fclose($fd));
/php-src/sapi/fpm/fpm/
H A Dfpm_stdio.c29 int fd = open("/dev/null", O_RDWR); in fpm_stdio_init_main() local
31 if (0 > fd) { in fpm_stdio_init_main()
36 if (0 > dup2(fd, STDIN_FILENO) || 0 > dup2(fd, STDOUT_FILENO)) { in fpm_stdio_init_main()
38 close(fd); in fpm_stdio_init_main()
41 close(fd); in fpm_stdio_init_main()
171 int fd = ev->fd; local
370 int fd; local
385 if (0 > fd) {
392 close(fd);
395 fpm_globals.error_log_fd = fd;
[all …]

Completed in 41 milliseconds

12345678910