Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
nbdkit_stdio_safe(3)		     NBDKIT		    nbdkit_stdio_safe(3)

NAME
     nbdkit_stdio_safe - is it safe to interact with stdin and stdout

SYNOPSIS
      #include <nbdkit-plugin.h>

      int nbdkit_stdio_safe (void);

DESCRIPTION
     The "nbdkit_stdio_safe" utility function returns whether or not it is safe
     to interact with stdin and stdout during the configuration phase.

     This is needed because when the nbdkit -s option is used the plugin must
     not directly interact with stdin, because that would interfere with network
     communication.

     The result of this function only matters in callbacks up to ".config_com-
     plete".  Once nbdkit reaches ".get_ready", the plugin should assume that
     nbdkit may have closed the original stdin and stdout in order to become a
     daemon.

     nbdkit-sh-plugin(3) uses this function to determine whether it is safe to
     support "script=-" to read a script from stdin.  Also constructs like
     "password=-" (see nbdkit_read_password(3)) are disabled when reading from
     stdio is not safe.

RETURN VALUE
     The function returns 1 (safe) or 0 (not safe).

     It cannot return an error.

LANGUAGE BINDINGS
     In nbdkit-ocaml-plugin(3):

      NBDKit.stdio_safe : unit -> bool

     In nbdkit-python-plugin(3):

      import nbdkit
      is_safe = nbdkit.stdio_safe()

     In nbdkit-rust-plugin(3):

      use nbdkit::*;
      pub fn is_stdio_safe() -> bool

HISTORY
     "nbdkit_stdio_safe" was added in nbdkit 1.20.

SEE ALSO
     nbdkit(1), nbdkit_read_password(3), nbdkit-plugin(3), nbdkit-filter(3).

AUTHORS
     Eric Blake

COPYRIGHT
     Copyright Red Hat

LICENSE
     Redistribution and use in source and binary forms, with or without modifi-
     cation, are permitted provided that the following conditions are met:

     *	 Redistributions of source code must retain the above copyright notice,
	 this list of conditions and the following disclaimer.

     *	 Redistributions in binary form must reproduce the above copyright no-
	 tice, this list of conditions and the following disclaimer in the docu-
	 mentation and/or other materials provided with the distribution.

     *	 Neither the name of Red Hat nor the names of its contributors may be
	 used to endorse or promote products derived from this software without
	 specific prior written permission.

     THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EX-
     PRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS-
     CLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DI-
     RECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SER-
     VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
     CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABIL-
     ITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
     THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAM-
     AGE.

nbdkit-1.46.2			   2026-08-30		    nbdkit_stdio_safe(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=nbdkit_stdio_safe&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help