OpenBSD Handbook Manuals
Search

isduid(3)

Canonical URL: /isduid.3/

ISDUID(3) Library Functions Manual ISDUID(3)

isduiddisklabel UID test

/* -lutil */
#include <util.h>

int
isduid(char *duid, int dflags);

The () function tests the string duid to see if it is a valid disklabel(8) UID. The dflags are specified using the same flags as used by opendev(3).

If the OPENDEV_PART flag is included in dflags, the disklabel UID must consist of a 16-character hexadecimal string. Otherwise the disklabel UID must consist of a 16-character hexadecimal string followed by a ‘.’ and a partition letter.

The isduid() function returns non-zero if duid is a valid DUID, otherwise zero is returned.

opendev(3), disklabel(5), disklabel(8)

The isduid() function first appeared in OpenBSD 4.9.

OpenBSD 7.9 June 6, 2025 ISDUID(3)

Need conceptual guidance? Continue in the OpenBSD Handbook.