]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/libkse/thread/thr_msync.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / lib / libkse / thread / thr_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 "namespace.h"
10 #include <sys/types.h>
11 #include <sys/mman.h>
12 #include <pthread.h>
13 #include "un-namespace.h"
14 #include "thr_private.h"
15
16 int __msync(void *addr, size_t len, int flags);
17
18 __weak_reference(__msync, msync);
19
20 int
21 __msync(void *addr, size_t len, int flags)
22 {
23         struct pthread *curthread = _get_curthread();
24         int     ret;
25
26         /*
27          * XXX This is quite pointless unless we know how to get the
28          * file descriptor associated with the memory, and lock it for
29          * write. The only real use of this wrapper is to guarantee
30          * a cancellation point, as per the standard. sigh.
31          */
32         _thr_cancel_enter(curthread);
33         ret = __sys_msync(addr, len, flags);
34         _thr_cancel_leave(curthread, 1);
35
36         return (ret);
37 }