Updated: 2022/Sep/29

Please read Privacy Policy. It's for your privacy.


GETFSSPECNAME(3)           Library Functions Manual           GETFSSPECNAME(3)

NAME
     getfsspecname - get the underlying wedge name from a label

LIBRARY
     System Utilities Library (libutil, -lutil)

SYNOPSIS
     #include <util.h>

     const char *
     getfsspecname(char *buf, size_t buflen, const char *spec);

DESCRIPTION
     The getfsspecname() function translates an fs_spec field in the spec
     argument of the form "NAME=wedgename" to the underlying dk(4) device
     node, and places the resulting pathname in buf up to len buflen.

     If the spec argument starts with "ROOT.", a path in the form
     "/dev/[root_device][suffix]" is copied to buf, where [root_device] is the
     value of the "kern.root_device" sysctl and [suffix] is the characters
     following "ROOT." in the spec argument.

     If the spec argument is not of the form "NAME=wedgename" and it doesn't
     start with "ROOT.", spec is copied to buf and returned.

RETURN VALUES
     On success the absolute pathname of the underlying wedge device is
     returned, or the original spec argument.  On failure NULL is returned and
     buf contains the reason for the error.

SEE ALSO
     fstab(5)

HISTORY
     The getfsspecname() function appeared in NetBSD 7.0.

NetBSD 10.99                   December 28, 2018                  NetBSD 10.99