1.Dd Nov 5, 2008
2.Dt GETHOSTUUID \&2 "Mac OS X System Calls Manual"
3.Os "Mac OS X"
4.Sh NAME
5.Nm gethostuuid
6.Nd return a unique identifier for the current machine
7.Sh SYNOPSIS
8.In unistd.h
9.Ft int
10.Fo gethostuuid
11.Fa "uuid_t id"
12.Fa "const struct timespec *wait"
13.Fc
14.Sh DESCRIPTION
15The
16.Fn gethostuuid
17function returns a 16-byte
18.Ft uuid_t
19specified by
20.Fa id ,
21that uniquely identifies the current machine.
22Be aware that the hardware identifiers that
23.Fn gethostuuid
24uses to generate the UUID can themselves be modified.
25.Pp
26The
27.Fa wait
28argument is a pointer to a
29.Ft "struct timespec"
30that specifies the maximum time to wait for the result.
31Setting the
32.Fa tv_sec
33and
34.Fa tv_nsec
35fields to zero means to wait indefinitely until it completes.
36.Sh RETURN VALUES
37The
38.Fn gethostuuid
39function returns zero on success or -1 on error.
40.Sh ERRORS
41The
42.Fn gethostuuid
43functions fails if:
44.Bl -tag -width Er
45.It Bq Er EFAULT
46.Fa wait
47points to memory that is not a valid part of the process
48address space.
49.It Bq Er EWOULDBLOCK
50The
51.Fa wait
52timeout expired before the UUID could be obtained.
53.El
54.Sh SEE ALSO
55.Xr uuid 3
56