Deleted Added
full compact
thr_connect.c (123365) thr_connect.c (156611)
1/*
2 * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>.
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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2003 Daniel Eischen <deischen@freebsd.org>.
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

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/lib/libkse/thread/thr_connect.c 123365 2003-12-09 23:40:27Z deischen $");
28__FBSDID("$FreeBSD: head/lib/libkse/thread/thr_connect.c 156611 2006-03-13 00:59:51Z deischen $");
29
30#include <sys/types.h>
31#include <sys/socket.h>
32#include <pthread.h>
33#include "thr_private.h"
34
29
30#include <sys/types.h>
31#include <sys/socket.h>
32#include <pthread.h>
33#include "thr_private.h"
34
35LT10_COMPAT_PRIVATE(__connect);
36LT10_COMPAT_DEFAULT(connect);
37
35__weak_reference(__connect, connect);
36
37int
38__connect(int fd, const struct sockaddr *name, socklen_t namelen)
39{
40 struct pthread *curthread;
41 int ret;
42
43 curthread = _get_curthread();
44 _thr_cancel_enter(curthread);
45 ret = __sys_connect(fd, name, namelen);
46 _thr_cancel_leave(curthread, ret == -1);
47
48 return (ret);
49}
38__weak_reference(__connect, connect);
39
40int
41__connect(int fd, const struct sockaddr *name, socklen_t namelen)
42{
43 struct pthread *curthread;
44 int ret;
45
46 curthread = _get_curthread();
47 _thr_cancel_enter(curthread);
48 ret = __sys_connect(fd, name, namelen);
49 _thr_cancel_leave(curthread, ret == -1);
50
51 return (ret);
52}