]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - lib/libc_r/uthread/uthread_msync.c
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / lib / libc_r / uthread / uthread_msync.c
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$
7  */
8
9 #include <sys/types.h>
10 #include <sys/mman.h>
11 #include <pthread.h>
12 #include "pthread_private.h"
13
14 __weak_reference(__msync, msync);
15
16 int
17 _msync(void *addr, size_t len, int flags)
18 {
19         int ret;
20
21         ret = __sys_msync(addr, len, flags);
22
23         return (ret);
24 }
25
26 int
27 __msync(void *addr, size_t len, int flags)
28 {
29         int     ret;
30
31         /*
32          * XXX This is quite pointless unless we know how to get the
33          * file descriptor associated with the memory, and lock it for
34          * write. The only real use of this wrapper is to guarantee
35          * a cancellation point, as per the standard. sigh.
36          */
37         _thread_enter_cancellation_point();
38         ret = _msync(addr, len, flags);
39         _thread_leave_cancellation_point();
40
41         return ret;
42 }