Lines Matching +full:stdout +full:- +full:path

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
77 static int udom_open(const char *path, int flags);
86 /* Maximum buffer size in bytes - do not allow it to grow larger than this. */
98 * disable all flags except -l and -u to avoid non-portable function calls.
164 while ((ch = getopt(argc, argv, SUPPORTED_FLAGS)) != -1)
167 bflag = nflag = 1; /* -b implies -n */
170 eflag = vflag = 1; /* -e implies -v */
182 tflag = vflag = 1; /* -t implies -v */
185 setbuf(stdout, NULL);
194 argc -= optind;
202 err(EXIT_FAILURE, "stdout");
216 if (fclose(stdout))
217 err(1, "stdout");
226 fprintf(stderr, "usage: cat [-" SUPPORTED_FLAGS "] [file ...]\n");
235 char *path;
241 fd = -1;
242 while ((path = argv[i]) != NULL || i == 0) {
243 if (path == NULL || strcmp(path, "-") == 0) {
247 filename = path;
248 fd = fileargs_open(fa, path);
251 fd = udom_open(path, O_RDONLY);
255 warn("%s", path);
282 if (path == NULL)
312 (void)fprintf(stdout, "%6d\t", ++line);
313 if (ferror(stdout))
316 (void)fprintf(stdout, "%6s\t", "");
317 if (ferror(stdout))
341 memset(&fp->_mbstate, 0, sizeof(mbstate_t));
351 if (putchar('M') == EOF || putchar('-') == EOF)
364 ch = -1;
375 if (ferror(stdout))
376 err(1, "stdout");
385 wfd = fileno(stdout);
405 wfd = fileno(stdout);
408 err(1, "stdout");
425 for (off = 0; nr; nr -= nw, off += nw)
427 err(1, "stdout");
437 udom_open(const char *path, int flags)
450 if (fileargs_realpath(fa, path, rpath) == NULL)
451 return (-1);
457 return (-1);
465 for (res = res0; res != NULL; res = res->ai_next) {
466 fd = socket(res->ai_family, res->ai_socktype,
467 res->ai_protocol);
472 return (-1);
479 return (-1);
481 error = cap_connect(capnet, fd, res->ai_addr, res->ai_addrlen);
493 return (-1);
520 return (-1);