Deleted Added
full compact
thr_msync.c (123312) thr_msync.c (156611)
1/*
2 * David Leonard <d@openbsd.org>, 1999. Public Domain.
3 *
4 * $OpenBSD: uthread_msync.c,v 1.2 1999/06/09 07:16:17 d Exp $
5 *
1/*
2 * David Leonard <d@openbsd.org>, 1999. Public Domain.
3 *
4 * $OpenBSD: uthread_msync.c,v 1.2 1999/06/09 07:16:17 d Exp $
5 *
6 * $FreeBSD: head/lib/libkse/thread/thr_msync.c 123312 2003-12-09 02:20:56Z davidxu $
6 * $FreeBSD: head/lib/libkse/thread/thr_msync.c 156611 2006-03-13 00:59:51Z deischen $
7 */
8
9#include <sys/types.h>
10#include <sys/mman.h>
11#include <pthread.h>
12#include "thr_private.h"
13
7 */
8
9#include <sys/types.h>
10#include <sys/mman.h>
11#include <pthread.h>
12#include "thr_private.h"
13
14LT10_COMPAT_PRIVATE(__msync);
15LT10_COMPAT_DEFAULT(msync);
16
14__weak_reference(__msync, msync);
15
16int
17__msync(void *addr, size_t len, int flags)
18{
19 struct pthread *curthread = _get_curthread();
20 int ret;
21
22 /*
23 * XXX This is quite pointless unless we know how to get the
24 * file descriptor associated with the memory, and lock it for
25 * write. The only real use of this wrapper is to guarantee
26 * a cancellation point, as per the standard. sigh.
27 */
28 _thr_cancel_enter(curthread);
29 ret = __sys_msync(addr, len, flags);
30 _thr_cancel_leave(curthread, 1);
31
32 return ret;
33}
17__weak_reference(__msync, msync);
18
19int
20__msync(void *addr, size_t len, int flags)
21{
22 struct pthread *curthread = _get_curthread();
23 int ret;
24
25 /*
26 * XXX This is quite pointless unless we know how to get the
27 * file descriptor associated with the memory, and lock it for
28 * write. The only real use of this wrapper is to guarantee
29 * a cancellation point, as per the standard. sigh.
30 */
31 _thr_cancel_enter(curthread);
32 ret = __sys_msync(addr, len, flags);
33 _thr_cancel_leave(curthread, 1);
34
35 return ret;
36}