// SPDX-License-Identifier: Apache-2.0 AND MIT
// SPDX-FileCopyrightText: Copyright (c) 2017 Phil Ruffwind
// SPDX-FileCopyrightText: 2025 Yureka Lilian <yureka@cyberchaos.dev>
use io;
use AsRawFd;
/// Sets the nonblocking mode of the underlying file descriptor to either on
/// (`true`) or off (`false`). If `File::new_nb` was previously used to
/// construct the `File`, then nonblocking mode has already been turned on.
///
/// This function is not atomic. It should only called if you have exclusive
/// control of the underlying file descriptor.
///
/// Implementation detail: uses `fcntl` to query the flags and set
/// `O_NONBLOCK`.