thr_attr.c (214334) | thr_attr.c (214335) |
---|---|
1/* 2 * Copyright (c) 2003 Craig Rodrigues <rodrigc@attbi.com>. 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 --- 76 unchanged lines hidden (view full) --- 85 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 86 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 87 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 88 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 89 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 90 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 91 * SUCH DAMAGE. 92 * | 1/* 2 * Copyright (c) 2003 Craig Rodrigues <rodrigc@attbi.com>. 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 --- 76 unchanged lines hidden (view full) --- 85 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 86 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 87 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 88 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 89 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 90 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 91 * SUCH DAMAGE. 92 * |
93 * $FreeBSD: head/lib/libthr/thread/thr_attr.c 214334 2010-10-25 09:16:04Z davidxu $ | 93 * $FreeBSD: head/lib/libthr/thread/thr_attr.c 214335 2010-10-25 11:16:50Z davidxu $ |
94 */ 95 96#include "namespace.h" 97#include <errno.h> 98#include <pthread.h> 99#include <stdlib.h> 100#include <string.h> 101#include <pthread_np.h> --- 36 unchanged lines hidden (view full) --- 138int 139_pthread_attr_get_np(pthread_t pthread, pthread_attr_t *dstattr) 140{ 141 struct pthread *curthread; 142 struct pthread_attr attr, *dst; 143 int ret; 144 size_t cpusetsize; 145 | 94 */ 95 96#include "namespace.h" 97#include <errno.h> 98#include <pthread.h> 99#include <stdlib.h> 100#include <string.h> 101#include <pthread_np.h> --- 36 unchanged lines hidden (view full) --- 138int 139_pthread_attr_get_np(pthread_t pthread, pthread_attr_t *dstattr) 140{ 141 struct pthread *curthread; 142 struct pthread_attr attr, *dst; 143 int ret; 144 size_t cpusetsize; 145 |
146 if (pthread == NULL || dst_attr == NULL || (dst = *dstattr) == NULL) | 146 if (pthread == NULL || dstattr == NULL || (dst = *dstattr) == NULL) |
147 return (EINVAL); 148 cpusetsize = _get_kern_cpuset_size(); 149 if (dst->cpusetsize < cpusetsize) { 150 char *newset = realloc(dst->cpuset, cpusetsize); 151 if (newset == NULL) 152 return (errno); 153 memset(newset + dst->cpusetsize, 0, cpusetsize - 154 dst->cpusetsize); --- 503 unchanged lines hidden --- | 147 return (EINVAL); 148 cpusetsize = _get_kern_cpuset_size(); 149 if (dst->cpusetsize < cpusetsize) { 150 char *newset = realloc(dst->cpuset, cpusetsize); 151 if (newset == NULL) 152 return (errno); 153 memset(newset + dst->cpusetsize, 0, cpusetsize - 154 dst->cpusetsize); --- 503 unchanged lines hidden --- |