thr_fcntl.c (174689) | thr_fcntl.c (179434) |
---|---|
1/* 2 * Copyright (c) 1995-1998 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) 1995-1998 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/libkse/thread/thr_fcntl.c 174689 2007-12-16 23:29:57Z deischen $ | 29 * $FreeBSD: head/lib/libkse/thread/thr_fcntl.c 179434 2008-05-30 14:47:42Z dfr $ |
30 */ 31 32#include "namespace.h" 33#include <stdarg.h> 34#include <fcntl.h> 35#include <pthread.h> 36#include "un-namespace.h" 37#include "thr_private.h" 38 39int __fcntl(int fd, int cmd,...); | 30 */ 31 32#include "namespace.h" 33#include <stdarg.h> 34#include <fcntl.h> 35#include <pthread.h> 36#include "un-namespace.h" 37#include "thr_private.h" 38 39int __fcntl(int fd, int cmd,...); |
40extern int __fcntl_compat(int fd, int cmd,...); |
|
40 41__weak_reference(__fcntl, fcntl); 42 43int 44__fcntl(int fd, int cmd,...) 45{ 46 struct pthread *curthread = _get_curthread(); 47 int ret, check = 1; --- 15 unchanged lines hidden (view full) --- 63 case F_SETFL: 64 ret = __sys_fcntl(fd, cmd, va_arg(ap, int)); 65 break; 66 case F_GETFD: 67 case F_GETFL: 68 ret = __sys_fcntl(fd, cmd); 69 break; 70 default: | 41 42__weak_reference(__fcntl, fcntl); 43 44int 45__fcntl(int fd, int cmd,...) 46{ 47 struct pthread *curthread = _get_curthread(); 48 int ret, check = 1; --- 15 unchanged lines hidden (view full) --- 64 case F_SETFL: 65 ret = __sys_fcntl(fd, cmd, va_arg(ap, int)); 66 break; 67 case F_GETFD: 68 case F_GETFL: 69 ret = __sys_fcntl(fd, cmd); 70 break; 71 default: |
71 ret = __sys_fcntl(fd, cmd, va_arg(ap, void *)); | 72 ret = __fcntl_compat(fd, cmd, va_arg(ap, void *)); |
72 } 73 va_end(ap); 74 75 _thr_cancel_leave(curthread, check); 76 77 return (ret); 78} | 73 } 74 va_end(ap); 75 76 _thr_cancel_leave(curthread, check); 77 78 return (ret); 79} |