hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * Copyright (C) 2014 Philippe Gerum <rpm@xenomai.org>.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
 */
#pragma GCC system_header
#include_next <pthread.h>
 
#ifndef _XENOMAI_TRANK_POSIX_PTHREAD_H
#define _XENOMAI_TRANK_POSIX_PTHREAD_H
 
#ifdef __cplusplus
extern "C" {
#endif
 
/**
 * Set the mode of the current thread (compatibility service)
 *
 * This service is a non-portable extension of the POSIX interface.
 *
 * @param clrmask set of bits to be cleared;
 *
 * @param setmask set of bits to be set.
 *
 * @param mode_r If non-NULL, @a mode_r must be a pointer to a memory
 * location which will be written upon success with the previous set
 * of active mode bits. If NULL, the previous set of active mode bits
 * will not be returned.
 *
 * @return 0 on success;
 * @return an error number if:
 * - EINVAL, some bit in @a clrmask or @a setmask is invalid.
 *
 * @note Setting @a clrmask and @a setmask to zero leads to a nop,
 * only returning the previous mode if @a mode_r is a valid address.
 *
 * @deprecated This service is an alias to pthread_setmode_np() for
 * source compatibility with Xenomai 2.x.
 */
static inline int pthread_set_mode_np(int clrmask, int setmask,
                     int *mask_r)
{
   return pthread_setmode_np(clrmask, setmask, mask_r);
}
 
/**
 * Set a thread name (compatibility service)
 *
 * This service set to @a name, the name of @a thread. This name is
 * used for displaying information in /proc/xenomai/sched.
 *
 * This service is a non-portable extension of the POSIX interface.
 *
 * @param thread target thread;
 *
 * @param name name of the thread.
 *
 * @return 0 on success;
 * @return an error number if:
 * - ESRCH, @a thread is invalid.
 *
 * @deprecated This service is an alias to pthread_setname_np() for
 * source compatibility with Xenomai 2.x.
 */
static inline int pthread_set_name_np(pthread_t thread,
                     const char *name)
{
   return pthread_setname_np(thread, name);
}
 
int pthread_make_periodic_np(pthread_t thread,
                struct timespec *starttp,
                struct timespec *periodtp);
 
int pthread_wait_np(unsigned long *overruns_r);
 
#ifdef __cplusplus
}
#endif
 
#endif /* _XENOMAI_TRANK_POSIX_PTHREAD_H */