]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libpthread/thread/thr_msync.c
This commit was generated by cvs2svn to compensate for changes in r54820,
[FreeBSD/FreeBSD.git] / lib / libpthread / 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 <sys/types.h>
10 #include <sys/mman.h>
11 #ifdef _THREAD_SAFE
12 #include <pthread.h>
13 #include "pthread_private.h"
14
15 int
16 msync(addr, len, flags)
17         void *addr;
18         size_t len;
19         int flags;
20 {
21         int ret;
22
23         /*
24          * XXX This is quite pointless unless we know how to get the
25          * file descriptor associated with the memory, and lock it for
26          * write. The only real use of this wrapper is to guarantee
27          * a cancellation point, as per the standard. sigh.
28          */
29
30         /* This is a cancellation point: */
31         _thread_enter_cancellation_point();
32
33         ret = _thread_sys_msync(addr, len, flags);
34
35         /* No longer in a cancellation point: */
36         _thread_leave_cancellation_point();
37
38         return (ret);
39 }
40 #endif