thr_condattr.c (181099) | thr_condattr.c (208502) |
---|---|
1/* 2 * Copyright (c) 1997 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/* 2 * Copyright (c) 1997 John Birrell <jb@cimlogic.com.au>. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/lib/libthr/thread/thr_condattr.c 181099 2008-08-01 01:21:49Z davidxu $ | 29 * $FreeBSD: head/lib/libthr/thread/thr_condattr.c 208502 2010-05-24 13:43:11Z deischen $ |
30 */ 31 32#include "namespace.h" 33#include <stdlib.h> 34#include <string.h> 35#include <errno.h> 36#include <pthread.h> 37#include "un-namespace.h" --- 36 unchanged lines hidden (view full) --- 74 free(*attr); 75 *attr = NULL; 76 ret = 0; 77 } 78 return(ret); 79} 80 81int | 30 */ 31 32#include "namespace.h" 33#include <stdlib.h> 34#include <string.h> 35#include <errno.h> 36#include <pthread.h> 37#include "un-namespace.h" --- 36 unchanged lines hidden (view full) --- 74 free(*attr); 75 *attr = NULL; 76 ret = 0; 77 } 78 return(ret); 79} 80 81int |
82_pthread_condattr_getclock(const pthread_condattr_t *attr, 83 clockid_t *clock_id) | 82_pthread_condattr_getclock(const pthread_condattr_t *attr, clockid_t *clock_id) |
84{ 85 if (attr == NULL || *attr == NULL) 86 return (EINVAL); 87 *clock_id = (*attr)->c_clockid; 88 return (0); 89} 90 91int | 83{ 84 if (attr == NULL || *attr == NULL) 85 return (EINVAL); 86 *clock_id = (*attr)->c_clockid; 87 return (0); 88} 89 90int |
92_pthread_condattr_setclock(pthread_condattr_t *attr, 93 clockid_t clock_id) | 91_pthread_condattr_setclock(pthread_condattr_t *attr, clockid_t clock_id) |
94{ 95 if (attr == NULL || *attr == NULL) 96 return (EINVAL); 97 if (clock_id != CLOCK_REALTIME && 98 clock_id != CLOCK_VIRTUAL && 99 clock_id != CLOCK_PROF && 100 clock_id != CLOCK_MONOTONIC) { 101 return (EINVAL); --- 26 unchanged lines hidden --- | 92{ 93 if (attr == NULL || *attr == NULL) 94 return (EINVAL); 95 if (clock_id != CLOCK_REALTIME && 96 clock_id != CLOCK_VIRTUAL && 97 clock_id != CLOCK_PROF && 98 clock_id != CLOCK_MONOTONIC) { 99 return (EINVAL); --- 26 unchanged lines hidden --- |