Lines Matching +full:- +full:- +full:stdin
21 /// In `std`-using configurations, this is a safe function, because the
22 /// standard library already assumes that the stdin file descriptor is always
27 /// This function allows reading directly from stdin without coordinating
28 /// with the buffering performed by [`std::io::Stdin`], so it could cause
32 /// - [POSIX]
33 /// - [Linux]
34 /// - [FreeBSD]
35 /// - [NetBSD]
36 /// - [OpenBSD]
37 /// - [DragonFly BSD]
38 /// - [illumos]
39 /// - [glibc]
41 /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html
42 /// [Linux]: https://man7.org/linux/man-pages/man3/stdin.3.html
43 /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=stdin&sektion=4
44 /// [NetBSD]: https://man.netbsd.org/stdin.4
45 /// [OpenBSD]: https://man.openbsd.org/stdin.4
46 /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=stdin§ion=4
47 /// [illumos]: https://illumos.org/man/4FS/stdin
48 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdin
52 pub const fn stdin() -> BorrowedFd<'static> { in stdin() function
60 /// In `std`-using configurations, this is a safe function, because the
61 /// standard library already assumes that the stdin file descriptor is always
66 /// In `no_std` configurations, the stdin file descriptor can be closed,
73 /// This function allows reading directly from stdin without coordinating
74 /// with the buffering performed by [`std::io::Stdin`], so it could cause
78 /// - [POSIX]
79 /// - [Linux]
80 /// - [FreeBSD]
81 /// - [NetBSD]
82 /// - [OpenBSD]
83 /// - [DragonFly BSD]
84 /// - [illumos]
85 /// - [glibc]
87 /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html
88 /// [Linux]: https://man7.org/linux/man-pages/man3/stdin.3.html
89 /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=stdin&sektion=4
90 /// [NetBSD]: https://man.netbsd.org/stdin.4
91 /// [OpenBSD]: https://man.openbsd.org/stdin.4
92 /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=stdin§ion=4
93 /// [illumos]: https://illumos.org/man/4FS/stdin
94 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdin
98 pub const unsafe fn stdin() -> BorrowedFd<'static> { in stdin() function
104 /// This is similar to [`stdin`], however it returns an `OwnedFd` which closes
109 /// Safe `std`-using Rust code is permitted to assume that the stdin file
111 /// close the stdin file descriptor when dropped.
115 /// This has the same hazards as [`stdin`].
118 /// - [POSIX]
119 /// - [Linux]
120 /// - [FreeBSD]
121 /// - [NetBSD]
122 /// - [OpenBSD]
123 /// - [DragonFly BSD]
124 /// - [illumos]
125 /// - [glibc]
127 /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html
128 /// [Linux]: https://man7.org/linux/man-pages/man3/stdin.3.html
129 /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=stdin&sektion=4
130 /// [NetBSD]: https://man.netbsd.org/stdin.4
131 /// [OpenBSD]: https://man.openbsd.org/stdin.4
132 /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=stdin§ion=4
133 /// [illumos]: https://illumos.org/man/4FS/stdin
134 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdin
137 pub unsafe fn take_stdin() -> OwnedFd { in take_stdin()
143 /// In `std`-using configurations, this is a safe function, because the
154 /// - [POSIX]
155 /// - [Linux]
156 /// - [FreeBSD]
157 /// - [NetBSD]
158 /// - [OpenBSD]
159 /// - [DragonFly BSD]
160 /// - [illumos]
161 /// - [glibc]
164 /// [Linux]: https://man7.org/linux/man-pages/man3/stdout.3.html
170 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdout
174 pub const fn stdout() -> BorrowedFd<'static> { in stdout()
182 /// In `std`-using configurations, this is a safe function, because the
200 /// - [POSIX]
201 /// - [Linux]
202 /// - [FreeBSD]
203 /// - [NetBSD]
204 /// - [OpenBSD]
205 /// - [DragonFly BSD]
206 /// - [illumos]
207 /// - [glibc]
210 /// [Linux]: https://man7.org/linux/man-pages/man3/stdout.3.html
216 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdout
220 pub const unsafe fn stdout() -> BorrowedFd<'static> { in stdout()
231 /// Safe `std`-using Rust code is permitted to assume that the stdout file
240 /// - [POSIX]
241 /// - [Linux]
242 /// - [FreeBSD]
243 /// - [NetBSD]
244 /// - [OpenBSD]
245 /// - [DragonFly BSD]
246 /// - [illumos]
247 /// - [glibc]
250 /// [Linux]: https://man7.org/linux/man-pages/man3/stdout.3.html
256 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdout
259 pub unsafe fn take_stdout() -> OwnedFd { in take_stdout()
265 /// In `std`-using configurations, this is a safe function, because the
270 /// - [POSIX]
271 /// - [Linux]
272 /// - [FreeBSD]
273 /// - [NetBSD]
274 /// - [OpenBSD]
275 /// - [DragonFly BSD]
276 /// - [illumos]
277 /// - [glibc]
280 /// [Linux]: https://man7.org/linux/man-pages/man3/stderr.3.html
286 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stderr
290 pub const fn stderr() -> BorrowedFd<'static> { in stderr()
298 /// In `std`-using configurations, this is a safe function, because the
310 /// - [POSIX]
311 /// - [Linux]
312 /// - [FreeBSD]
313 /// - [NetBSD]
314 /// - [OpenBSD]
315 /// - [DragonFly BSD]
316 /// - [illumos]
317 /// - [glibc]
320 /// [Linux]: https://man7.org/linux/man-pages/man3/stderr.3.html
326 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stderr
330 pub const unsafe fn stderr() -> BorrowedFd<'static> { in stderr()
341 /// Safe std-using Rust code is permitted to assume that the stderr file
355 /// - [POSIX]
356 /// - [Linux]
357 /// - [FreeBSD]
358 /// - [NetBSD]
359 /// - [OpenBSD]
360 /// - [DragonFly BSD]
361 /// - [illumos]
362 /// - [glibc]
365 /// [Linux]: https://man7.org/linux/man-pages/man3/stderr.3.html
371 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stderr
374 pub unsafe fn take_stderr() -> OwnedFd { in take_stderr()
380 /// This is similar to [`stdin`], however it returns a `RawFd`.
384 /// This has the same hazards as [`stdin`].
387 /// - [POSIX]
388 /// - [Linux]
389 /// - [FreeBSD]
390 /// - [NetBSD]
391 /// - [OpenBSD]
392 /// - [DragonFly BSD]
393 /// - [illumos]
394 /// - [glibc]
396 /// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html
397 /// [Linux]: https://man7.org/linux/man-pages/man3/stdin.3.html
398 /// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=stdin&sektion=4
399 /// [NetBSD]: https://man.netbsd.org/stdin.4
400 /// [OpenBSD]: https://man.openbsd.org/stdin.4
401 /// [DragonFly BSD]: https://man.dragonflybsd.org/?command=stdin§ion=4
402 /// [illumos]: https://illumos.org/man/4FS/stdin
403 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdin
406 pub const fn raw_stdin() -> RawFd { in raw_stdin()
419 /// - [POSIX]
420 /// - [Linux]
421 /// - [FreeBSD]
422 /// - [NetBSD]
423 /// - [OpenBSD]
424 /// - [DragonFly BSD]
425 /// - [illumos]
426 /// - [glibc]
429 /// [Linux]: https://man7.org/linux/man-pages/man3/stdout.3.html
435 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stdout
438 pub const fn raw_stdout() -> RawFd { in raw_stdout()
451 /// - [POSIX]
452 /// - [Linux]
453 /// - [FreeBSD]
454 /// - [NetBSD]
455 /// - [OpenBSD]
456 /// - [DragonFly BSD]
457 /// - [illumos]
458 /// - [glibc]
461 /// [Linux]: https://man7.org/linux/man-pages/man3/stderr.3.html
467 /// [glibc]: https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html#index-stderr
470 pub const fn raw_stderr() -> RawFd { in raw_stderr()
474 /// Utility function to safely `dup2` over stdin (fd 0).
478 pub fn dup2_stdin<Fd: AsFd>(fd: Fd) -> io::Result<()> { in dup2_stdin()
491 pub fn dup2_stdout<Fd: AsFd>(fd: Fd) -> io::Result<()> { in dup2_stdout()
504 pub fn dup2_stderr<Fd: AsFd>(fd: Fd) -> io::Result<()> { in dup2_stderr()