]> git.saurik.com Git - apple/libpthread.git/blob - man/pthread_threadid_np.3
libpthread-301.1.6.tar.gz
[apple/libpthread.git] / man / pthread_threadid_np.3
1 .\" Copyright (c) 2016 Apple Inc. All rights reserved.
2 .\"
3 .\" @APPLE_LICENSE_HEADER_START@
4 .\"
5 .\" This file contains Original Code and/or Modifications of Original Code
6 .\" as defined in and that are subject to the Apple Public Source License
7 .\" Version 2.0 (the 'License'). You may not use this file except in
8 .\" compliance with the License. Please obtain a copy of the License at
9 .\" http://www.opensource.apple.com/apsl/ and read it before using this
10 .\" file.
11 .\"
12 .\" The Original Code and all software distributed under the License are
13 .\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 .\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
17 .\" Please see the License for the specific language governing rights and
18 .\" limitations under the License.
19 .\"
20 .\" @APPLE_LICENSE_HEADER_END@
21 .\"
22 .Dd April 12, 2016
23 .Dt PTHREAD_THREADID_NP 3
24 .Os
25 .Sh NAME
26 .Nm pthread_threadid_np
27 .Nd get the calling thread's unique ID
28 .Sh SYNOPSIS
29 .In pthread.h
30 .Ft int
31 .Fn pthread_threadid_np "pthread_t thread" "uint64_t *thread_id"
32 .Sh DESCRIPTION
33 The
34 .Fn pthread_threadid_np
35 function stores the system-wide unique integral ID of
36 .Fa thread
37 in the location spedified by
38 .Fa thread_id .
39 If
40 .Fa thread
41 is NULL, the ID of the current thread is provided.
42 .Sh RETURN VALUES
43 If successful, the
44 .Fn pthread_threadid_np
45 function will return zero. Otherwise an error number will be returned to
46 indicate the error.
47 .Sh ERRORS
48 The
49 .Fn pthread_threadid_np
50 function will fail if:
51 .Bl -tag -width Er
52 .It Bq Er EINVAL
53 NULL value for
54 .Fa thread_id .
55 .It Bq Er ESRCH
56 Non-existent thread
57 .Fa thread .
58 .El
59 .Sh SEE ALSO
60 .Xr pthread_self 3