thr_mutexattr.c (82725ba9bf1fd59746a4006a06f24d4d61d142f2) thr_mutexattr.c (b6413b6db8756c1ecae5e575e6516f811966046f)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1996 Jeffrey Hsu <hsu@freebsd.org>.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 136 unchanged lines hidden (view full) ---

145 } else {
146 (*attr)->m_type = type;
147 ret = 0;
148 }
149 return (ret);
150}
151
152int
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1996 Jeffrey Hsu <hsu@freebsd.org>.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 136 unchanged lines hidden (view full) ---

145 } else {
146 (*attr)->m_type = type;
147 ret = 0;
148 }
149 return (ret);
150}
151
152int
153_pthread_mutexattr_gettype(pthread_mutexattr_t *attr, int *type)
153_pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict attr,
154 int * __restrict type)
154{
155 int ret;
156
157 if (attr == NULL || *attr == NULL || (*attr)->m_type >=
158 PTHREAD_MUTEX_TYPE_MAX) {
159 ret = EINVAL;
160 } else {
161 *type = (*attr)->m_type;

--- 35 unchanged lines hidden (view full) ---

197 (pshared != PTHREAD_PROCESS_PRIVATE &&
198 pshared != PTHREAD_PROCESS_SHARED))
199 return (EINVAL);
200 (*attr)->m_pshared = pshared;
201 return (0);
202}
203
204int
155{
156 int ret;
157
158 if (attr == NULL || *attr == NULL || (*attr)->m_type >=
159 PTHREAD_MUTEX_TYPE_MAX) {
160 ret = EINVAL;
161 } else {
162 *type = (*attr)->m_type;

--- 35 unchanged lines hidden (view full) ---

198 (pshared != PTHREAD_PROCESS_PRIVATE &&
199 pshared != PTHREAD_PROCESS_SHARED))
200 return (EINVAL);
201 (*attr)->m_pshared = pshared;
202 return (0);
203}
204
205int
205_pthread_mutexattr_getprotocol(pthread_mutexattr_t *mattr, int *protocol)
206_pthread_mutexattr_getprotocol(const pthread_mutexattr_t * __restrict mattr,
207 int * __restrict protocol)
206{
207 int ret = 0;
208
209 if (mattr == NULL || *mattr == NULL)
210 ret = EINVAL;
211 else
212 *protocol = (*mattr)->m_protocol;
213

--- 11 unchanged lines hidden (view full) ---

225 else {
226 (*mattr)->m_protocol = protocol;
227 (*mattr)->m_ceiling = THR_MAX_RR_PRIORITY;
228 }
229 return (ret);
230}
231
232int
208{
209 int ret = 0;
210
211 if (mattr == NULL || *mattr == NULL)
212 ret = EINVAL;
213 else
214 *protocol = (*mattr)->m_protocol;
215

--- 11 unchanged lines hidden (view full) ---

227 else {
228 (*mattr)->m_protocol = protocol;
229 (*mattr)->m_ceiling = THR_MAX_RR_PRIORITY;
230 }
231 return (ret);
232}
233
234int
233_pthread_mutexattr_getprioceiling(pthread_mutexattr_t *mattr, int *prioceiling)
235_pthread_mutexattr_getprioceiling(const pthread_mutexattr_t * __restrict mattr,
236 int * __restrict prioceiling)
234{
235 int ret = 0;
236
237 if (mattr == NULL || *mattr == NULL)
238 ret = EINVAL;
239 else if ((*mattr)->m_protocol != PTHREAD_PRIO_PROTECT)
240 ret = EINVAL;
241 else

--- 51 unchanged lines hidden ---
237{
238 int ret = 0;
239
240 if (mattr == NULL || *mattr == NULL)
241 ret = EINVAL;
242 else if ((*mattr)->m_protocol != PTHREAD_PRIO_PROTECT)
243 ret = EINVAL;
244 else

--- 51 unchanged lines hidden ---